Skip to content

Commit

Permalink
Perform the check BEFORE saving the Thing properties. Fixes bug #12157.
Browse files Browse the repository at this point in the history
  • Loading branch information
perlDreamer committed Jun 28, 2011
1 parent ac8d95e commit 4027b5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/changelog/7.x.x.txt
Expand Up @@ -5,6 +5,7 @@
- fixed #12164: Calendar feeds with tons of ;adminId=XXXXXX added
- fixed #12167: Calendar Next/Prev Month/Year confusion
- fixed #12172: Underground User Style template shows up in Style wizard during site creation
- fixed #12157: www_editThingSave

7.10.18
- fixed #12138: Version tag gets create by entering and direct leaving
Expand Down
12 changes: 6 additions & 6 deletions lib/WebGUI/Asset/Wobject/Thingy.pm
Expand Up @@ -2508,6 +2508,12 @@ sub www_editThingSave {
my $thingId = $self->session->form->process("thingId");
my $fields = $self->getFields($thingId);

if($fields->rows < 1){
$self->session->log->warn("Thing failed to create because it had no fields");
my $i18n = WebGUI::International->new($self->session, "Asset_Thingy");
return $self->www_editThing($i18n->get("thing must have fields"));
}

my $thing = {
thingId => $thingId,
label => $form->process("label"),
Expand Down Expand Up @@ -2538,12 +2544,6 @@ sub www_editThingSave {
};
$self->setCollateral("Thingy_things", "thingId", $thing, 0, 1);

if($fields->rows < 1){
$self->session->log->warn("Thing failed to create because it had no fields");
my $i18n = WebGUI::International->new($self->session, "Asset_Thingy");
return $self->www_editThing($i18n->get("thing must have fields"));
}

while (my $field = $fields->hashRef) {
my $display = $self->session->form->process("display_".$field->{fieldId}) || 0;
my $viewScreenTitle = $self->session->form->process("viewScreenTitle_".$field->{fieldId}) || 0;
Expand Down

0 comments on commit 4027b5b

Please sign in to comment.