Critical Bug: XStore update generates invalid SQL (posts.ID instead of 59_posts.ID)

This topic has 5 replies, 3 voices, and was last updated 2 days, 5 hours ago ago by Samir Malik

  • Avatar: Niddy
    Niddy
    Participant
    December 1, 2025 at 11:44

    Hi,
    After updating XStore/XStore Core today, my site started throwing fatal SQL errors. The issue is caused by XStore generating invalid WP_Query SQL.

    I am receiving repeated errors like:

    WordPress database error Unknown column 'posts.ID' in 'IN/ALL/ANY'
    

    Example query generated by the theme:

    AND posts.ID IN (
        SELECT tr.object_id
        FROM 59_term_relationships AS tr
        WHERE tr.term_taxonomy_id IN (204,289,207,203,217)
    )
    

    The problem is that posts is not a valid table alias, and the correct table is: 59_posts

    WordPress never uses posts without $wpdb->posts or an alias, so this SQL breaks the entire site.

    This only started happening after today’s XStore update, so the issue is coming from the theme or XStore Core plugin adding broken taxonomy filters (brands/categories filtering or custom queries).

    Its as though the incorrect posts.ID references needs replacing with the correct value ie: {$wpdb->posts}.ID

    or use the alias already defined in your query builder.

    This bug affects any WP_Query inside XStore (product archives, Elementor templates, popups, fonts, etc.) and makes the site unusable.

    Please confirm and issue a patch as this is not caused by plugins or my database prefix. Other themes do not generate this SQL. Only XStore’s update injected the incorrect posts.ID condition.

    Thank you kindly.

    Content is visible for topic creator and
    support staff only.
    4 Answers
    Avatar: Samir Malik
    Samir Malik
    Support staff
    December 1, 2025 at 12:02

    Dear @Niddy,

    Could you please provide temporary wp-admin and FTP access? We will check what can be done to help you.
    To grant WP-Admin access, please proceed to create a new user account with an administrator role through your WordPress Dashboard. Once the account is established, you may securely transmit the username and password to us via the Private Content section designated for this purpose.

    For FTP access, we require the following details: FTP host, FTP username, FTP password, FTP port, and FTP encryption type. If you need assistance in creating these credentials, please reach out to your hosting provider who will guide you through the process.

    Best Regards,
    8Theme’s Team

    Avatar: Niddy
    Niddy
    Participant
    December 1, 2025 at 12:09

    Hi

    I have reversed it all – as it was clearly the issue as I posted above so do not have it – I could create a staging demo but what I posted above is factual as it occurs across 3 sites that use Xstore and since the update this error occurs which we captured in the debug log – see private for the debug log to help.

    Thanks

    Content is visible for topic creator and
    support staff only.
    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    December 1, 2025 at 12:18

    Hello, Niddy,

    We have already developed a fix for this issue. Please install patch #9625175. You can find more details in the attached screenshot.

    Best regards,
    The 8Theme Team

    Files is visible for topic creator and
    support staff only.
    Avatar: Samir Malik
    Samir Malik
    Support staff
    December 1, 2025 at 12:18

    Hello Niddy,

    Could you please create a staging site for us and provide the Admin and FTP account details, so we can review it in more detail?

    Thank you.

    Best regards,
    The 8Theme Team

  • Viewing 5 results - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.