Trying to write a panelizer plugin for registration entities. It appears that having more than 4 parts in the admin_root causes the plugin to break.
Using:
public $entity_admin_root = 'admin/structure/registration/registration_types/manage/%';
public $entity_admin_bundle = 5;
Causes 15 notices on the registration type edit page (admin/structure/registration/registration_types/manage/registration_type_1):
Notice: Undefined offset: 8 in _menu_translate() (line 776 of /Users/tauno/work/registration_dev/drupal/includes/menu.inc).
Additionally, the actual callbacks for editing the layout, content, etc. for registration panels don't work either. They all lead to the Settings page for that panel variant.
If I alter the registration module to put the registration_type config at admin/structure/registration/manage/%registration_type and adjust the plugin to match then it appears to work as expected.
Actual code is in the panels branch of registration: http://drupalcode.org/project/registration.git/tree/refs/heads/panels:/m...
Proposed resolution
Per @merlinofchaos in #1, this is a core Drupal problem and getting this to work at the current menu depth is super hard or impossible.
So, I'd like to propose changing the the admin paths as follows:
/admin/structure/registration/registration_types
->/admin/structure/registration
/admin/structure/registration/registration_states
->/admin/config/workflow/registration_states
This will make the menu depth for registration types the same as content types.
It may make the registration states harder to find by moving them under Configuration -> Workflow, but since they are a "workflow" for registration it does sort of make sense.
Comment | File | Size | Author |
---|---|---|---|
#8 | registration-admin-paths-1927524-8.patch | 6.28 KB | cboyden |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedSadly this is either unfixable or very very hard to fix.
Drupal has a hard menu depth limit of 8; you're using 6 of that, leaving only 2 more depth items, and that may not be enough. That notice indicates that it's trying to put something in position 9 (because it is 0 indexed) and Drupal can't handle that.
And I wrestled to get the depth as slim as possible, but there's just 2 levels of tabs that are unavoidable.
So. I don't think I can fix this. It may be possible, but I don't know how.
Comment #2
tauno CreditAttribution: tauno commented@merlinofchaos - bummer. Thanks for the quick feedback.
Moving to the registration queue so we can look at how reasonable it might be to reduce the depth of the registration type admin menu. Might be easier to just beef up the ctools registration_view task plugin to work around #1566112: ctools_entity_field_extra_content_type always assumes extra fields are only available from hooks instead and call that good for panels support.
Comment #3
dsnopekI'd like to propose changing the the admin paths as follows:
/admin/structure/registration/registration_types
->/admin/structure/registration
/admin/structure/registration/registration_states
->/admin/config/workflow/registration_states
This will make the menu depth for registration types the same as content types.
It may make the registration states harder to find by moving them under Configuration -> Workflow, but since they are a "workflow" for registration it does sort of make sense.
Updating the issue summary.
Comment #4
dsnopekHere is an initial patch to do this! Please let me know what you think. :-)
Comment #5
dsnopekOops! Forgot to update 'bundle argument' - here's a new version of the patch which does.
Comment #6
cboyden CreditAttribution: cboyden commentedThe patch is working. I don't see menu depth errors on the page, and I am able to get to Panelizer settings pages at admin/structure/registration/manage/%/panelizer. So that part is great.
I don't have a strong opinion one way or another about putting registration states under the config/workflow menu. It does make sense, but maybe there's a better location.
Comment #7
Greg BoggsComment #8
cboyden CreditAttribution: cboyden commentedThe patch in #5 no longer applies to the latest dev. Updated patch attached.
Comment #9
john.oltman CreditAttribution: john.oltman at SiteBasin, Inc. commented