Closed alfredo49 closed 2 years ago
Hi @alfredo49
Can you share the errors you mention?
Hi @JoryHogeveen
In the image, at the bottom
Database Error; SQL: SELECT DISTINCT t
., d
. FROM wp_posts
AS t
LEFT JOIN wp_pods_meme
AS d
ON d
.id
= t
.ID
LEFT JOIN wp_term_relationships
AS polylang_languages
ON polylang_languages
.object_id
= t
.ID
AND polylang_languages
.term_taxonomy_id
= 2 WHERE ( ( category
.slug
= 'home-meme-es' ) AND ( t
.post_type
= 'meme' ) AND ( polylang_languages
.object_id
IS NOT NULL ) AND ( t
.post_status
IN ( 'publish' ) ) ) ORDER BY destacado DESC, post_date DESC, t
.menu_order
, t
.post_title
, t
.post_date
LIMIT 0, 6; Response: Unknown column 'category.slug' in 'where clause'
And SQL error:
[18-Nov-2021 09:05:16 UTC] Error Unknown column 'category.slug' in 'where clause' de la base de datos de WordPress para la consulta SELECT
DISTINCT
`t`.*, `d`.*
FROM `wp_posts` AS `t`
LEFT JOIN `wp_pods_meme` AS `d` ON `d`.`id` = `t`.`ID`
LEFT JOIN `wp_term_relationships` AS `polylang_languages`
ON `polylang_languages`.`object_id` = `t`.`ID`
AND `polylang_languages`.`term_taxonomy_id` = 2
WHERE ( ( `category`.`slug` = 'home-meme-es' ) AND ( `t`.`post_type` = 'meme' ) AND ( `polylang_languages`.`object_id` IS NOT NULL ) AND ( `t`.`post_status` IN ( 'publish' ) ) )
ORDER BY destacado DESC, post_date DESC, `t`.`menu_order`, `t`.`post_title`, `t`.`post_date`
LIMIT 0, 6 realizada por require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/html5blank-child/page-home.php'), printLastMeme, Pods->find, PodsData->select, pods_query, PodsData::query
Hi @alfredo49
What code is calling this? It looks like a template correct? Are you using a shortcode? Please share!
Note: I removed all duplicate errors in your post
Hi:
Correct, im using my custom php templates with database calls to get de data, no shortcodes.
In my website i have several CPT created by Pods Framework (Memes, Noticias, Corredurias). Last items of these CPT are called in my front page, these errors are returned when these calls occur.
All worked perfect (included 2.4.8.1 version) since 6 years, until today when the site was updated to pods 2.8.5
For example ( i dont say here is the problem, i dont think was the only issue) and related with the last SQL error i have this function called from page-home.php:
function printLastMeme()
{
$content = '';
$homeMemeLangcategory = "'home-meme-". pll_current_language()."'";
$lastMeme = pods('meme')->find(array
(
'orderby' => 'destacado DESC, post_date DESC',
'limit' => N_MEME_HOME_CAROUSEL,
'where'=>"category.slug = $homeMemeLangcategory"
));
for($i=0; $lastMeme->fetch(); $i++)
{
if($i==0)
{
$content .= '<div id="first-meme" class="meme_content">';
$content .= '<div class="meme_img_container"><a class="item_image" href="'.addCorreduriaParam('/meme/' . $lastMeme->display('slug')).'"><img src="' . $lastMeme->display("imagen") . '" class="img-responsive" /></a></div>';
$content .= '<div class="meme_desc">';
$content .= $lastMeme->display('descripcion');
$content .= printMemeShareLinks($lastMeme);
$content .= '</div>';
$content .= '<br class="clear hidden-lg" />';
$content .= '</div>';
$content .= '<div id="bulletin-gallery-wrapper">';
$content .= '<div id="bulletin-gallery">';
}
else
{
$content .= '<div class="meme-img-wrapper gallery-cell">';
$content .= '<a class="item_image" href="'.addCorreduriaParam('/meme/' . $lastMeme->display('slug')).'"><img src="' . $lastMeme->display("imagen") . '" class="img-responsive" /></a>';
$content .= '<br class="clear" />';
$content .= '</div>';
}
}
$content .= '</div>';
$content .= '<div id="all-memes-wrapper">';
$link = addCorreduriaParam('/memes-' . pll_current_language());
// $link2 = _e('Ver todos', 'html5blank-child');
$content .= '<a class="all_link" href="'.$link.'">'.esc_html__('Ver todos', 'html5blank-child').'</a>';
$content .= '</div>';
$content .= '</div>';
return $content;
}
Something has changed in Pods Framework Code 2.8.5 that produces these errors
Looking at your code and site I don't see anything related to Pods that would break like this. Also, when visiting your site I see 404 errors on CSS files being loaded.
It looks like not only Pods has been updated, but your theme as well. At least it cannot find it's styles anymore.
Apart from the above, the SQL error is indeed Pods related so we'll look into that!
Hi:
Nothing has been updated apart of Pods Framework, is a custom theme, his code hasnt been changed during years..., in fact, when i roll back to pods 2.8.4.1 site runs perfect again..
Hmm weird about the CSS file then.
Anyhow, could you try to clear the Pods cache? Pods > Settings > Clear cache.
We've changed an error in object registering for existing WP objects and category
is one of those existing objects.
Hi:
Clear cache doesnt solve my issue. I try that.
In addition to the problem produced with the styles, there are PHP errors also produced by the update of the Pods Framework plugin. In fact, these problems prevent "correduria" (left sidebar) data and "meme" images (Both Pods Frameworks items) were loaded.
You can see 2 images in my original post where you can see how is the web currently looking (pods 2.8.5) and what should be look (pods < 2.8.5 versions)
Hi @alfredo49
The UI of a website doesn't tell that much of the actual error unfortunately. However, your code and errors do!
I tried some things to reproduce your issue on Pods 2.8.5 (and versions before that) but I cannot seem to succeed to recreate your situation.
Just curious. If you go to your Edit Pods screen and edit the meme
Pod. See the Connections
tab, is Category
checked there?
Hi:
I confirm style 404 errors are not related with Pods issue, the website works perfectly despite them, we can descart them. There were before this issue. They do not interfere with the correct viewing of the website.
REst API not activated
In the other hand when you click in "Consultar noticias anteriores" top button or in a post, these pages works perfectly, is a problem with home page.
Hi @alfredo49
Is Meme an extended post type? How is it related to the WP core category
taxonomy? Through code?
REST API is only needed for the block editor.
Hi @JoryHogeveen
Yes, Meme and Noticia are Post Types Extended.
I did not code the website but in both, when you create an item they havent the box when you select the categories because they havent. Iin the dashboard when you Click Meme => Categories, here appears native WordPress Categories
Abother thing @JoryHogeveen
When i update to PODS 2.8.5, Post Types extended (Memes and Noticias) in the dashboard both names are changed to "Entradas" (post in english, above Boletines in the black wordpress menu), it is the default name for post in WordPress.. This is also a bug :/ , i dont know if i should be open a new ticket
I try to reset cache but nothing changes, their original names are lost
Hi @alfredo49 It looks like an issue with extending existing Post Types.
Could you try to do the following?
As with all debugging, please test on a staging website!
@sc0ttkclark Note that these Pod fields are stored in tables, not meta from what I can tell about the package.
Hi @JoryHogeveen
Doing this steps not solve my issues. Now its even worse :-(
Post Types extended no longer appear in the Pods Framework list of pods, instead they do appear in the Wordpress dashboard (now called "Entradas")
The reason can be when i reimport an error message is returned "Tag reserved for wordpress or pods internal use, try with another name", This issue can be related that now (when i update to pods 2.8.5) "Memes" and "Noticias" are called "Entradas" (between Corredurias y Boletines CPT)?
"
Anyway, it seems that the CPTs and their items have been reimported in the backend.
The reason can be when i reimport an error message is returned "Tag reserved for wordpress or pods internal use, try with another name", This issue can be related that now (when i update to pods 2.8.5) "Memes" and "Noticias" are called "Entradas" (between Corredurias y Boletines CPT)?
It looks like the names of these post types might be changed? Where are the Entradas post types coming from when you have Pods disabled? Also, it's weird that both post types have the same name...
Could you create a staging/dev site we can access? I just noticed you followed my steps on your live website, please always use a staging site first!
Could you create a staging/dev site we can access? I just noticed you followed my steps on your live website, please always use a staging site first!
I have backups last 7 seven days, you can do test without problem, this site is really a copy with very few daily visits of another site that has a lot of movement and that happens exactly the same issue with pods 2.8.4 and superior (this another site i have to roll back to 2.8.3)
where can i pass you wp-admin access?
Hi @JoryHogeveen
I just edited the title of the issue because I have already found the source of the problem. You can forget everything I said before because the issue appears in versions >= 2.8.4 , until pods 2.8.3 all works perfectly.
All my elements created with Pods Framework are of type Custom Post Type since 6 years i created this website.
Everything worked perfectly until version 2.84. When I upgraded from 2.8.3 to 2.8.4 "Memes" and "Corredurias" Custom Post Types were automatically converted to "Custom Post Types Extended" I don't know the reason, but when you roll back to 2.8.3 again, "Memes" and "Corredurias" are once again Custom Post Types.
Only happen with with these 2 CPTs, with the rest CPT this problem doesnt happen :/
I have also tried to update directly from pods 2.8.3 to pods 2.8.5 directly but it also converts them to Custom Post Types Extended. I don't understand the reason.
Last version works ok is Pods 2.8.3
This screenshot are my pods in versions < 2.8.4
In the other hand, this screenshot are my pods in versions >= 2.8.4
@sc0ttkclark Did we change anything in the hooks when registering our Pods to WP? The only think I can think of is that before 2.8.4 the mentioned post types (meme and noticia) weren't registered when Pods register method started and maybe after 2.8.4 they do?
Pods 2.8.x checks for whether a post type is extended or not based on whether it already exists when Pods goes to register content types during init action priority 11.
If the post type or taxonomy exists already, it won't register on top of it and will instead treat it like an extended post type / taxonomy.
If the post type or taxonomy is extended but then removed from the custom code / plugin / theme, then Pods will treat it like a custom one and register it accordingly. This allows Pods to take over a post type / taxonomy being migrated into Pods away from another solution.
Hi @sc0ttkclark
In my case with Pods 2.8.3 no issues, "Meme" and "Noticia" are treated as CPT as it should be. This has been in this way since 2015.
When i update from 2.8.3 to 2.8.4 & 2.8.4.1 or 2.8.5 "Meme" and "Noticia" are converted automatically to Custom Post Types Extended and changing their names in Wordpress left menu to "Entradas" and frontend page messed up. Because "Noticia" and "Meme" no longer CPT. If restore to 2.8.3 all works OK and "Meme" and "Noticia" are CPT again. The strange thing is that I have other CPTs created in the same way that are not converted to CPT Extended.
All CPT in my website are created using Pods framework, my code only read the pods items fields, no removing, changing item data,cpt or similar. Also all CPT items are introduced from WordPress Dashboard. I also i dont use a external plugin that modifies pods.
If you need admin access to my site for investigating the issue, give me please an email where i send you access data.
Thxs
The only difference is that "Meme" and "Noticia" that are converted to Custom Post Types Extended, have in "Built-in Taxonomies" category active
The other CPTs that are not converted, havent "categories" checked
I try to deactivate in "meme" and "noticia" category in "Built in Taxonomies" but the result when i update is the same :-(
Also a strange thing happens to me, I'm testing on Pods 2.7.28 (this version worked fine) but when I go to the pods panel when I delete "Meme" or "News" CPT, instead of disappearing from the wordpress black side panel they remain there but renamed as "Post", on the other hand in my other CPT they are deleted normally and disappear.
Also Is imposible delete it, also i cant create the CPT again because Pods say me "This CPT already exists" :/ What is happen? How i solve this? :-(
Problem solved!!
I checked my functions.php code and there is this function:
add_action( 'init', 'add_custom_feed' );
function add_custom_feed() {
$args = array(
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
);
register_post_type( 'meme', $args );
add_feed( 'meme', 'add_meme_feed' );
register_post_type( 'noticia', $args );
add_feed( 'noticia', 'add_noticia_feed' );
}
This function add "Meme" and "Noticia" to feed, the problem is registering "meme" and "noticia", This is what confuses Pods Framework that's why it extends it
Commenting
//register_post_type( 'meme', $args );
//register_post_type( 'noticia', $args );
All problems dissapears!!
I think I've finally reproduced the issue locally and put some fixes into place that address this.
Fixed via c3a55c6f92e8ba661a4c69fa4f7380d64bc73856
Description
When i updated to Pods 2.8.4, all my site is messed up in front end, some pods info arent returned and a lot of php errors are returned
https://quienseasegura.com
I have to roll back to 2.8.3
Version
2.8.4
Testing Instructions
Front end page is messed up https://quienseasegura.com
Screenshots / Screencast
This is what it looks like (pods 2.8.5)
This is how it should look (pods 2.8.3)
Possible Workaround
No response
Site Health Information
Pods Package