Duplicating Templates

Under Review Bug Released
16 January, 2020 19:27:30
joel04
Topics: 5
Messages: 16
Hi there Im having the same problem as this person:

"I am trying to duplicate one of my current templates, and when I click the Duplicate button it says "Template copy created", but it doesn't display on the list and doesn't appear to have duplicated it from what I can tell. I have tried in Firefox, Edge, Edge (dev), and Chrome browsers with the same result in all of them. I believe I have the latest version of the plugin, 1.09.05. Can you see if this is maybe a bug on the current version? Thanks!"


This was your response:


"It looks like last update failed to update tables.

If you have access to phpMyAdmin, please complete this queries on your wordpress table to fix issue:

ALTER TABLE `wp_e2pdf_templates` ADD COLUMN `actions` longtext NOT NULL AFTER author;
ALTER TABLE `wp_e2pdf_revisions` ADD COLUMN `actions` longtext NOT NULL AFTER author;

If you are using different wordpress prefix, please fix `wp_e2pdf_templates` and `wp_e2pdf_revisions` to correct table names.

After queries complete, recheck E2Pdf->Debug->DB, "actions" must become green.

P.S. In future update it will be added "auto" fix if any tables missing after update. Sorry for inconvenience.

P.P.S. Do you have "auto" updates on plugins, or it was updated manually?

We remain at your service."


I have updated to the newest version but the problem remains. (actions is red) phpmyadmin is giving me problems, is there another way to fix this?

Thanks
17 January, 2020 09:26:03
E2Pdf
Support
Topics: 7
Messages: 3345
Hi,

Unfortunately current bug-fix was not yet released, we expect to add this bug-fix on next update. Sorry for inconvenience.

Meanwhile you can try to add code below to your functions.php to fix database issues:


global $wpdb;
if (!$wpdb->get_var("SHOW COLUMNS FROM `" . $wpdb->prefix . "e2pdf_templates` LIKE 'actions'")) {
$wpdb->query("ALTER TABLE `" . $wpdb->prefix . "e2pdf_templates` ADD COLUMN `actions` longtext NOT NULL AFTER author");
}
if (!$wpdb->get_var("SHOW COLUMNS FROM `" . $wpdb->prefix . "e2pdf_revisions` LIKE 'actions'")) {
$wpdb->query("ALTER TABLE `" . $wpdb->prefix . "e2pdf_revisions` ADD COLUMN `actions` longtext NOT NULL AFTER author");
}


If after adding code, it will still show errors on "DB" tab, attach please screenshot of it, to see if only this columns missed. Thank you.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
17 January, 2020 14:02:34
E2Pdf
Support
Topics: 7
Messages: 3345
We just released an update (1.10.00) which must solve issues with database on update. Please update it and let us know if issue will be solved. Thank you.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
17 January, 2020 18:57:17
joel04
Topics: 5
Messages: 16
Hey there thanks for the update but unfortunately it did not work. I then added the code you gave me to functions.php and now it all works and all debug checks are green. Just wanted to let you know that the update didnt fix it.
Cheers!
17 January, 2020 19:18:28
E2Pdf
Support
Topics: 7
Messages: 3345
Thank you for letting us know. It looks like not common issue.

If you will have time:

1) Does your site multisite installation?

2) Did you update plugin from "Plugins" tab?

3) Can you please check on "E2Pdf" -> "Debug" which DB Version and Plugin Version showing on screen. Is it 1.10.00?

Thank you.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
17 January, 2020 19:52:45
joel04
Topics: 5
Messages: 16
Here is the "common" section of the debug:

Plugin Version: 1.10.00
DB Version: 1.10.00
PHP Version: 7.3.9
WP Version: 5.3.2
Multisite: No
Is Main Site: Yes

I updated by going to "dashboard updates"