allow edit templates without attached forms
This lets authors not use FormBuilder unless they really want to... for now.
This commit is contained in:
parent
1992f33de9
commit
aabb4648d6
1 changed files with 7 additions and 3 deletions
|
|
@ -2744,8 +2744,10 @@ sub www_add {
|
|||
|
||||
my $template = eval { $newAsset->getEditTemplate };
|
||||
return $@ if $@;
|
||||
$template->getForm("form")->action( $self->getUrl );
|
||||
$template->getForm("form")->addField( "Hidden", name => "func", value => "addSave" );
|
||||
if ( $template->getForm("form") ) {
|
||||
$template->getForm("form")->action( $self->getUrl );
|
||||
$template->getForm("form")->addField( "Hidden", name => "func", value => "addSave" );
|
||||
}
|
||||
return $template;
|
||||
}
|
||||
|
||||
|
|
@ -2893,7 +2895,9 @@ sub www_edit {
|
|||
return $self->session->privilege->locked() unless $self->canEditIfLocked;
|
||||
|
||||
my $template = $self->getEditTemplate;
|
||||
$template->getForm('form')->addField( "Hidden", name => "func", value => "editSave" );
|
||||
if ( my $form = $template->getForm('form') ) {
|
||||
$form->addField( "Hidden", name => "func", value => "editSave" );
|
||||
}
|
||||
|
||||
return $template;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue