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.
yched points out in #678590: Path alias link is below submit button on taxonomy term add that it would be a good thing if path module implemented hook_field_extra_fields() to allow the user to control the 'URL alias' fieldset on node or taxonomy term forms. Let's do it.
Comment | File | Size | Author |
---|---|---|---|
#11 | 687994-11.drupal.path_.path-field-extra-fields.patch | 1.01 KB | joachim |
#9 | 687994-9.drupal.path_.path-field-extra-fields.patch | 1.2 KB | joachim |
#1 | 687994-path-field-extra-fields-D7.patch | 1.16 KB | Dave Reid |
Comments
Comment #1
Dave ReidComment #2
yched CreditAttribution: yched commentedIn node forms, the 'url alias' input is in the 'advanced settings' VTs, and, as such, is not reorderable - the VT group sinks at the bottom of the form.
Patch is OK for taxo terms, though.
Comment #3
Dave ReidVertical tabs does not show up if JavaScript is disabled or if the vertical tabs have been removed (yes, it's possible).
Comment #4
yched CreditAttribution: yched commentedThen each fieldset in the VT group must be assigned an individual weight that ensures it sinks low enough in the form when JS is off.
We cannot have Field UI support reordering all the stuff that is currently in node VTs:
- would add much much cruft to the list on 'Manage fields'
- we cannot support moving stuff in or out of VTs
And we cannot have a different set of exposed 'extra fields' depending on whether VT/JS is present or not.
Comment #5
Dave ReidI don't think we're quite understanding eachother. If JS is disabled we don't see vertical tabs at all. We see fieldsets. All the fieldsets on the node form do have a weight right now in code.
We cannot support moving stuff in or out of VTs? Why not?
Comment #6
Dave ReidSetting back to needs review.
Comment #7
yched CreditAttribution: yched commentedWe don"t see the VTs with JS off, but they keep structuring the $form that gets rendered, right ? Even if you don't see the VT set, it's still at the top level in the $form, and its weight should control the position of the fieldsets 'as a group', even if the group container (the VT set) is not visible.
At any rate, we cannot have Field UI handle two separate reordering scenarios ('client has JS' / 'client has no JS') to deterrmine what's reorderable or not. If a form element is in a VT, it's not reorderable with JS on, so it cannot be reorderable with JS off either.
Comment #8
Dave ReidI don't think it would restructure it? You'd be willing to try it out right? :)
Comment #9
joachim CreditAttribution: joachim commented> If a form element is in a VT, it's not reorderable with JS on, so it cannot be reorderable with JS off either.
I've tried this with JS turned off, and the weight of the URL alias element has no effect at all on the node form.
So this possibly needs removing from the patch.
Here's a reroll of the above patch at any rate to take into account the hook now needing two things, 'form' and 'display'. Also, URL aliases are an element, not a fieldset in the taxonomy term form.
Comment #10
Dave ReidThere is no path element output on display, so we don't need to provide that at all, it's optional. Let's rather sync the descriptions used between node and taxonomy. We don't need two different strings for the same thing.
Comment #11
joachim CreditAttribution: joachim commentedOh duh. How right you are!
Here's a reroll. I've followed the pattern node module uses for the node title, 'Node module element'.
Comment #12
joachim CreditAttribution: joachim commentedGiven the node bit does nothing AFAICT, and other core modules that provide fieldsets don't provide a hook_field_extra_fields() weighting, should we just drop the node part?