We're Moving to a New Support Platform – Starting June 1st!
We’re excited to let you know that starting June 1st, we’ll be transitioning to a new support system that will be available directly on our product websites – Amelia, wpDataTables, and Report Builder. In fact, the new support platform is already live for Amelia and wpDataTables, and we encourage you to reach out to us there.
You'll always be able to reach us through a widget in the bottom right corner of each website, where you can ask questions, report issues, or simply get assistance.
While we still do not offer live support, a new advanced, AI-powered assistant, trained on our documentation, use cases, and real conversations with our team, is there to help with basic to intermediate questions in no time.
We're doing our best to make this transition smooth and hassle-free. After June 1st, this current support website will redirect you to the new "Contact Us" pages on our product sites.
Thanks for your continued support and trust – we’re excited to bring you an even better support experience!
Hi,
I added this action to my function.php:
add_action( 'wpdatatables_after_frontent_edit_row', 'authorizeStakeholder' );
function authorizeStakeholder( $formdata, $row_id_value, $table_id ) {
print_r($formdata, true);
print_r($row_id_value, true);
print_r($table_id);
}
I can see the edited data in $formdata array but the fields $row_id_value, $table_id are empty (or null), although, the row appropriate row on the mySQL table has been updated successfully.Can you help me on how I can find out the row id which was updated?
Some facts:
wpDataTable version: 1.7
database: mySQL (another then WPs database)
Best regards and thank you very much!
Lennart
Hi lennartwittmann,
Thank you for your purchase
You forgot to add priority and accepted_args in add_action.
https://developer.wordpress.org/reference/functions/add_action/
You can try with this:
Thanks Milos!!!
But after I did this, the value row_id_value is always 0, no matter which row gets updated.
Do you have a solution for this one, too?
Hi lennartwittmann,
I have tried your function and I didn't get 0 for row_id and table_id. Are you sure you got 0 always?
Hi Milos,
sadly I am always getting 0. It is exactly like what is described here: http://wpdatatables.com/ticket/wpdatatables_after_frontent_edit_row-is-always-passing-in-0-for-row_id_value/
But this bug should have been fixed already as it concerned version 1.6
The table update was successful so the software know the appropriate row id when updating but it doesn't deliver it to the action.
add_action( 'wpdatatables_after_frontent_edit_row', 'authorizeStakeholder', 10, 3 );
function authorizeStakeholder( $formdata, $row_id_value, $table_id ) {
print_r($table_id, true)); // returns 1, I don't know what 1 means in this case? The mySQL table number ...?
print_r($row_id_value, true)); // always returns 0 no matter which row gets updated
}
I attached the version of wdt_ajax_actions.php which I am using (nothing altered, it is the original version). Maybe this isn't the most recent version or it differs from the version you are testing with?!Hi lennartwittmann,
What version of the plugin are you using?
Please provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party. You can write credentials just check PRIVATE so nobody can see it except us.
Hi lennartwittmann,
Did you change any plugin core files or added any function to functions.php because adding new row is not working for me?
No, didn't change anything. It is a fresh installation. Maybe I am not querying all fields in the select statement so inserting won't work? You can change anything you like, it is not productive yet and I can build a new table if necessary.
Hi Milos,
I just reinstalled the plugin completely from a fresh download from Envato. Thats why your test table is gone. Nothing changed for the value of row_id_value, though, it is still always 0 ;(
Have you looked at the code piece of wdt_ajax_actions.php I have sent you? Where the id_val variable should get filled with the right value in line 262?
Thanks for helping me again!
Hi lennartwittmann,
Thank you for reporting this issue. I have fixed it on your website and it will be fixed in next version of the plugin.
$id_val will be 0 when you are adding new row, and when you editing existing row it will be ID of edited row.
Thank you very much Milos for investing that much time into my problem!
Its working now!
Thanks again very much!
Hi Lennart,
You are welcome. We'd greatly appreciate it if you could take a minute and leave a review on CodeCanyon on this link. Thanks!