diff --git a/lib/WebGUI/Asset/Wobject/Thingy.pm b/lib/WebGUI/Asset/Wobject/Thingy.pm index 6cc98e8ff..b5192cf96 100644 --- a/lib/WebGUI/Asset/Wobject/Thingy.pm +++ b/lib/WebGUI/Asset/Wobject/Thingy.pm @@ -866,15 +866,15 @@ sub getEditFieldForm { -value=>$field->{fieldType} || "Text", -options=>\%fieldTypes, -id=>$dialogPrefix."_fieldType_formId", - ); + ); $f->yesNo( -name=>'isUnique', -label=>$i18n->get('unique label'), - -hoverHelp=>$i18n->get('unique description'), + -hoverHelp=>$i18n->get('unique description'), -value=>$field->{isUnique}, -id=>$dialogPrefix."_isUnique_formId", - ); + ); $f->raw($self->getHtmlWithModuleWrapper($dialogPrefix."_fieldInThing_module")); @@ -2083,7 +2083,7 @@ sub www_editThing { maxEntriesPerUser=>undef, maxEntriesTotal=>undef, ); - $thingId = $self->addThing(\%properties,0); + $thingId = "new"; } else{ %properties = %{$self->getThing($thingId)}; @@ -2614,13 +2614,14 @@ sub www_editFieldSave { $defaultValue = $session->form->process("defaultFieldInThing"); } + $thingId = $self->addThing({ thingId => 'new' },0) if $thingId eq 'new'; $fieldId = $session->form->process("fieldId"); %properties = ( fieldId => $fieldId, thingId => $thingId, label => $label, fieldType => $fieldType, - isUnique => $uniqueField, + isUnique => $uniqueField, defaultValue => $defaultValue, possibleValues => $session->form->process("possibleValues"), pretext => $session->form->process("pretext"), @@ -2678,7 +2679,7 @@ sub www_editFieldSave { # Make sure we send debug information along with the field. $log->preventDebugOutput; - $session->output->print($newFieldId.$listItemHTML); + $session->output->print($thingId.$newFieldId.$listItemHTML); return "chunked"; }