Posts: 16
Threads: 0
Joined: May 2010
05-21-2010, 04:26 AM
(This post was last modified: 05-21-2010, 05:53 PM by caravan_saray.)
BTW I experience the same problem when trying to add Static Pages, symptoms are exactly the same. Also, after inserting sample article directly into database through phpMyAdmin that article is listed in Articles tab and I can update its content using Kwikcontent Admin, but it still does not let me add new articles.
Posts: 24
Threads: 11
Joined: Dec 2008
hmm Is this a primary domain or a multidomain added though a single installation.
Those pages all extend the DbTable classes in includes/_classes.php which does that data saving part.
It should be getting to the createNew function in that class and if the query errors it should die off with an error message.
Posts: 16
Threads: 0
Joined: May 2010
05-21-2010, 11:25 PM
(This post was last modified: 05-21-2010, 11:27 PM by caravan_saray.)
It does not insert data on both primary and secondary domains. I understand about DBTable class and already tried to read through source codes, looks lik the issue is in the database file format or article_edit.php codes discrepancy. Could you post here a list of Article table fields that you currently have in your working version, and also please email me you version of article_edit.php and includes/_classes.php so I could compare with mine.
Posts: 24
Threads: 11
Joined: Dec 2008
Here is the sample SQL of an article along with the table
Code:
CREATE TABLE `testcom_article` (
`article_id` int(10) unsigned NOT NULL auto_increment,
`key_id` int(10) unsigned NOT NULL default '0',
`author_id` int(10) unsigned NOT NULL default '0',
`article_rank` mediumint(8) unsigned NOT NULL default '0',
`article_title` varchar(255) NOT NULL default '',
`article_teaser` text NOT NULL,
`article_body` text NOT NULL,
`article_biblio` text NOT NULL,
`article_meta_desc` text NOT NULL,
`article_meta_keys` text NOT NULL,
PRIMARY KEY (`article_id`),
KEY `author_id` (`author_id`),
KEY `key_id` (`key_id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `testcom_article`
--
INSERT INTO `testcom_article` (`article_id`,`key_id`,`author_id`,`article_rank`,`article_title`,`article_teaser`,`article_body`,`article_biblio`,`article_meta_desc`,`article_meta_keys`) VALUES
(3,1,0,1,'Test Title','Test Teaser','<p>Test Body</p>','<p>Test Acknowledgets</p>','Test Meta Description','Test Meta Keywords');
The files should be the same I am using the same ones that your site has on
http://kwikcontentdemo.com and my other sites.
Posts: 16
Threads: 0
Joined: May 2010
05-22-2010, 06:41 PM
(This post was last modified: 05-23-2010, 05:28 AM by caravan_saray.)
Modified createNew method so that it prints out SQL command before execution. Here is the SQL it is trying to execute in createNew after article_edit.php submit:
INSERT INTO article (key_id) VALUES ('1')
Tried to execute this command in MyPHPAdmin and got this error:
#1364 - Field 'article_teaser' doesn't have a default value
No wonder it does not insert new article. Would you update your installation SQL script to straight this out or at least provide notice in installation instruction, it turned out that in newer MySQL versions you have to tweak sql-mode in my.ini for MySQL server to treat message #1364 as a warning not error. My suggestion is to make installation SQL compliant with strict MySQL requirements. Also I remember I had same problem with 'domain' table when I was trying to run you installation SQL, some default values were missing in INSERT statement and MySQL gave me the same error, I had to rewrite that statement to make it compliant.
Another thought, lack of SQL error handling code in DbTable methods creates a lot of confusion with SQL errors debug.
Posts: 24
Threads: 11
Joined: Dec 2008
Resent the KwikContent script with all the updates to your email.
Basically for the sql issue took out the NOT NULL statement for all the fields in the .sql files
Posts: 16
Threads: 0
Joined: May 2010
Thanks for the update. I already fixed the issue by modifying table properties in MyPHPAdmin.