All add-ons currently require PHP 7.4 or greater.

On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.

Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Stash and Custom System Messages conflict with EE3

Status Resolved
Add-on / Version Custom System Messages 3.0.3
Severity
EE Version 3.2.1

JEFFREY SEAVER

Apr 26, 2016

I feel like the following support request might be a similar issue (since there is a mention of TMPL) but because half of the replies are private, I can’t really tell what the issue was. https://boldminded.com/support/ticket/1290

Also, because this is a conflict between two add-ons, I wasn’t sure which developer to contact for support. Because BoldMinded may charge us for troubleshooting a conflict between two add-ons, I went ahead and submitted support requests to both developers.

Description:

EE 3.2.1, Stash 3.0.2, Custom System Messages 3.0.3. Uninstalled all other add-ons and narrowed it down to an issue with these two add-ons. We’ve used these add-ons together a number of times with EE2 without issue, but there seems to be a problem with the EE3 versions.

With Stash uninstalled, CSM works fine. With Stash installed (but not using any Stash tags), CSM throws an error when displaying an EE error/system message. I narrowed it down to the usage of the template_post_parse hook. If I manually disable Stash’s use of that extension hook (disabling it in exp_extensions), CSM works fine.

Error message when CSM tries to display an EE error/system message (such as form validation errors when logging in):

Exception Caught
No such property: ‘TMPL’ on EllisLab\ExpressionEngine\Legacy\Facade
Facade.php:107

Example template code (submitting this form with incorrect username/password triggers CSM, which then throws the error):

{exp:member:login_form return=“account/index”}



{/exp:member:login_form}

Detailed steps to reproduce the issue:
1. Install EE 3.2.1 with CSM 3.0.3
2. Specify templates for Submission and General errors in CSM settings (templates can be empty, all other CSM settings can be default)
3. Add template with code for a simple login form (see above)
4. Submit login form with incorrect info to verify it is working correctly
5. Install Stash add-on
6. Submit login form with incorrect info to see error

#1

BoldMinded (Brian)

If you’re using CSM 3.0.3 it should be working. These were the additions in 3.0.3 that should make it not conflict with other add-ons:

public function template_post_parse($final_template, $sub, $site_id)
    {
        if (ee()->extensions->last_call) {
            $final_template = ee()->extensions->last_call;
        }
public function output_show_message($data)
    {
        if (ee()->extensions->last_call) {
            $data = ee()->extensions->last_call;
        }

Does Stash have a similar call at the beginning of each of its hooks too?

#2

JEFFREY SEAVER

Yes, Stash does have the following code at the beginning of it’s hook:

if (isset(ee()->extensions->last_call) && ee()->extensions->last_call)
{
    $template = ee()->extensions->last_call;
}

Stash support suggested this fix which ended up working, and I wanted to share it with you in case there’s anything in CSM that might be causing the conflict:

”[…] another possible problem could be the logging call on line 537 of ext.stash.php:

ee()->TMPL->log_item("Stash: batch processing queued queries");

I’m guessing it’s possible CSM unsets TMPL so it doesn’t exist. You could comment out or delete this line and see if it solves the problem.”

Commenting out that line in the Stash add-on gets everything working fine for us for now. Thanks for the quick response!

#3

BoldMinded (Brian)

CSM doesn’t unset or modify TMPL. It will only create a new local instance of it if it does not exist… maybe another add-on is killing the object?

#4

JEFFREY SEAVER

All other third-party add-ons were uninstalled for testing and confirming this conflict was between Stash and CSM.

However, after we got this working with Stash, by commenting out that one line of code in the Stash add-on, we are running into problems with other add-ons. If the error template CSM displays includes template tags for any other add-on (tested with Shortlist, Construct, Low Search and Low Variables), we are getting the same error. Basically, any third-party add-on that uses tags starting with “exp:”.

And again, we are using 3.0.3 that does include the code you referenced above.

#5

BoldMinded (Brian)

I feel like this is more of a Stash issue. Stash does some pretty complicated and sneaky things with templates. CSM, as previously mentioned, does not modify the existing TMPL object. It uses the existing object or creates a new one and simply runs the template parser with the defined template and returns the output, just like EE core does. I don’t see how CSM would be the culprit here, but I’m open to be proven wrong. Debugging the complexity of Stash isn’t included in my normal support. https://boldminded.com/support-terms-conditions

#6

JEFFREY SEAVER

I think you misunderstood my last message or I didn’t communicate it clearly.

The Stash issue is fixed. Now with Stash fixed, we are having other issues with CSM and other add-ons.

I have disabled ALL third-party add-ons except CSM and one other add-on at a time (Stash, Shortlist, Low Search, Low Variables, etc.) and CSM is throwing the same error with each of these other add-ons.

So Test 1 was CSM and Stash installed only. Commenting the line in Stash fixed that conflict.

So now for test 2, I uninstalled Stash, then installed Shortlist. Now we get the same error when only CSM and Shortlist are installed and there is a Shortlist tag in the error template.

#7

BoldMinded (Brian)

Sorry if I misunderstood.

Can you comment out these lines in the CSM extension file and see what happens?

https://www.dropbox.com/s/nktloplii84g58m/Screenshot 2016-04-29 17.28.12.png?dl=0

#8

JEFFREY SEAVER

I commented out those four lines and still have the same error.

#9

BoldMinded (Brian)

Comment has been marked private.

#10

JEFFREY SEAVER

I don’t know if I should be able to see the comment you just made… it says it has been marked as private. I am logged in to the account I used to create this support ticket.

#11

BoldMinded (Brian)

I emailed the link to the accounting@… address on your account.

#12

JEFFREY SEAVER

Awesome! The version you provided does fix the issues for all add-ons that were conflicting, even Stash (I removed the temporary bug fix they recommended).

#13

BoldMinded (Brian)

Good to hear!

Login to reply