From 5ece4a1d8cdc14dd86aaf93a42c620994e6dcffa Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Fri, 20 Jun 2008 21:51:50 +0000 Subject: [PATCH] fixed: thingy now has appropriate values for all field types --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/Thingy.pm | 6 ++++-- lib/WebGUI/Form/Checkbox.pm | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 801640768..be3d06f5a 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -5,6 +5,7 @@ - fixed: Rich Editor no longer makes other form controls show up as code in Safari 3 - fixed: allowMedia addition to Rich Editor no longer causes upgrade problems - fixed: Shop->hasShippingAddress help grammatical error + - fixed: Thingy now shows appropriate display values for all field types - fixed: can now turn off inheritUrlFromParent and the code is now more robust, moved from Asset->update to Asset->fixUrl. - fixed: Time tracker can't post time once it's been posted. diff --git a/lib/WebGUI/Asset/Wobject/Thingy.pm b/lib/WebGUI/Asset/Wobject/Thingy.pm index c3c6523f5..26177539d 100644 --- a/lib/WebGUI/Asset/Wobject/Thingy.pm +++ b/lib/WebGUI/Asset/Wobject/Thingy.pm @@ -641,8 +641,10 @@ sub getFieldValue { .' where thingDataId = ?',[$value]); } } - elsif ($field->{fieldType} eq "file") { - $processedValue = WebGUI::Form::File->new($self->session,{value=>$value})->getValueAsHtml(); + else { + $processedValue + = WebGUI::Form::DynamicField->new( $self->session, %$field, defaultValue => $value ) + ->getValueAsHtml; } return $processedValue; diff --git a/lib/WebGUI/Form/Checkbox.pm b/lib/WebGUI/Form/Checkbox.pm index 28896e3fe..f5966f337 100644 --- a/lib/WebGUI/Form/Checkbox.pm +++ b/lib/WebGUI/Form/Checkbox.pm @@ -64,7 +64,7 @@ sub definition { defaultValue=> 0 }, defaultValue=>{ - defaultValue=>undef + defaultValue=> 1 }, }); return $class->SUPER::definition($session, $definition);