Incomplete Form data on Asset Edit causes asset to be unaccessible

This commit is contained in:
JT Smith 2007-05-02 21:18:29 +00:00
parent f754da0db5
commit bca9af757d
3 changed files with 52 additions and 19 deletions

View file

@ -3,6 +3,7 @@
- fix: Email to forum not working from Mac
- fix: Unable to set size in DynamicField (Diona Kidd / Knowmad)
- fix: race condition causes upgrade.pl to fail (Martin Kamerbeek / Oqapi)
- fix: Incomplete Form data on Asset Edit causes asset to be unaccessible
- fix: Calendar Events Disappearing
http://www.plainblack.com/bugs/tracker/calendar-events-disappearing
- fix: Modified SQLForm.pm to handle MySQL null dates. Undefs them. Undef dates default to time(), i.e. today's date

View file

@ -276,6 +276,7 @@ sub definition {
hoverHelp=>$i18n->get('108 description'),
uiLevel=>6,
fieldType=>'user',
filter=>'fixId',
defaultValue=>'3'
},
groupIdView=>{
@ -284,6 +285,7 @@ sub definition {
hoverHelp=>$i18n->get('872 description'),
uiLevel=>6,
fieldType=>'group',
filter=>'fixId',
defaultValue=>'7'
},
groupIdEdit=>{
@ -293,6 +295,7 @@ sub definition {
hoverHelp=>$i18n->get('871 description'),
uiLevel=>6,
fieldType=>'group',
filter=>'fixId',
defaultValue=>'4'
},
synopsis=>{
@ -370,6 +373,51 @@ sub DESTROY {
}
#-------------------------------------------------------------------
=head2 fixId ( id, fieldName )
Returns the default Id for a field if we get an invalid Id, otherwise returns the id passed in. An valid id either looks like a GUID or is an integer.
=head3 id
The id to check.
=head3 fieldName
The name of the property we're checking. This is used to retrieve whatever the default is set to in the definition.
=cut
sub fixId {
my $self = shift;
my $id = shift;
my $field = shift;
if ($id =~ m/\Ad+\Z/xms || $id =~ m/\A[A-Za-z0-9\-\_]{22}\Z/xms) {
return $id;
}
return $self->getValue($field);
}
#-------------------------------------------------------------------
=head2 fixTitle ( string )
Fixes a title by eliminating HTML from it.
=head3 string
Any text string. Most likely will have been the Asset's name or title.
=cut
sub fixTitle {
my $self = shift;
return WebGUI::HTML::filter(shift || $self->getValue("title") || 'Untitled', 'all');
}
#-------------------------------------------------------------------
=head2 fixUrl ( string )
@ -441,24 +489,6 @@ sub fixUrl {
}
#-------------------------------------------------------------------
=head2 fixTitle ( string )
Fixes a title by eliminating HTML from it.
=head3 string
Any text string. Most likely will have been the Asset's name or title.
=cut
sub fixTitle {
my $self = shift;
return WebGUI::HTML::filter(shift || $self->getValue("title") || 'Untitled', 'all');
}
#-------------------------------------------------------------------
=head2 get ( [propertyName] )
@ -1870,7 +1900,7 @@ sub update {
my $value = $properties->{$property};
if (exists $definition->{properties}{$property}{filter}) {
my $filter = $definition->{properties}{$property}{filter};
$value = $self->$filter($value);
$value = $self->$filter($value, $property);
}
$self->{_properties}{$property} = $value;
push(@setPairs, $property."=".$self->session->db->quote($value));

View file

@ -88,6 +88,7 @@ sub definition {
tab=>"display",
label=>$i18n->get(1073),
hoverHelp=>$i18n->get('1073 description'),
filter=>'fixId',
namespace=>'style'
},
printableStyleTemplateId=>{
@ -96,6 +97,7 @@ sub definition {
tab=>"display",
label=>$i18n->get(1079),
hoverHelp=>$i18n->get('1079 description'),
filter=>'fixId',
namespace=>'style'
}
);