We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

What changed in 2.11?

Development and Programming

Brian Litzinger's avatar
Brian Litzinger
693 posts
9 years ago
Brian Litzinger's avatar Brian Litzinger

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?

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
9 years ago
Brian Litzinger's avatar Brian Litzinger

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 :(

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
9 years ago
Kevin Cupp's avatar Kevin Cupp

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.

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
9 years ago
Brian Litzinger's avatar Brian Litzinger

Just adding $OUT =& load_class(‘Output’, ‘core’); to Codeigniter.php doesn’t fix it. I think its deeper down the line, but I haven’t had time to dig into it.

Is back-porting the output_show_message hook not an option?

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
9 years ago
Kevin Cupp's avatar Kevin Cupp

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?

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
9 years ago
Brian Litzinger's avatar Brian Litzinger

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.

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
9 years ago
Kevin Cupp's avatar Kevin Cupp

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;
       
Brian Litzinger's avatar
Brian Litzinger
693 posts
9 years ago
Brian Litzinger's avatar Brian Litzinger

Thats awesome, thank you!

While we’re on this topic, what about adding a hook to the system offline method as well (EE2 and 3)? If you don’t want to add another one thats fine, I don’t want to push my luck 😊

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
9 years ago
Kevin Cupp's avatar Kevin Cupp

We’re a little wishy washy on adding the system offline message hook. Seems like an action you wouldn’t typically want much extra processing on. What problem are you trying to solve that isn’t achievable by editing the specialty template?

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
9 years ago
Brian Litzinger's avatar Brian Litzinger

I just got a lot of feature requests for it for CSM, and the way I was extending the Output class I could do that. I guess people like to use version controlled template to display that message.

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
9 years ago
Kevin Cupp's avatar Kevin Cupp

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.