DirectorObjectForm: hidden id field, start...

...fading it out - don't want to see this here
This commit is contained in:
Thomas Gelf 2021-10-05 22:57:09 +02:00
parent 2e069ef127
commit c994610031
3 changed files with 6 additions and 13 deletions

View File

@ -19,17 +19,11 @@ class DatafieldController extends ActionController
public function indexAction()
{
$edit = false;
if ($id = $this->params->get('id')) {
$edit = true;
}
$form = DirectorDatafieldForm::load()
->setDb($this->db());
if ($edit) {
$form->loadObject($id);
if ($id = $this->params->get('id')) {
$form->loadObject((int) $id);
$this->addTitle(
$this->translate('Modify %s'),
$form->getObject()->varname

View File

@ -284,7 +284,7 @@ class ImportsourceController extends ActionController
. (int) $source->get('id');
$this->content()->prepend(
ImportRowModifierForm::load()->setDb($this->db())
->loadObject($this->params->getRequired('id'))
->loadObject((int) $this->params->getRequired('id'))
->setListUrl($listUrl)
->setSource($source)
->handleRequest()

View File

@ -1080,14 +1080,13 @@ abstract class DirectorObjectForm extends DirectorForm
$class = $this->getObjectClassname();
if (is_int($id)) {
$this->object = $class::loadWithAutoIncId($id, $this->db);
if ($this->object->getKeyName() === 'id') {
$this->addHidden('id', $id);
}
} else {
$this->object = $class::load($id, $this->db);
}
// TODO: hmmmm...
if (! is_array($id) && $this->object->getKeyName() === 'id') {
$this->addHidden('id', $id);
}
return $this;
}