- 🇨🇭Switzerland wengerk Lausanne
Dibix, thank you very much for all of your efforts, research on the matter, and providing a comprehensive summary of the issue with precise steps.
Automatically closed - issue fixed for 2 weeks with no activity.
When calling both bamboo_render_field
or bamboo_load_entity
without IDs parameters, those are guessed from the CurrentRouteMatch. But, when we want to load/render Revision Entity/Field, it will by default guess the $entity_type
from CurrentRouteMatch.
Our problem, when accessing a node revision page (node/1/revisions/2/view), we want both bamboo_render_field('title', 'node')
or bamboo_load_entity('node')
to load the revision 2 and not the Node ID 1.
1. Update the revision template of any Node/Taxonomy that is revisionable
node.html.twig
2. Use {{ bamboo_load_entity('node').title.value }}
in that template and print values
3. Create sample data as follow:
With this sample data you will have the following IDs:
- Article 1 = Node ID 1 (nid 1) with 2 revisions IDs (1, 2)
- Article 2 = Node ID 2 (nid 2) with 1 revision ID (3)
3. Browser to the page using node.html.twig
- node/1/revisions/1/view will display Article 1
- node/1/revisions/2/view will display Article 1
- node/1/revisions/3/view will display Article 1
- node/2/revisions/1/view will display Article 2
- node/2/revisions/2/view will display Article 2
- node/2/revisions/3/view will display Article 2
Instead we want
- node/1/revisions/1/view will display Article 1
- node/1/revisions/2/view will display Revised Article 1
- node/1/revisions/3/view will display Article 2
- node/2/revisions/1/view will display Article 1
- node/2/revisions/2/view will display Revised Article 1
- node/2/revisions/3/view will display Article 2
We have no way to fix this behavior inside bamboo_load_entity
.
We have to create a new function bamboo_load_entity_revision
which is able to load only revision of given ID or guessed from URL (CurrentRouteMatch).
bamboo_load_entity_revision
bamboo_load_entity_revision
None
bamboo_load_entity_revision
None
Fixed
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Dibix, thank you very much for all of your efforts, research on the matter, and providing a comprehensive summary of the issue with precise steps.
Automatically closed - issue fixed for 2 weeks with no activity.