#628 - version 7.1.6-- flagrant message not appearing after purchase
| Identifier | #628 |
|---|---|
| Issue type | Minor issue (breaks specific functionality) |
| Title | version 7.1.6-- flagrant message not appearing after purchase |
| Status | Completed |
| Handling member | Chris Graham |
| Addon | ecommerce |
| Description | Hello,
I (as Admin) created a test flagrant text message for the first time today (because a user is interested to buy it), but it's not appearing in the footer. I tried both purchasing it through the point store and creating it directly in the Admin Zone flagrant message manager. However, if I enter something in the 'Default Flagrant text' in the Site Options configuration screen, that does appear in the footer. Perhaps I'm missing a step that's practically staring straight at me, but I'm not finding it so far. (Note-- I did change the page language Translation to say "Featured text message" instead of "Flagrant text message") |
| Steps to reproduce | |
| Funded? | No |
| Commits |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".


Comments
The is-active check (based on days booked) is not performed correctly, meaning nothing is being picked.
Also the system-message and current message are randomised 50:50, even if no system-message is set. Ideally it would just use the current message if the system-message is blank.
support.php is back-ported to 7.1.6 (upload to sources/).
I uploaded the support.php file for 7.1.6 and the flagrant text message worked, but when navigating back to the home page, the Images and Video carousels (and maybe more blocks below) were out of wack and I got the error message, "1532: Uncaught SyntaxError: unexpected token ILLEGAL"
Replace:
function get_flagrant()
{
...
}
with:
function get_flagrant()
{
if (!addon_installed('flagrant')) return new Tempcode();
$system=(mt_rand(0,1)==0);
$_flagrant=NULL;
if ((!$system) || (get_option('system_flagrant')==''))
{
$_flagrant=persistant_cache_get('FLAGRANT');
if (is_null($_flagrant))
{
$flagrant=$GLOBALS['SITE_DB']->query_value_null_ok_full('SELECT the_message FROM '.get_table_prefix().'text WHERE active_now=1 AND activation_time+days*60*60*24>'.strval(time()),true/*in case tablemissing*/);
if (is_null($flagrant))
{
persistant_cache_set('FLAGRANT',false);
} else
{
$_flagrant=get_translated_tempcode($flagrant);
persistant_cache_set('FLAGRANT',$_flagrant);
}
}
if ($_flagrant===false) $_flagrant=NULL;
}
if (is_null($_flagrant))
{
return make_string_tempcode(get_option('system_flagrant'));
} else
{
return do_lang_tempcode('_COMMUNITY_MESSAGE',$_flagrant);
}
}
After uploading the new one, I had emptied the template and block cache before checking things out
(Click to enlarge)
$PHP_REP_FROM=array('\\',"\n",'$','"');
$PHP_REP_TO=array('\\\\','\n','\$','\\"');
$PHP_REP_TO_TWICE=array('\\\\\\\\','\\n','\\\\$','\\\\\"');
If that was corrupted somehow, that might cause a problem like this.
The other blocks looked normal, except the side panels had disappeared. I have to go out for a bit now, will check back later