sc_ajax_message() not working in production environment?

I’m getting a strange problem with sc_ajax_message. It is working OK in development when on the localhost server - but when I deploy to production the message box appears when it should but just gives a single letter “I” for both Title and message body - instead of the full message.
The code I’m using in an AJAX onupdate is:

sc_ajax_message(‘Account Status was updated’,‘Info’);

I’ve inspected the HTML and it is showing correctly when run in development but after deployment the same inspection shows:

" <span id=“id_message_display_text”>I</span> " - so the message box jut show an I character in both Title and Message.

However the generated php on the live server seems identical to the development generated php. I’ve even tried manually editing the generated php of the sc_ajax_message function on the development server to “fix” the message by replacing the generated:
" $this->NM_ajax_info[‘ajaxMessage’][‘message’] = NM_charset_to_utf8($sMessage); "
with:
" $this->NM_ajax_info[‘ajaxMessage’][‘message’] = ‘test’; " but it ignores it so the HTML on the webpage still just shows “I”?

Anyone know if this means it must be some incompatiblity issue issue of the php server on the live host?

Has anyone else had a similar isse?

Many Thanks for any ideas/suggestions!

Since update to 9.2.015 I’m now getting this same issue on development. 9.2.015 and extends also to windows alert boxes as well as the sc_ajax_message() macro mentioned above. For example:

sc_ajax_javascript(‘alert’, ‘Sorry! - Spec is currently locked by user:’);

gives me a window alert box that just shows “S”.

As noone seems to be getting the same issue and my issue now applies to development as well as production so I’m guessing is not php server compatibility issue can anyone tell me where I am going wrong?

Anybody got an answer to this problem ? I am using version 9.3.006 and stil have this problem with sc_ajax_message and sc_alert, both work fine on dev but not on prod.

I have a similar issue and I am on 9.4 using SweetAlert. The development message is fine, but the production is a single letter. “A” in my case.

I’m running SC 9.4.006 with PHP 7.0.33 in my development environment. I had the same issue today. I WAS running PHP 7.2 in my production environment. After downgraded PHP to 7.0.33, the SweetAlert message boxes work correctly now.

i have the same issues. Scriptcase is looking at it

Me too. I have an A

I just downgraded PHP from 7.3. to 7.0.33 and indeed it fixes the problem. Not happy to downgrade so let’s hope they fix this.

Is this an issue which exists already 1 year and more?
I have it too on my production. and I cannot just go to php 7.0.33, cause my curent PHP is for VC15, but PHP 7.0.33 is for VC14, and therefore not compatible with my ApacheServer using VC15

Just to record my issue: Yes , I have the same issue. Using PHP 7.3. The sc_ajax_message just shows a Y.
Any fix yet for this ?
My code as follows :
$javascript_title = 'Welcome Back '; // Javascript message title
$javascript_message = 'Hello '.$cust_name_first ." ".$cust_name_last; // Javascript message contents

 // Display javascript message
       sc_ajax_message($javascript_message, $javascript_title);

It is not a good idea to run production with a higher PHP version then the IDE has. I hope that SC is working hard to fix this as 7.0 is out of maintenance and even 7.1 is close. But the currently supported PHP of Scriptcase is 7.0 and you need to use that on your production systems.

I’ve just noticed that when an app is set to “Use SweetAlert” and then I use sc_alert instead of sc_jax_message, the end result in our PHP7.3 production environment is correct: the message text is displayed correctly within the Sweetalert.

I was not using any option with sc_jax_message so I don’t know it there could still be some issues witch sc_alert and options.
But according to the documentation, sc_alert has a parameter for passing Sweetalert2 options:
https://www.scriptcase.net/docs/en_u…cros/#sc_alert

Also, I’m not on SC with PHP 7.3 support (9.4.016+) yet, so no idea what will be the behavior when I’ll upgrade.

Same problem with 9.4.14 and php 7.2.24. It’s working in my Winodw Dev platform and tell “Y” on my Linux Ubuntu 16 with php 7.2 with this code in ajax event :

    sc_ajax_message("Error in the period of Campaign, End Date need to be after the start Date !!!","Be careful !");

I’m personnaly tired to spent more time to find workarouds of scriptcase bugs than time to develop my own code.

@Laurent_Menard

did you try to use sc_alert instead of sc_ajax_message?

I was having the exact same problem with sc_ajax_message but with sc_alert it seems to work perfectly.

You save my day robydaho !! It’s working with sc_alert macro !!! :slight_smile: