See #2666798-25: Add a entity revision parameter converter & route enhancer. Classic unit test fail and nobody spotted it, including myself.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | entity-revision-services-2688668-2.patch | 987 bytes | berdir |
See #2666798-25: Add a entity revision parameter converter & route enhancer. Classic unit test fail and nobody spotted it, including myself.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | entity-revision-services-2688668-2.patch | 987 bytes | berdir |
Comments
Comment #2
berdirI guess we need tests for this? Should we add a revision route to EntityTestRev or so and try to access it? The entity module does that using a kernel test which was enough to catch this.
Comment #3
dawehnerUps ...
Comment #4
bojanz commentedThe EntityRevisionRouteEnhancer in Entity API had a priority 20. This one has none. Not relevant?
EntityTestRev has a revision route, we can start from there for tests.
Comment #5
dawehnerI guess we really better have some form of integration test coverage.
Comment #6
berdirIndeed, we have this:
I can't see anyting that actually uses this and as far as I see, it's also bogus as it does a normal entity view of the ID?
So we should update that to follow the pattern that we are expecting and do a GET request to it. That should be enough?
Comment #7
bojanz commentedSo, we're missing two things:
1) The service definitions.
2) A controller response for the rendered revision
Added EntityViewController::viewRevision(), fixed the test route to use it, expanded EntityViewControllerTest.
I believe this is as minimal as it gets. A bigger patch could always introduce '_entity_revision_view' to match the existing '_entity_view', but that could be a different issue too.
Comment #8
dawehnerThank you for adding this new test coverage!
Comment #9
berdirThanks. Looks good to me to.
I'd say instead of adding _entity_revision_view, we could look into generating the revision view route automatically instead? Do we have an issue for that already?
Comment #10
bojanz commented@berdir
We can repurpose #2666818: [PP-2] Add a generic revision VIEW controller for it (since we have the controller, but not the route provider).
Comment #13
catchCommitted/pushed to 8.2.x and cherry-picked to 8.1.x. Thanks!
Comment #16
catchPHP7 failed immediately after this commit, reverting for now - will send for DrupalCI run.
Comment #17
berdirYes failing badly, but no idea why. Did another re-test, still fails.
Comment #18
alexpottIt's nothing to do with this issue... see #2695785: PHP7 tests with MySQL and Postgres failing
Comment #19
alexpottCommitted f23ff6a and pushed to 8.1.x and 8.2.x. Thanks!
Comment #22
berdirSomething weird is going on with issue statues...