• Resolved Imagedavidsjptimoney

    (@davidsjptimoney)


    On upgrade from 1.3.8 to 1.4 we get the following error on a page executing a snippet:

    WordPress database error: [Unknown column ‘insertionMethod’ in ‘where clause’]
    SELECT * FROM wp_xyz_ips_short_code WHERE insertionMethod = 1 AND status = 1

    The underlying DB table has not been altered by the upgrade – i.e. a 6th column named insertionMethod has not been added to the structure.

    Environment:

    Wampserver 3.3.7
    WordPress 6.7.2
    MySQL 9.1.0

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Same problem.

    Looks like a bug – the table schema for the previous version (1.3.8) had three extra columns (insertionMethod, insertionLocation and insertionLocationType), all of which have been removed in 1.4, but the PHP code (or at least some of it) doesn’t seem to have been updated accordingly.

    Hi @nexbridge @cipielle @davidsjptimoney

    In version 1.4, we introduced three new columns, including insertionMethod. The error occurs because the database structure did not update automatically during the upgrade.

    To fix this, please:

    1. Deactivate the Insert PHP Code Snippet plugin.
    2. Reactivate the plugin (this will trigger the DB structure update).
    3. Clear the plugin cache, if applicable.

    This should resolve the issue. Let us know if you need any further assistance!

    Yes that seems to work now, thanks

    Thread Starter Imagedavidsjptimoney

    (@davidsjptimoney)

    The recommended fix works in two sequences: 1) update, deactivate and activate, and 2) deactivate, update and activate.

    Most users won’t deactivate first because plugins do not typically require this, so it would make sense to fix the 1.4 update package so that it alters the table without this extra step.

    NB: the 1.4 version introduces another issue. It adds a “Click to copy” image to the snippets admin list page (I don’t know whether this is for all placements types as we only use Short Codes). Unfortunately, this is 512px square, which makes a mess of the layout. I have changed the referenced .png file to 16px square as a temporary fix.

    I’ll mark this ticket as resolved as the image issue is aesthetic rather than functional.

    Hello @davidsjptimoney

    Thank you for your feedback and for confirming the fix worked.

    1. Update Process & Database Changes
    The plugin is designed to trigger database updates through an associated hook during the update process. However, in some cases, this may not execute as expected, leading to the issues reported. We will report this to our development team for further investigation and improvements.

    2. “Click to Copy” Image Issue
    This is a CSS-related issue—a class is already in the CSS file to limit the image size, but it may not be rendering correctly. We’ll review and ensure the fix is properly applied in an upcoming update.
    Also the click to copy os only for the manual shortcodes.

    We appreciate your input and will work on refining the update experience.
    Thanks

    Thread Starter Imagedavidsjptimoney

    (@davidsjptimoney)

    Thanks for the prompt reply, Anjali.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Error on upgrade from 1.3.8 to 1.4’ is closed to new replies.