Community Forums › Forums › Archived Forums › General Discussion › stripslashes error with Genesis 2.1.2 and child themes
- This topic has 4 replies, 2 voices, and was last updated 9 years, 5 months ago by Summer.
-
AuthorPosts
-
November 12, 2014 at 1:18 am #131263SummerMember
I have a handful of sites that are still running xhtml child themes, and at some point I updated them to the latest version of Genesis, v2.1.2, but this also happened on one html5 child theme, but I haven't pinpointed the exact cause or plugin as of yet, but the effect is interesting.
Whenever I update a post on some of these sites, this error pops up:
Warning: stripslashes() expects parameter 1 to be string, array given in /wp-content/themes/genesis/lib/admin/term-meta.php on line 241 Warning: Cannot modify header information - headers already sent by (output started at /wp-content/themes/genesis/lib/admin/term-meta.php:241) in /wp-admin/post.php on line 233 Warning: Cannot modify header information - headers already sent by (output started at/wp-content/themes/genesis/lib/admin/term-meta.php:241) in /wp-includes/pluggable.php on line 1173
Repeat that first error 12 times before getting to the last two errors.
I found one post on the web that suggests a solution for this problem, and it did work when I tested it:
http://wp-event-organiser.com/forums/topic/custom-field-produces-error-on-genesis-themes/Basically, the suggestion is to edit term-meta.php and change
stripslashes()
tostripslashes_deep()
on line 241.I'm obviously leery of this as a long term solution, because it'll go away next time Genesis is updated, and who knows if I'll remember that I had to hack that to fix it ๐ Of course, it's possible that some of those sites will have been updated to HTML5 themes by then, but a couple of them are true archive sites now... no need to do theme updates.
At this point, I'm not sure if it's the podcasting plugin, or maybe the Co-Authors Plus / Genesis Co-Authors Plus combination, or some other plugin. I know a similar problem cropped up when I did the HTML5 update for Slice of SciFi, and the error appeared with the guest authors, and went away when I edited term-meta.php -- same as with this.
What I can't figure out is why it's happening only on a select few sites, and not others. It happened on Epik, Lifestyle 1.0, and Streamline 1.0.1, but not on Associate 1.0 or News 2.0.1, thus my confusion. The Epik, Streamline and News sites are running WP 4.0 and the others are still on 3.9.2, so that's not a common factor either.
Has anyone else run across this problem? And yes, I've submitted this to Support already, but I figured it couldn't hurt to ask here as well, since the person who found the solution in the above thread said he brought it up with StudioPress in August 2013, so I'm more than a little curious why it wasn't addressed, or if it was what the alternative solution is to hacking Genesis core.
One site currently with this behavior is kickassmysticninjas.com... I haven't done the term-meta.php edit there yet.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkNovember 12, 2014 at 12:55 pm #131326David ChuParticipantHi,
Interesting question. Honestly, I don't know. But I could at least point you in a direction. From what you're describing, I'm going to guess that it's a plugin doing it, and that it has to do with custom fields (the meta clue). Custom fields via plugins could come from something like ACF, Types, Custom Field Template, etc., or anything else that adds material to a regular Post. Some plugins die if a field is empty (null), so the plugin would want to check for nulls in that case. It can also have to do with array conflicts.That being the case, I'd update plugins of that type first to see if that helped.
I'm pretty sure SP will advise you to check this route. They certainly won't advise hacking the core.
Good luck,
Dave
Dave Chu ยท Custom WordPress Developer – likes collaborating with Designers
November 12, 2014 at 10:54 pm #131366SummerMemberI'm almost certain that Co-Authors and Genesis Co-Authors are in play here, but the fact that these same plugins have worked for several years on these same Genesis sites until various combinations of updates to Genesis 2.1.2 would seem to suggest a change in Genesis behavior somewhere, or perhaps on an outside change, in PHP version/behavior.
On a whim, I downgraded kickassmysticninjas.com to Genesis to 2.0.2, and the error still happens. So it happens on a site running on WP 4.0 with Genesis 2.1.2/2.0.2 with an xhtml child theme, and it happened on a site running WP 4.0 with Genesis 2.1.2 with an html5 theme (it did before I hacked it).
It does not happen on a site running WP 3.9.2 with Genesis 2.1.2 with an xhtml child theme.... and all these sites have Co-Authors Plus and Genesis Co-Authors Plus, so it seems there's something different in WP 4.0 that triggers this and tracking it down is a little bit beyond my PHP skills.
and the plugins in question are already up to date.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkNovember 13, 2014 at 10:11 am #131428David ChuParticipantI looked around, and I also saw references to Co-Authors Plus for similar errors. I bet you've narrowed down the culprit, since it seems to be a common factor.
I agree, you'll probably need to hire someone to tear the plugin code apart. You may be dealing with arrays, null fields, and pawing through lots of PHP code. Neither of those plugins have been updated recently.
Or you could just decide how important those plugins really are, and try testing with them disabled.
Good luck.
Dave Chu ยท Custom WordPress Developer – likes collaborating with Designers
November 13, 2014 at 5:08 pm #131469SummerMemberActually, in my searches, Genesis generates this error with a handful of other plugins, going back over a year... looks like starting with Genesis 2.0, perhaps? It doesn't seem to be a PHP 5.3/5.4 thing, it seems to be a custom fields thing within those plugins, but I'm not sure exactly why some custom fields trigger this error and some don't.
And both of those plugins were updated earlier this year, so what's your definition of recently? ๐
Those plugins are very important. Since WordPress does not as yet provide a way for guest authors to have bylines without giving them accounts, these two plugins provide an invaluable service. I'm running several sites where without those plugins, I'd have WP accounts lying fallow for years with who-knows how poor a password on them, and I'd rather not have them be a vulnerable point of attack. I even have a couple of accounts from people who have passed away in the interim, so not having an open/active account for them would be a good thing to transition to.
It wasn't until recently that WP added the "No Role for this site" to lock out accounts, but not having the account in the first place while still allow me to provide them with a byline is even better.
The Genesis Slider and Genesis Responsive Slider plugins haven't been updated in well over 2 years, so the "well the plugin hasn't been updated in 2 days, so that's the problem" stance doesn't and will never fly with me. There are a lot of Genesis plugins that haven't been updated since before 2.0 came out... but I don't see people flocking to disavow all of those yet.
SP support said they would pass it on to the devs for evaluation, so maybe there's something more to this. And the only workaround is the core hack, but since I did it one site without incident, the other two will soon undergo similar surgery.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After Dark -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.