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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

Sadly 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.

tauno’s picture

Title: Entity plugin with long entity_admin_root causes Undefined offset notices and doesn't work » Change admin menu structure for registration types to allow for panelizer integration
Project: Panelizer » Entity Registration
Version: 7.x-3.x-dev » 7.x-1.x-dev
Component: Code » Registration Core
Category: bug » feature

@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.

dsnopek’s picture

Issue summary: View changes

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.

Updating the issue summary.

dsnopek’s picture

Status: Active » Needs review
FileSize
6.21 KB

Here is an initial patch to do this! Please let me know what you think. :-)

dsnopek’s picture

FileSize
6.25 KB

Oops! Forgot to update 'bundle argument' - here's a new version of the patch which does.

cboyden’s picture

The 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.

Greg Boggs’s picture

Status: Needs review » Reviewed & tested by the community
cboyden’s picture

FileSize
6.28 KB

The patch in #5 no longer applies to the latest dev. Updated patch attached.

john.oltman’s picture

Status: Reviewed & tested by the community » Closed (outdated)