Pods and WordPress 4.9?
-
Hi folks
Thanks for Pods, an amazing enhancement to WordPress ??
What about compatibility with the freshly release WP 4.9, are we good?
Kind regards
BjarneThe page I need help with: [log in to see the link]
-
I’ve upgraded to WP 4.9 on two sites using Pods with no apparent issues. No error messages, no changes in function among existing pods.
Obviously there are a lot of different things that can be done with pods, which means different things that could go wrong — but I haven’t seen any issues at all with the 4.9 upgrade on any of my sites. So of course, make a backup before you upgrade… but no problems so far.
We test our code against all upcoming releases of WordPress. We haven’t pushed our latest release 2.7, yet, but there was nothing added in this version (4.9) that didn’t work with our beta release candidate, either. And as @abigailm mentions: Always test upgrades on a Development copy first! ??
Thanks for the feedback – I’ll give it a spin on a dev-site ??
Hi
You will have heard of the “Can’t edit main theme php files after upgrading to 4.9″ issue. One of the moderators (@clorith) on the relevant forum (title as per above) believes the PODS plugin is causing this issue in my case.
Part of thread:
On the genealogy.ie website, I appear to have an issue with a plugin called “Pods – Custom Content Types and Fields”If I deactivate it and try to make a change to the category.php them file I get the following error:
“Your PHP code changes were rolled back due to an error on line 4 of file wp-content/themes/genealogy/parts/social.php. Please fix and try saving again.
Call to undefined function pods()”
With only this plugin activated, I fall back to the error that is the topic of this thread.”
Reply:
“@genealogydotie PODS is the problem, you are getting an expected result form WordPress that an error was found (since some code elsewhere seems to rely on pods), but the loopback completed as expected when you disabled PODS ??”
Michael
-
This reply was modified 7 years, 3 months ago by
genealogydotie. Reason: Included thread info
Actually, this is the first we’ve heard of the issue. I’ve looked over the Original Forum post which I had to go looking for and you even state yourself, you don’t know what our plugin does, as you were inheriting support of the site from someone else. It sounds like there’s something IN the category.php in your theme or child theme that has been modified specifically to use our plugin, but I don’t see anywhere in the original post where you’ve shared the contents of the theme file. If you’re using a child theme, it’s very likely your theme has been modified. Could you share the contents of this theme file so we might actually try to solve your problem rather than trying to point fingers like the other post did?
Or in this case the social.php that is referenced in the error as well. Both of those file contents would be helpful.
-
This reply was modified 7 years, 3 months ago by
Jim True.
Hi Jim
Thanks for your response. I would like to clarify I am not a developer. I am just trying to help out solving the issue. I also would like to make clear that I am not pointing any fingers, I am just following advice from others.
The website has a very customised theme, which makes trouble shooting a little challenging to say the least. Reading the “Your PHP code changes were rolled back due to an error on line 4 etc.” error, I am indeed pretty sure that there is a line in the social.php file that specifically calls your plugin.
You asked for the category.php:
<?php get_header(); ?>
<div class=”container”>
<div class=”col-sm-8 blog-main”>
<div=”class”>
</div><h1><?php printf( __( ‘Category Archives: %s’, ‘bootstrapcanvaswp’ ), ‘<span>’ . single_cat_title( ”, false ) . ‘</span>’ ); ?></h1>
<hr /><?php get_template_part( ‘loop’ ); ?>
</div>
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>
Unfortunately I don’t have the tools the access the social.php file. But I hope to get that sorted over the weekend and will give you a copy of it once I have it.
But I think you might have answered my question already. If I am the only PODS user who has this issue, I am doubtful the plugin causes the issue.
Kind regards
Michael.
-
This reply was modified 7 years, 3 months ago by
genealogydotie.
You’re find @genealogydotie You aren’t the one who was pointing fingers, that was in the original post and what I was most concerned with is that no one in that post actually offered to help you troubleshoot the issue. It seemed to me they were more concerned with this new feature of WordPress and proving it wasn’t the problem.
The whole idea of editing a theme LIVE on your site has never really been a good one. Typically when you’re editing something, you want a backup and test it on a development server (or locally) and then upload the changes so you don’t break what you have in production. This new feature in WordPress goes against that idea, so to me, it hits the Jurassic Park question: You were so busy figuring out if you could do something that no one actually questioned if you should. Also, when the one person did volunteer to assist, they jumped all over him. That’s not good customer service.
But back to your problem at hand. It looks like the area where the code is stepping in might either be in the ‘header’ actually or in the loop with the:
<?php get_template_part( ‘loop’ ); ?>
So yep, first most critical part is getting access to the file system so you can actually investigate the files. If it’s a customized theme, it’s probably correct to say that they customized the theme in order to take advantage of the fields or post types added with Pods. So yes, if something updated or broke in WordPress 4.9, that caused the function calling pods to not load, that would ’cause that whole rollback and discussion from the other forum.
Let’s primarily focus on getting you back in business though. The site works now, just can’t upgrade to WordPress 4.9, right? I would focus (once you get file access) on making a copy/development site (even if it’s local) so you can fix the issue without impacting their production website.
Thanks again.
Got that sorted. Below is social.php
As expected in line 4 we see it calling for the pods plugin, which if you disable it, makes it stop working (all content in my website disappears bar the header). I don’t have a problem with that in itself. I don’t have/want to disable the plugin. The problem is with the inability to edit with the wp admin tool. (But now I have access via FTP that matters less). I have had a look at loop.php – it quite a complicated one so I need some time to figure out what exactly it does and how it works.
<span class=”sociallinks”>
<?php$genealogy_settings = pods(“genealogy_settings”);
$platforms = array(“twitter”,”facebook”, “youtube”,”youtu.be”,”vimeo”, “instagram”, “linkedin”,”pinterest”,”google”);
$params = array(“limit” => -1);$social_links= $genealogy_settings->display(“social_links”);
$class=””;
foreach(preg_split(“/((\r?\n)|(\r\n?))/”, $social_links) as $line){
$line = strip_tags($line);
if ($line!=””){
foreach ($platforms as $platform){if (strpos($line, $platform )>-1){
if ($platform==”youtu.be”){ $platform=”youtube”;}
$class = $platform;
}
}
echo “$class“;
}
}?>
</span>
<div style=”clear:both;”></div>Yep, this piece is homegrown code, primarily used to open up the contents of a Pods settings page called
geneaology_settings
and load the social links from that. That’s all this piece of code is doing, and since it doesn’t have a check astound it to see if the Pods plugin is active, when you had Pods disabled, You got an error in this code.Does the social links part load when Pods is activated or is the primary issue with the category.php not being editable? What are you trying to fix in that page?
-
This reply was modified 7 years, 3 months ago by
Jim True.
Yes, the social links load, but nothing below that if PODS is disabled.
The issue is the inability to edit from wp-admin. But I have done it now via the FTP link. The page was not displaying correctly on tablets and mobiles; the header was obscuring the first line. I am sure there are more elegant solutions, but I just added a blank row/box at the top of the page.
I am still following the other thread. As mentioned earlier I do not believe the issue of not being able to edit .php files from wp-admin was/is caused by the PODS plugin. I think that was someone jumping to conclusions.
But for now I am sorted. Thanks for looking into this.
@genealogydotie Not a problem, I’m glad you worked it out. And you might’ve been able to solve the issue with CSS. I’ve never had an issue with editing CSS from the WordPress editor because usually CSS can’t completely bring down a site. Editing PHP from the back-end? Definitely not a good idea.
-
This reply was modified 7 years, 3 months ago by
- The topic ‘Pods and WordPress 4.9?’ is closed to new replies.