I have entity type called Demo Entity and it has a bundle with the same name. So edit link for the entity is:
admin/structure/entity-type/demo_entity/demo_entity/[entity_id]/edit

In function eck_references_dialog_entity_admin_paths() a token [bundle-sanitized] is used:

foreach (EntityType::loadAll() as $entity_type) {
    $admin_paths["{$entity_type->name}"] = array(
      'add' => "{$path}/{$entity_type->name}/[bundle-sanitized]/add",
      'edit' => "{$path}/{$entity_type->name}/[bundle-sanitized]/[entity_id]/edit"
    );
  }

Problem is that [bundle-sanitized] converts underscore to hyphen, so in references dialog link, the following path is used:

admin/structure/entity-type/demo_entity/demo-entity/[entity_id]/edit

Notice how bundle is now demo-entity instead of demo_entity. This means that our link is now broken and references dialog doesn't work.

Using [bundle] instead of [bundle-sanitized] seems to fix this, but I'm not sure if this is a safe way to fix this?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

paulihuhtiniemi’s picture

Status: Active » Needs review
FileSize
735 bytes

And here's a patch that changes [bundle-sanitized] to [bundle]

fmizzell’s picture

Priority: Normal » Minor
Issue summary: View changes

Lowering priority just because this issue is related to an integration with another module, and not ECK's core functionality. As soon as a few more people check things out and RTBC this (or me later on) I will merge this in.

mercepedraza’s picture

This is the patch re-rolled to apply to the current version.

rodrigoaguilera’s picture

Status: Needs review » Reviewed & tested by the community

Working nicely

darol100’s picture

Shall we merge this already ?

darol100’s picture

BTW.. I just test it out and it works as expected.

  • legolasbo committed 6ad0a76 on 7.x-2.x authored by mercepedraza
    Issue #2023155 by paulihuhtiniemi, mercepedraza: References dialog paths...
legolasbo’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 7.x-2.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.