DirectorObjectForm: fix redirectionUrl for...

...objects without id

fixes #1043
This commit is contained in:
Thomas Gelf 2017-07-28 22:40:16 +02:00
parent b2736e1776
commit 74a887f5af
2 changed files with 4 additions and 1 deletions

View File

@ -267,6 +267,9 @@ abstract class DbObject
{
if (array_key_exists($key, $this->properties)) {
return true;
} elseif ($key === 'id') {
// There is getId, would give false positive
return false;
}
$func = 'get' . ucfirst($key);
if (substr($func, -2) === '[]') {

View File

@ -579,7 +579,7 @@ abstract class DirectorObjectForm extends DirectorForm
$object->getUrlParams()
);
} elseif ($object->hasProperty('id')) {
$this->setSuccessUrl($this->getSuccessUrl()->with('id', $object->get('id')));
$this->setSuccessUrl($this->getSuccessUrl()->with('id', $object->getProperty('id')));
}
}