Skip to content

Commit

Permalink
hotfix in MenuItemPersistenceSubscriber. Checking if a given property…
Browse files Browse the repository at this point in the history
… exists in the form.
  • Loading branch information
Peter Knijff committed Aug 8, 2017
1 parent ee60a5f commit ed2a221
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ public function postSetData(FormEvent $e)
if ($e->getData() === null) {
return;
}

// Checks if the form has a given property
// A property can be removed in a child class but the eventSubscriber still exists
if (!$e->getForm()->has($this->property)) {
return;
}
if ($this->provider->supports($e->getData())) {
if ($item = $this->mm->getItemBy(array(':path' => $this->provider->url($e->getData())))) {
$item->setAddToMenu(true);
Expand Down

0 comments on commit ed2a221

Please sign in to comment.