• Resolved pavman

    (@pavman)


    After updating recently and having to update a snippet, I noticed despite it saying my changes were saved, the snippet upon reload showed the changes were not saved.

    After reviewing the changes made by the most recent update, I believe it’s because of the following added database fields in the code were not added to the database. Why it’s not erroring on save but rather shows it was updated successfully, I’m not sure as I turned off auto-handling of errors (however, this might be related to the snippet execution itself).

    I’ve highlighted the changes below which were made to the snippet-edit.php file. None of the referenced columns exist in the database table for this plugin (wp_xyz_ips_short_code).

    - $wpdb->update($wpdb->prefix.'xyz_ips_short_code', array('title'=>$xyz_ips_title,'content'=>$xyz_ips_content,'short_code'=>$xyz_shortCode,), array('id'=>$xyz_ips_snippetId));

    + $wpdb->insert($wpdb->prefix.'xyz_ips_short_code', array('title' =>$xyz_ips_title,'insertionMethod' => $xyz_ips_insertionMethod, 'insertionLocation' => $xyz_ips_insertionLocation, 'insertionLocationType' => $xyz_ips_insertionLocationType,'content'=>$xyz_ips_content,'short_code'=>$xyz_shortCode,'status'=>'1'),array('%s','%d','%d','%d','%s','%s','%d'));

    I will attempt to fix this by either adding the columns (if I can figure out what data types they should be) or rolling back the update.

    • This topic was modified 3 weeks, 3 days ago by pavman. Reason: Added previous code indicated by local git repo changes
    • This topic was modified 3 weeks, 3 days ago by pavman.

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

Viewing 1 replies (of 1 total)
  • Plugin Author Atif Riaz

    (@lightbulbman)

    Hello @pavman

    Thanks for sharing these details and really sorry your facing these issues.

    It sounds like the database structure may not have been updated correctly after the recent update, which could be causing the issue where snippet changes appear to save but don’t persist.

    A couple of things you could try:

    1. Manually trigger a database update using debug: Some updates require running a migration script. You can try manually updating the database by going to settings then the debug submenu and clicking on the ‘Upgrade Database Table’ button.
    2. Manually trigger a database update using deactivate/activate: Try deactivating and reactivating the plugin to see if it applies any necessary database changes.

    If either of the above don’t work then if you can enable wordPress debugging (WP_DEBUG in wp-config.php), and check the logs for any database or related errors – wp-content/debug.log. If you can share any errors in the logs directly by contacting our support via email we can investigate further.

      Hope this helps.

    Viewing 1 replies (of 1 total)
    • You must be logged in to reply to this topic.