Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
After #2301317: MenuLinkNG part4: Conversion we have a remaining @todo in menu_ui.module where it alters the node type form.
We are pre-loading all the possible menu parent options into the $form array, but then using ajax in the form to just show some of them. Since the options array can be very large, this is a potential performance/memory problem as it is now.
Proposed resolution
Re-work into better FAPI code so we implement the necessary process steps to avoid validation errors, or rework this form to be more like the book module form where only I menu at a time has links displayed.
Remaining tasks
todo
User interface changes
todo
API changes
todo
Comments
Comment #1
pwolanin CreditAttribution: pwolanin commentedComment #2
YesCT CreditAttribution: YesCT commentedbefore changing
- $options = menu_ui_parent_options(menu_ui_get_menus(), $menu_link);
to
+ $options = $menu_parent_selector->getParentSelectOptions('');
the @todo was
- // @todo Convert menu_ui_parent_options() into a #process callback.
that solution to this problem (converting getParentSelectOptions() to a process callback) may not even make any sense. So here explore what should be done.
Comment #15
DanielVeza#1805054: Cache localized, access filtered, URL resolved, and rendered menu trees added cachability to the functions referenced in this issue. I wonder if this is still needed?
If it's not - We should change this ticket to remove the @todo