- πΊπΈUnited States smustgrave
Closing as outdated. If still a valid bug please update issue summary with new steps to reproduce. Still will need valid tests.
Discovered this as the root cause of #2651198: Latest Version tab shows on block_content even when there is no forward revision β .
Here's the deal. Workbench Moderation adds a new local task to any revisionable content entity, which in core means nodes and block content. This local task is bound to a route, which has a custom access checker that hides the route if there is no forward revision of an entity. The entity that it checks is passed to it.
When routing, everything works fine and the page is accessible or not as appropriate. On other tabs on the block (Delete and Devel), everything works fine and the page is accessible or not as appropriate.
On the block edit page, and ONLY the block edit page (/block/{id}), there is a problem. Specifically, one thing Workbench Moderation does is add its own param converter, which simply extends the core EntityConverter class. When viewing the Edit page, that converter is called twice, once during routing and once from within the tab-building system. In both cases, EntityConverter calls $entity = $storage->load($value);
.
When called from routing, the entity is not yet in the static cache and so is loaded from storage, and cached, and $entity->entityKeys has 4 entries: id, uuid, bundle, and revision.
When that load() call is invoked later, from within the tab building process, the entity is already statically cached... but $entity->entityKeys is now lacking the revision key!
As a result, $entity->getRevisionId() (which Workbench Moderation calls later) returns NULL, which is not == to the latest revision ID (of course), and thus the tab shows up as though there were a forward revision.
This issue appears ONLY on the block_content edit tab and nowhere else. It does not affect nodes, and does not affect other tabs on the block content entity.
I'm well past my ability to debug this, but hopefully this will be enough for someone with more knowledge of entities and/or blocks to pick it up and find the root issue.
Closed: outdated
9.5
Last updated
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Closing as outdated. If still a valid bug please update issue summary with new steps to reproduce. Still will need valid tests.