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?
Comment | File | Size | Author |
---|---|---|---|
#3 | eck-fix-references-dialog-paths-2023155-3.patch | 739 bytes | mercepedraza |
#1 | eck-fix-references-dialog-paths-2023155-1.patch | 735 bytes | paulihuhtiniemi |
Comments
Comment #1
paulihuhtiniemi CreditAttribution: paulihuhtiniemi commentedAnd here's a patch that changes [bundle-sanitized] to [bundle]
Comment #2
fmizzell CreditAttribution: fmizzell commentedLowering 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.
Comment #3
mercepedraza CreditAttribution: mercepedraza at Ymbra commentedThis is the patch re-rolled to apply to the current version.
Comment #4
rodrigoaguileraWorking nicely
Comment #5
darol100 CreditAttribution: darol100 as a volunteer and commentedShall we merge this already ?
Comment #6
darol100 CreditAttribution: darol100 as a volunteer and commentedBTW.. I just test it out and it works as expected.
Comment #8
legolasboCommitted and pushed to 7.x-2.x, thanks!