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.
This patch adds language handling to the menu settings on the node form. It sets the language of the created menu item to the language of the node and sets defaults for link_title and weight based on the menu item associated with the source translation.
Also, moves the existing form_alter code into i18nmenu_form_menu_edit_item_alter() to unclutter the form_alter hook.
Comment | File | Size | Author |
---|---|---|---|
#5 | i18nmenu_6x_348444.patch | 2.75 KB | stella |
#2 | i18nmenu_6x_348444.patch | 2.23 KB | stella |
i18nmenu.patch | 3.24 KB | zroger |
Comments
Comment #1
nedjoNice. This patch is a necessary compliment to #339057: Performance: menu translations continuously updated.
It would be good to look at doing as much as we can of this in hook_nodeapi()'s 'prepare translation' op, where we might be able to affect the form before it's generated.
I suspect we need to consider whether the menu item is translatable, by testing it's language value.
I'll try to look at this again later in the week.
Comment #2
stella CreditAttribution: stella commentedSame patch, just re-rolled against latest DRUPAL-6--1
Comment #3
stella CreditAttribution: stella commentedComment #4
nedjoComment #5
stella CreditAttribution: stella commentedSlightly modified version of the patch. It uses hook_nodeapi() on 'prepare translation' to set the menu title, etc. This forces the 'menu settings' collapsed fieldset to be expanded, which makes it more obvious users that they are also creating a menu item.
Comment #6
catchThis patch adds a duplicate i18nmenu_form_alter() - is it missing the removal of the old one?
Comment #7
stella CreditAttribution: stella commentedThis patch has already been committed, so that's why a duplicate function was added when the patch was applied.
Cheers,
Stella
Comment #8
Jose Reyero CreditAttribution: Jose Reyero commentedSorry, I had committed the patch but forgot to update the issue.
Comment #10
co_maximago CreditAttribution: co_maximago commentedDoes anybody know if this patch has been backported to D5 too?
I'm having the same issue using D5 with i18n 5.x-2.5 and am desperately looking for a solution.
Thanks in advance.