Closed (outdated)
Project:
Drupal core
Version:
11.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
27 Oct 2010 at 06:27 UTC
Updated:
4 May 2025 at 10:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dave reidSomething like this
Comment #2
moshe weitzman commentedNo risk, and helps these important contribs. pre_save is a handy hook and we better not cripple it.
Comment #3
yched commented@moshe : It sounds like this comment was rather aimed at #968458: Missing hook_entity_presave() ? I'd agree on RTBC on that other one, I'm less sure about this one.
When adding 'uri callback' in #525622: 'as link' formatters need a generic way to build the url of an 'entity', we hesitated between the 'callback' and 'token-like string' approaches. We went the callback way, an now we'd in fact have both ? And need to keep the two formats (3 actually : callback, path, token) synchronized ? Sounds odd.
I'm also not sure what's the usefulness of
'path' => 'node/%node'.Menu.inc can match an actual 'node/[nid]' inbound path to the abstract pattern, but the other way around ? what's the unambiguous meaning of '%node' ?
Comment #4
dave reidYeah, I'm guessing moshe meant to RTBC the other patch, not this one. The problem is modules want to know what the default entity URL will look like without having an actual entity object.
Comment #5
yched commentedisn't it possible to build a fake object with entity_create_stub_entity() and run uri callback on it ?
Comment #6
dave reidComment #7
dave reidThat wouldn't work if your entity's URI was something like my/entity/[id]/path or there is complex logic in the entity's uri callback.
Comment #8
dave reidThe usefulness of defining the default router path (node/%node) in the entity info is so that other modules like Devel, Print, other things that want to add tasks or callbacks as sub-paths of the entity can do so on a generic basis.
After discussion with merlinofchaos I think we want to just add 'menu path' and not the token version.
Comment #21
smustgrave commentedWonder if this is still a needed task after so much time?
Comment #23
quietone commentedThere hasn't been a response to the query about 2years ago about the status of this issue. And this may have been resolved by #2350503: Add route generation handlers for entities.
Closing as outdated.
Comment #24
quietone commented