Hi there. Sorry you’ve run into an issue here. Thanks for providing the details you have. If you can find a mysql error from when the levels try to save, that would be helpful too.
I trust you that the DB tables are set up, but if you wanted to make sure all of the required tables were there, you could compare them to the queries in the file here: https://github.com/strangerstudios/paid-memberships-pro/blob/dev/includes/setup.sql
In the past, things like this have come up where for some reason the levels table (and maybe the orders table too?) was setup with the autoincrement value set to 0 and for some reason when we run the queries to insert the levels, it would try to insert with ID 0 instead of 1. I think there are some combinations of MySQL version and configuration where this might happen.
Manually setting the autoincrement value to 1 or inserting a level into the table through MySQL or a tool like Adminer (even if you later delete the level) would fix the issue and get the table defaulting new inserts with the appropriate ID.
I’m just throwing that out there as a possibility. It seems like you might have the technical know how to look into that.
To debug further, you could var_dump( $wpdb ) at this part of the code, which should show any MySQL error that occurs on the insert. We can also get the exact DB query tried and see if there is an error in our SQL. https://github.com/strangerstudios/paid-memberships-pro/blob/dev/classes/class-pmpro-levels.php#L172
Let me know if this helps and if you figure anything out. It’s possible we can update our code to keep this issue from happening for others on setups similar to yours.
Thanks.
RE: “To debug further, you could var_dump( $wpdb )”
Not sure how to do this.
Thank you
Update:
I uninstalled PMPRO ( all data ), and re-installed.
In the set-up (installation) screen, I selected create a free level. The free level was created, and shows in the DB table; but when adding a new level from the PMPRO dashboard, the save button does not work (when clicked there is no action/response).
Thank you
Thank you for your feedback.
If you’re comfortable with editing some of the plugin files on your site, please navigate to paid-memberships-pro/classes/class-pmpro-levels.php and scroll down to approximately line 172.
Please add in the following line of code
var_dump( $wpdb );
Once added, try adding a level – some code will show up on the screen – please copy this and paste it into a reply here so that we can take a further look into this with you.
Thank you for the info.
I have not tried the var_dump yet, But I disabled the MasterStudy LMS plugin, and now the save levels button is working, and data is saved to DB.
The MasterStudy LMS plugin is supposed to be compatible with PMP. I will contact the dev.
Thanks again
Thanks for letting us know – I hope they sort this out for you as soon as possible.
Feel free to reach out if there’s anything else we can assist you with by starting a new topic.