Currently MenuForm cannot easily be embedded in another from because of problems related to #2537732: PluginFormInterface must have access to the complete $form_state (introduce SubFormState for embedded forms)

This patches moves the call to \Drupal\menu_ui\MenuForm::submitOverviewForm from \Drupal\menu_ui\MenuForm::save to the new override \Drupal\menu_ui\MenuForm::submitForm where it should be.

This allows use to embed the menuform into a BlockForm in the offcanvas tray here: #2753941: [Experimental] Create Outside In module MVP to provide block configuration in Off-Canvas tray and expand site edit mode

CommentFileSizeAuthor
#2 2775057-2.patch1.23 KBtedbow

Comments

tedbow created an issue. See original summary.

tedbow’s picture

Status: Active » Needs review
StatusFileSize
new1.23 KB

The patch

tim.plunkett’s picture

I'd RTBC this, but it's actually my code from the other issue.

webchick’s picture

Status: Needs review » Reviewed & tested by the community

Looks straight-forward to me. Also nice that we get rid of some form logic in the save() handler.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This is just shifting code around. Looks good to me. Committed 5826818 and pushed to 8.2.x. Thanks!

  • alexpott committed 5826818 on 8.2.x
    Issue #2775057 by tedbow, tim.plunkett: Make MenuForm extensible
    

  • alexpott committed 5826818 on 8.3.x
    Issue #2775057 by tedbow, tim.plunkett: Make MenuForm extensible
    

  • alexpott committed 5826818 on 8.3.x
    Issue #2775057 by tedbow, tim.plunkett: Make MenuForm extensible
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.