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.
Trying to fix a UI issue -- #890716: Changing from public to private does not change field behavior -- and would like to provide 'edit' links so that admins can check the affected fields.
Problem is, there seems to be no way to request the admin path for a field instance. It's all tied up in the menu system -- see field_ui_menu() -- and cannot be derived from the entity hooks themselves.
Field API needs to be able to expose this information, so that uer interfaces can direct users to the correct system path.
Comment | File | Size | Author |
---|---|---|---|
#2 | 890804-2.patch | 3.6 KB | swentel |
Comments
Comment #1
sun.core CreditAttribution: sun.core commentedUnfortunately a feature request for D8 at this point in time.
Comment #2
swentel CreditAttribution: swentel commentedSomething like this ? It is kind of possible with field_ui_bundle_admin_path(), but I've added two extra paramaters called $field_instance and $tab to return the exact path of a field_instance, if it effectively exists. Added tests too.
Comment #3
swentel CreditAttribution: swentel commentedComment #4
yched CreditAttribution: yched commentedThe func name (bundle_admin_path) doesn't really lend itself to be extended to 'path to field edit page' IMO.
I'd think a separate function would be better - field_ui_field_admin_path() ? (would use field_ui_bundle_admin_path() internally).
Also, it's very possible that the new router system, with named paths + arguments and a link generator, will make that obsolete anyway :-)