PostgreSQL-For-Wordpress / postgresql-for-wordpress

A maintained fork of https://wordpress.org/plugins/postgresql-for-wordpress/
GNU General Public License v2.0
227 stars 71 forks source link

Error pg_query() after install elementor pro plugin #21

Open mrzdtydlntm opened 2 years ago

mrzdtydlntm commented 2 years ago

Hello. I'm Mirza and i want to ask about pg4wp issue after install elementor pro. I can't access wp-admin and all the main window fill with error like this:

WordPress database error: [ERROR: operator does not exist: text + integer LINE 7: ..._status = 'publish')) ORDER BY wp_postmeta.meta_value+0 ASC ^ HINT: No operator matches the given name and argument types. You might need to add explicit type casts.]
SELECT wp_posts.* FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) INNER JOIN wp_postmeta AS mt1 ON ( wp_posts.ID = mt1.post_id ) WHERE 1=1 AND ( wp_postmeta.meta_key = '_elementor_priority' AND ( ( mt1.meta_key = '_elementor_location' AND mt1.meta_value = 'elementor_head' ) ) ) AND wp_posts.post_type = 'elementor_snippet' AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value+0 ASC

I'm using php7.4 and psql 14.0. I hope you can help me for this issue. Thanks in advance

Best Regards,

Mirza Aditya Deliantama

mattbucci commented 7 months ago

I will be unable to test if this plugin works as it's a paid plugin, but many changes have been merged since the creation of this issue.

SELECT wp_posts.* FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) INNER JOIN wp_postmeta AS mt1 ON ( wp_posts.ID = mt1.post_id ) WHERE 1=1 AND ( wp_postmeta.meta_key = '_elementor_priority' AND ( ( mt1.meta_key = '_elementor_location' AND mt1.meta_value = 'elementor_head' ) ) ) AND wp_posts.post_type = 'elementor_snippet' AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value+0 ASC

Probably requires wp_postmeta.meta_value to be cast to an integer. but we would need to see if this operation is even done in the current version of elementor pro.

Probably we would need to look for numeric operations and cast as appropriate