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

Undefined index: template_notes php errors when updating templates

Development and Programming

Eastwood Design's avatar
Eastwood Design
605 posts
9 years ago
Eastwood Design's avatar Eastwood Design

I started getting these errors when I try and update a template. Using EE v2.11.1 Can anyone shed some light on what is causing this?

A PHP Error was encountered

Severity: Notice

Message: Undefined index: template_notes

Filename: cp/design.php

Line Number: 2103

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/user/admin/codeigniter/system/core/Exceptions.php:170)

Filename: core/EE_Input.php

Line Number: 212

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/user/admin/codeigniter/system/core/Exceptions.php:170)

Filename: libraries/Functions.php

Line Number: 446
       
Eastwood Design's avatar
Eastwood Design
605 posts
9 years ago
Eastwood Design's avatar Eastwood Design

here is the code from cp/design.php

$this->db->query($this->db->update_string('exp_templates', array('template_data' => $_POST['template_data'], 'edit_date' => $this->localize->now, 'last_author_id' => $this->session->userdata['member_id'], 'save_template_file' => $save_template_file, 'template_notes' => $_POST['template_notes']), "template_id = '$template_id'"));

any kind person out there willing to offer some assistance? Just upgraded to EE 2.11.1 and still have the error

Having Save Template Revisions set to yes or no does not fix the issue Same with Save Templates as Files yes or no same issue

       
Robin Sowell's avatar
Robin Sowell
13,159 posts
9 years ago
Robin Sowell's avatar Robin Sowell

I think I ran into this a time or two where the server was dropping any empty post data. Let’s see if that’s the case- just put something in the notes before you try to save. Does that work?

       
Eastwood Design's avatar
Eastwood Design
605 posts
9 years ago
Eastwood Design's avatar Eastwood Design

wow that worked. IS it a server problem then? any other way to fix that or just add a note to each template?

       
Robin Sowell's avatar
Robin Sowell
13,159 posts
9 years ago
Robin Sowell's avatar Robin Sowell

Yep- it’s a weird one. I’ll put a note in the troubleshooting docs to help folks who run into it in the future.

I think it’s a Suhosin filter setting, though I’m not 100% sure which one.

Grab your system admin/host, let them know that empty post data has the key dropped from $_POST and see if they can tweak the server security filters- most likely Suhosin- so that doesn’t happen.

You really don’t want it happening- I know in one of the other cases I ran into, it was causing a problem with a shopping cart too. So definitely could be unintended consequences if left as it is.

And if they tell you the exact setting that did the trick, I’d love to know. Reading the Suhosin config, I’m still not sure.

       

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.