[SOLVED] Beta 9.9.5 Bug- Cannot create new categories

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 08-09-2008, 09:09 PM
New Pligger
Pligg Version: 9.8
Pligg Template: unknown
 
Join Date: Dec 2007
Posts: 10
Hi,

I ran across the following issue while working with the 9.9.5 release-

When trying to create a new category (by clicking 'Add A New Category' in admin_categories.php), the page simply refreshes without any new category being added.

I found that the query issued
"insert into `pligg_categories` (`category_name`) VALUES ('new category');"
throws the error
"no default value set for field category_desc".

After setting a default value manually, the error came up as
"no default value set for field category_keywords"

Setting a default value for this field rectified the problem and a new category finally appeared.

A look at the installtables.php used to create the tables at installation reveals that the sql used to create the categories table is
`category_desc` varchar(255) NOT NULL,
`category_keywords` varchar(255) NOT NULL,

It should have been
`category_desc` varchar(255) NOT NULL default '',
`category_keywords` varchar(255) NOT NULL default '',

Not sure if this bug has been reported before.
Anyways, hope it helps someone.

Regards
Reply With Quote
  #2 (permalink)  
Old 08-09-2008, 09:35 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 4,934
Send a message via AIM to Yankidank
I haven't experienced any problems with this due to the current version of installtables.php. I've been able to generate new categories without a problem on two servers, not sure if your code is necessary or if this is just a fluke.

The Twitter Module for Pligg CMS!
Register, Login, and Submit Stories with Twitter. An absolute MUST HAVE for all Pligg sites!
Reply With Quote
  #3 (permalink)  
Old 08-09-2008, 10:53 PM
chuckroast's Avatar
Pligg Developer/Coder/Designer
Pligg Version: SVN
Pligg Template: Social Pro Kit
 
Join Date: Jun 2006
Posts: 5,448
Hi Kallu

I can't reproduce his either, We will need a proper big report before this can be considered an issue and escalated.

When submitting a bug report please provide the server environment, OS, php version, sql version, Pligg Version, Template name. Etc...

Thanks
Reply With Quote
  #4 (permalink)  
Old 08-10-2008, 04:21 PM
New Pligger
Pligg Version: 9.8
Pligg Template: unknown
 
Join Date: Dec 2007
Posts: 10
Hi chuckroast and Yankidank,

I am not surprised you could not reproduce the error I reported.
It would have been hard for me to believe that this version of pligg could have shipped with such a blatant bug.

Nevertheless, I did experience it. So I can assume that it appeared due to a specific combination of OS/ Web Server/ MySQL version, the stars etc.

I am on a WAMP setup. My server's configuration is-
WindowsXP running Apache/2.2.8 (Win32) with PHP/5.2.5 and MySQL 5.0.51a.
Pligg version is Beta 9.9.5 and the error was template agnostic (occurred in all templates I tried).

I suspect that "W" in the WAMP has got something to do with this bug
Anyways, if I encountered it, somebody else might very well encounter it too.

Taking a look at the installtables.php, I can see that most of the varchar fields defined as NOT NULL also have the clause that the default value is ''.
IMHO, and you guys know better of course, it would be better if we follow this practice and explicitly define a default value for every NOT NULL field, instead of banking on the sql installation to be smart enough and provide one by itself, where one is not provided.

Keep up the good work. Pligg rocks!

Regards
KK
Reply With Quote
  #5 (permalink)  
Old 08-10-2008, 06:17 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 4,934
Send a message via AIM to Yankidank
I'm testing with WAMP on a Win XP computer right now. It worked fine for me. Were you working from an upgrade, or new install?

PHP:
5.2.6
MySQL: 5.0.51b
Apache: 2.2.8

The Twitter Module for Pligg CMS!
Register, Login, and Submit Stories with Twitter. An absolute MUST HAVE for all Pligg sites!
Reply With Quote
  #6 (permalink)  
Old 08-10-2008, 08:48 PM
New Pligger
Pligg Version: 9.8
Pligg Template: unknown
 
Join Date: Dec 2007
Posts: 10
Hi Yankidank,

I am working with a fresh install using the zip file downloaded from
Pligg Beta 9.9.5
Reply With Quote
  #7 (permalink)  
Old 08-10-2008, 08:56 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 4,934
Send a message via AIM to Yankidank
I think I will still add it to the Pligg source, but its odd that this has only happened to you.

The Twitter Module for Pligg CMS!
Register, Login, and Submit Stories with Twitter. An absolute MUST HAVE for all Pligg sites!
Reply With Quote
  #8 (permalink)  
Old 08-10-2008, 09:21 PM
New Pligger
Pligg Version: 9.8
Pligg Template: unknown
 
Join Date: Dec 2007
Posts: 10
Hi Yankidank,

I think I found the answer to the problem.

MySQL in my setup is configured to run under "Strict Mode".
In this mode, MySQL 5.0.2 onwards will throw an error on INSERT/UPDATE if the column definition includes no explicit DEFAULT value and we do not provide one in the sql statement.
Please see
MySQL :: MySQL 5.0 Reference Manual :: 10.1.4 Data Type Default Values

Strict mode happens to be the default mode, I think, for default installations of MySQL on Windows.
I am sure a lot of Windows users are bound to run across this problem.

I am happy you have taken note of this problem.

Regards
Reply With Quote
  #9 (permalink)  
Old 08-10-2008, 10:51 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 4,934
Send a message via AIM to Yankidank
Thanks for looking into what was causing your error, it's good to have some clarification. We've added the changes to SVN revision, you can see the update on the Twitter feed.

The Twitter Module for Pligg CMS!
Register, Login, and Submit Stories with Twitter. An absolute MUST HAVE for all Pligg sites!
Reply With Quote
  #10 (permalink)  
Old 08-30-2008, 05:22 PM
New Pligger
 
Join Date: Jul 2008
Posts: 10
hi , I also have this problem , and I downloaded the latest svn ( the one titled "svn alpha release") and nothing has changed the problem still exist , but when I disabled mysql Strict Mode the problem was solved , but when Yankidank said that he has solved the problem what did you mean , and if you did please provide us with the files changes so that we can update >>> thanks

environment : win xp , mysql 5 , apache
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] All RSS Feeds Are Blank ver Pligg Beta 9.9.5 GSecur Questions and Comments 1 12-18-2008 03:31 PM
Beta 9.9.5- Bug in Categories & Latest comments sidebar modules kallu Questions and Comments 3 08-07-2008 08:28 AM
Pligg Beta 9.9.5 chuckroast Current Version 0 07-31-2008 08:26 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development