• Resolved dfad1ripe

    (@dfad1ripe)


    I try to call this plugin from admin page of my plugin.
    I can view and edit the referred table, but saving the changes does not happen. Ajax call passes successfully but DB table is not updated.

    There is saying my-plugin/settings.php page in WP admin interface, where I do:

    $table='wp_my_table';
    if(function_exists('add_db_table_editor')){
      add_db_table_editor(array(
       'title'=>'My title',
       'table'=>$table,
       'sql'=>"SELECT * FROM $table ORDER BY class_id ASC",
       'id_column'=>'class_id',
       'cap'=>'manage_options',
       'columnNameMap'=>Array(................),
       'default_values'=>Array(................)
      ));
      print(dbte_shortcode(Array('id'=>$table)));
    }

    This displays the DBTE interface.

    Then, when I do some changes and hit ‘Save changes’ button, the following ajax call happens:

    "page":"my-plugin/settings.php",
    "action":"dbte_save",
    "data":"{seem to be correct JSON data}",
    "table":"wp_my_table"}

    I am confused by the fact that “page” here is referring back to the page where the editor is displayed. Should it refer to some DBTE component instead?

    Do I miss some step that binds the frontend interface to DBTE backend?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author bobbysmith007

    (@bobbysmith007)

    Hey sorry you are having issues. That looks correct to me. Usually it just posts back to the same page. It was posted on. I will try to check into this soon

    Thread Starter dfad1ripe

    (@dfad1ripe)

    Thank you for the response.

    Meanwhile I have created simple ‘static HTTP’ workaround to edit that table, so I’m not blocked with this issue now, but your plugin is more functional than my solution so it would be great to have it working sooner or later.

    Please let me know if you need some additional diagnostic data.

    Just to add, I’m on WP 5.4.1, your plugin is not marked as tested with this version yet.

    Plugin Author bobbysmith007

    (@bobbysmith007)

    Did you ever look back into this? If its posting the ajax correctly, was there any error in your php log file or javascript console? What was the reply to that ajax request?

    Thread Starter dfad1ripe

    (@dfad1ripe)

    No, sorry. I decided to allow some non-experienced users to edit tables and thus will use my solution instead, where I limit their ability to do something wrong. So I won’t be using your tool in this project anymore.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Saving changes doesn’t work on custom plugin admin page’ is closed to new replies.