BUG in knews_installDB.php
-
Hi all,
i have discovered this bug in my customer’s website. Knews stopped working and in debug.log i saw this error:[05-Apr-2016 14:02:52 UTC] WordPress errore sul database Unknown column ‘id_smtp’ in ‘field list’ per la query INSERT INTO wp_knewsubmits (blog_id, newsletter, finished, paused, start_time, users_total, users_ok, users_error, priority, strict_control, emails_at_once, special, end_time, id_smtp) VALUES (1, 71, 0, 0, ‘2016-04-05 14:02:00’, 3, 0, 0, 5, ”, 50, ”, ‘0000-00-00 00:00:00’, 1) fatta da do_action(‘toplevel_page_knews_news’), call_user_func_array, KnewsPlugin->KnewsAdminNews, require(‘/plugins/knews/admin/knews_admin_news.php’), require(‘/plugins/knews/admin/knews_admin_news_send.php’), require(‘/plugins/knews/includes/submit_batch.php’)
After, i saw that the file knews_installDB.php had dbDelta functions for upgrade but KNEWS_NEWSLETTERS_SUBMITS was yet between IF block.
if (!$this->tableExists(KNEWS_NEWSLETTERS_SUBMITS)) { $sql = "CREATE TABLE " .KNEWS_NEWSLETTERS_SUBMITS . " ( id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, blog_id bigint(20) UNSIGNED NOT NULL DEFAULT " . $this->KNEWS_MAIN_BLOG_ID . ", newsletter int(11) NOT NULL, finished tinyint(1) NOT NULL, paused tinyint(1) NOT NULL, start_time timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', end_time timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', users_total int(11) NOT NULL, users_ok int(11) NOT NULL, users_error int(11) NOT NULL, priority tinyint(4) NOT NULL, strict_control varchar(100) NOT NULL, emails_at_once int(11) NOT NULL, special varchar(32) NOT NULL, id_smtp bigint(20) NOT NULL DEFAULT 1, UNIQUE KEY id (id) )$charset_collate;"; dbDelta($sql); }
I have commented the IF and the id_smtp field was added correctly to the table.
Now all works fine.
I hope it will help you..
- The topic ‘BUG in knews_installDB.php’ is closed to new replies.