Support ⇒ Troubleshootings ⇒ Problem posting a wiki article ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexTroubleshootings

Problem posting a wiki article Reply to topic


Hey folks,

I am setting up Dragon fly for my work as an internal resource, and I have added the wiki module provided in the downloads section here. Everything seemed to install ok, and the wiki seems to function fine until I get to the point of actually posting an article. After the preview, I hit submit and get this:

includes\db\db.php CMS Warning line 70: On /index.php?name=Wiki&file=manage While executing query "INSERT INTO cms_wiki_pages (parent_id, active, pos, title, time, user_id, author, comment, body) VALUES ('0', 1, '1', 'Test post', '1437578055', '2', 'Jeff', '', 'Test stuff goes here...')" the following error occured: Field 'upd_user_id' doesn't have a default value In: C:\Abyss Web Server\htdocs\modules\Wiki\manage.php on line: 70

Any help would be greatly appreciated...

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
9.1.1


Try with the following DB modification
ALTER TABLE cms_wiki_pages MODIFY COLUMN upd_user_id INT NOT NULL DEFAULT 0

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


Ok, so that worked to create a new post, but if I go in to modify the post, I now get this:

includes\db\db.php CMS Warning line 70: On /index.php?name=Wiki&file=manage While executing query "INSERT INTO cms_wiki_pages_archive (id, parent_id, active, pos, title, version, time, supercede, user_id, author, upd_user_id, upd_author, comment, body, type) VALUES ('1', '0', '1', '1', 'test post', '1', '1437750103', '', '2', 'Jeff', '0', '', '', 'nothing yet', 3)" the following error occured: Incorrect integer value: '' for column 'supercede' at row 1 In: C:\Abyss Web Server\htdocs\modules\Wiki\manage.php on line: 48

Was there something I missed on the install that caused some of the DB values to be incorrect? Or am I missing something else? Thanks for the help so far btw...

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
9.1.1


That's strange as the code should work.
Is it like this in manage.php line 40?
$page = $db->sql_ufetchrow("SELECT * FROM {$module_prefix}_pages WHERE id=$id", SQL_ASSOC); $db->sql_query("INSERT INTO {$module_prefix}_pages_archive (id, parent_id, active, pos, title, version, time, supercede, user_id, author, upd_user_id, upd_author, comment, body, type) VALUES ('$page[id]', '$page[parent_id]', '$page[active]', '$page[pos]', '".Fix_Quotes($page['title'])."', '".$page['version']."', '$page[time]', '$page[supercede]', '$page[user_id]', '".Fix_Quotes($page['author'])."', '$page[upd_user_id]', '".Fix_Quotes($page['upd_author'])."', '".Fix_Quotes($page['comment'])."', '".Fix_Quotes($page['body'])."', 3)");

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


Here's mine...

$page = $db->sql_ufetchrow("SELECT * FROM {$module_prefix}_pages WHERE id=$id", SQL_ASSOC); $db->sql_query("INSERT INTO {$module_prefix}_pages_archive (id, parent_id, active, pos, title, version, time, supercede, user_id, author, upd_user_id, upd_author, comment, body, type) VALUES ('$page[id]', '$page[parent_id]', '$page[active]', '$page[pos]', '".Fix_Quotes($page['title'])."', '".$page['version']."', '$page[time]', '$page[supercede]', '$page[user_id]', '".Fix_Quotes($page['author'])."', '$page[upd_user_id]', '".Fix_Quotes($page['upd_author'])."', '".Fix_Quotes($page['comment'])."', '".Fix_Quotes($page['body'])."', 3)");

At first glance everything looks ok to me. What should the interger be in the DB?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
9.1.1

Last edited by grimm340 on Fri Jul 24, 2015 8:50 pm; edited 1 time in total


Ok, then try:
UPDATE cms_wiki_pages SET supercede = 0 WHERE supercede IS NULL; ALTER TABLE cms_wiki_pages MODIFY COLUMN supercede INT NOT NULL DEFAULT 0;

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial

Last edited by DJ Maze on Fri Jul 24, 2015 8:59 pm; edited 1 time in total


Just to verify - this is cms_wiki_pages, and not cms_wiki_pages_archive that you want me to change?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
9.1.1


correct

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


When I try to change the values for supercede I get "Data truncated for column 'supercede' at row 1

I'm using a web interface for MySQL as well, not sure if that makes a big difference or not...

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
9.1.1


Bump?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
9.1.1


Can you execute in your mysql interface:
show create table cms_wiki_pages
And post the output here?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


cms_wiki_pages CREATE TABLE `cms_wiki_pages` ( `id` int(11) NOT NULL AUTO_INCREMENT, `parent_id` int(11) NOT NULL DEFAULT '0', `active` tinyint(4) NOT NULL DEFAULT '1', `pos` int(11) NOT NULL DEFAULT '1', `title` varchar(80) NOT NULL DEFAULT '', `version` int(11) NOT NULL DEFAULT '1', `time` int(11) DEFAULT NULL, `supercede` int(11) DEFAULT NULL, `user_id` int(11) NOT NULL, `author` varchar(80) NOT NULL DEFAULT '', `upd_user_id` int(11) NOT NULL DEFAULT '0', `upd_author` varchar(80) NOT NULL DEFAULT '', `comment` varchar(255) NOT NULL DEFAULT '', `body` text, PRIMARY KEY (`id`), KEY `p_order` (`parent_id`,`pos`), KEY `title` (`title`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8

that's what I get back. Thanks again for all the help.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
9.1.1


Thanks for the info
What happens if you only run:
UPDATE cms_wiki_pages SET supercede = 0 WHERE supercede IS NULL;

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


Success! Except... now the wysiwyg editor is not interpreting line breaks correctly - well, at all really. No matter how many lines I enter between text, it seems to ignore them.

And thank you so much for all the help - this has been a pretty stressful time!

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
9.1.1

Last edited by grimm340 on Thu Jul 30, 2015 3:06 pm; edited 1 time in total

All times are UTC


Jump to: