From 179e75ef8f3feedb513a2dc752ba89339338928c Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 20 Feb 2009 17:28:23 +0000 Subject: [PATCH] Fixes of defaultValue from undef to '', 0 for mysql 5.1 --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Event.pm | 2 +- lib/WebGUI/Asset/File.pm | 4 ++-- lib/WebGUI/Asset/Post.pm | 4 ++-- lib/WebGUI/Asset/Post/Thread.pm | 8 ++++---- lib/WebGUI/Asset/WikiPage.pm | 8 ++++---- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index f1f71bfa6..4ac226368 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -2,6 +2,7 @@ - fixed #9760: DataForm not working in demo.plainblack.com - fixed #9759: Delete Entry Button missing in Data Form - fixed #9767: FileAsset breaks 'null' rule for FileAsset table + - fixed defaultValues of undef cause mysql5.1 to complain about columns that are set to be NOT NULL. 5.0 doesn't care. 7.6.12 - fixed: During postback on a recurring transaction, the routine could error out instead of catching an error. diff --git a/lib/WebGUI/Asset/Event.pm b/lib/WebGUI/Asset/Event.pm index f183c1bc8..098d562c4 100644 --- a/lib/WebGUI/Asset/Event.pm +++ b/lib/WebGUI/Asset/Event.pm @@ -116,7 +116,7 @@ sub definition { }, 'storageId' => { fieldType => "Image", - defaultValue => undef, + defaultValue => '', maxAttachments => 1, }, 'feedUid' => { diff --git a/lib/WebGUI/Asset/File.pm b/lib/WebGUI/Asset/File.pm index 1683a6df6..ee0908c24 100644 --- a/lib/WebGUI/Asset/File.pm +++ b/lib/WebGUI/Asset/File.pm @@ -116,12 +116,12 @@ sub definition { filename=>{ noFormPost=>1, fieldType=>'hidden', - defaultValue=>undef + defaultValue=>'', }, storageId=>{ noFormPost=>1, fieldType=>'hidden', - defaultValue=>undef + defaultValue=>'', }, templateId=>{ fieldType=>'template', diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm index 9715706ec..ad0bd97cf 100644 --- a/lib/WebGUI/Asset/Post.pm +++ b/lib/WebGUI/Asset/Post.pm @@ -243,13 +243,13 @@ sub definition { my $properties = { storageId => { fieldType=>"image", - defaultValue=>undef, + defaultValue=>'', enforceSizeLimits => 0, }, threadId => { noFormPost=>1, fieldType=>"hidden", - defaultValue=>undef + defaultValue=>'', }, originalEmail => { noFormPost=>1, diff --git a/lib/WebGUI/Asset/Post/Thread.pm b/lib/WebGUI/Asset/Post/Thread.pm index ff6dc6110..241e24fe5 100644 --- a/lib/WebGUI/Asset/Post/Thread.pm +++ b/lib/WebGUI/Asset/Post/Thread.pm @@ -118,12 +118,12 @@ sub definition { subscriptionGroupId => { noFormPost=>1, fieldType=>"hidden", - defaultValue=>undef + defaultValue=>'', }, replies => { noFormPost=>1, fieldType=>"hidden", - defaultValue=>undef + defaultValue=>0, }, isSticky => { fieldType=>"yesNo", @@ -131,12 +131,12 @@ sub definition { }, isLocked => { fieldType=>"yesNo", - defaultValue=>0 + defaultValue=>0, }, lastPostId => { noFormPost=>1, fieldType=>"hidden", - defaultValue=>undef + defaultValue=>'', }, lastPostDate => { noFormPost=>1, diff --git a/lib/WebGUI/Asset/WikiPage.pm b/lib/WebGUI/Asset/WikiPage.pm index 6f3e5f4f1..67bcd02ed 100644 --- a/lib/WebGUI/Asset/WikiPage.pm +++ b/lib/WebGUI/Asset/WikiPage.pm @@ -96,13 +96,13 @@ sub definition { }, actionTaken => { fieldType => "text", - defaultValue => undef, - noFormPost => 1 + defaultValue => '', + noFormPost => 1, }, actionTakenBy => { fieldType => "user", - defaultValue => undef, - noFormPost => 1 + defaultValue => '', + noFormPost => 1, }, );