Advanced-Post-List / advanced-post-list

A WordPress plugin to create custom post lists
15 stars 7 forks source link

List amount: -1 not working, MySQL error #118

Closed frzsombor closed 6 years ago

frzsombor commented 6 years ago

When I tried using -1 in "list amount" to display all the posts, I got a MySQL error, because the plugin generated an invalid query:

SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.ID IN (53,69) AND wp_posts.post_type IN ('post', 'page', 'attachment', 'myposttype', 'w4pl', 'avada_portfolio', 'avada_faq') AND (wp_posts.post_status = 'publish' OR wp_posts.post_author = 1 AND wp_posts.post_status = 'private') LIMIT 0, -1

The -1 at the end causes an error, what I solved temporarily by changing -1 to a very large number.

EkoJR commented 6 years ago

That is a known error with WP, and WP strongly suggests not using it. However, the option is still available for APL for others to use. Even so, it is strongly recommended you avoid using it, and use a large number instead (like you have already done).