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

Error when clicking on template in CP

Development and Programming

liberty79's avatar
liberty79
135 posts
5 years ago
liberty79's avatar liberty79

I have many templates, but I only get this error on one template (a pretty important one). If I click on the template name (or the edit/settings buttons) in the Control Panel, I get the following error:

Fatal error: Call to a member function getId() on null in /path/to/system/ee/EllisLab/ExpressionEngine/Controller/Design/Template.php on line 1125

I’ve tried copying and renaming the template, uploading it, deleting the old template and renaming the new template to the correct name. No luck.

This may have started after an upgrade from EE3 to the current version. Everything else is working fine.

Any thoughts?

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

That’s about always due to some corruption in the database. The template has a member_id saved, but it no longer exists in exp_members. Or it has access restrictions and it’s set to redirect to a template id that no longer exists. Does that get you pointed in the right direction?

       
liberty79's avatar
liberty79
135 posts
5 years ago
liberty79's avatar liberty79

Sorry Robin, not really. Could you recommend a way to narrow down the issue?

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

Try running these queries- you can do it in something like phpmyadmin or in EE’s query form in utilities.

select * from exp_templates where no_auth_bounce != '' and no_auth_bounce NOT IN (select template_id FROM exp_templates)

select * from exp_templates where last_author_id NOT IN (select member_id FROM exp_members)

If you get any result on either one? Those have bad data in them.

So if you get any templates on that first one, you know the no_auth_bounce value is bad and you need to change it to something that does exist (or just blank it out).

That help?

       
liberty79's avatar
liberty79
135 posts
5 years ago
liberty79's avatar liberty79

it does help, thanks. Before I blank out the number in the no_auth_bounce column, could you tell me what those numbers mean?

       
liberty79's avatar
liberty79
135 posts
5 years ago
liberty79's avatar liberty79

i got brave and blanked out that column and it worked. thanks Robin

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

Lol- you were fast. Or… I was slow.

The number is the template_id you want to send people to if they don’t have access to the current template.

If you don’t have anything in there, it’s going to give them an EE 404.

And I’m glad that worked!

       

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.