I haven’t had time to dig into this due to starting a new job and being crazy busy this week, and I don’t have my dev environments near me. What changed in 2.11 to cause CSM to break? I’m getting reports of white screens, and someone at EllisLab instructed a customer to comment out line 174 of the ext file, which so happens to be the most crucial line of the extension. Without it the extension will not work. The line in question is this:
$this->EE->output = new System_Messages_Output;
history: https://boldminded.com/support/ticket/1283
What changed that would stop this from working?
The issue seems to be with how 2.11 does not assign variables as a reference anymore.
In EE_Output.php the final_output property is null, so nothing is getting returned. CSM has been extending the EE_Output class for some time now (6+ years) and overriding the EE->output property (a hacky but workable solution).
Custom System Messages is effectively a dead extension now unless the output_show_message hook that was added to the 3.x branch is added to the 2.x branch as well :(
Sorry for the trouble, Brian. Yes we removed a bunch of seemingly-unnecessary assign-by-references for PHP 7 compatibility, looks like we accidentally broke this hack. Do you know which assignment in particular caused the issue? Is it the load_class calls in CodeIgniter.php? If so, those could easily be put back as those were actually valid under PHP 7.
We might be able to, but either way, we have to put out a new release, so I figured the option that keeps your add-on working across multiple 2.x versions and without modification by you would be preferable. Plus whatever the core issue is might have broken other add-ons. Would you rather change CSM to use a hook?
I tried messing around with restoring functionality, but no dice. I’m kind of surprised the hack lasted this long to be honest. I never asked for a hook sooner b/c the hack just worked and wasn’t very intrusive (relatively speaking). Adding a proper hook might be the best thing going forward. I know it means waiting on a new release, but in the mean time I can have customers manually add it.
Ok I ran it by the team and we’re going to add this hook in to the next EE2 release. Implementation is the same as in EE3, just replace that echo stripslashes($row['template_data'] );
on line 323 with this:
$output = stripslashes($row['template_data']);
// -------------------------------------------
// 'output_show_message' hook.
// - Modify the HTML output of the message
// - added 2.12.0
//
if (ee()->extensions->active_hook('output_show_message') === TRUE)
{
$output = ee()->extensions->call('output_show_message', $data, $output);
}
//
// -------------------------------------------
echo $output;
Ran it by the team, since we’ve been making things save as files lately (like variables and snippets), sounds like we would rather make those specialty templates able to save as files as well. So unless there are other use cases, we’re not sure we want to add a hook for something we plan to address down the road.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.