Since #2987609: Rename the entity parameter from the entity type ID to 'entity' for all routes, decoupled_route no longer works with jsonapi 2.x.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3003019-3.patch | 2.19 KB | wim leers |
| #2 | 3003019-2.patch | 2.2 KB | wim leers |
Since #2987609: Rename the entity parameter from the entity type ID to 'entity' for all routes, decoupled_route no longer works with jsonapi 2.x.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3003019-3.patch | 2.19 KB | wim leers |
| #2 | 3003019-2.patch | 2.2 KB | wim leers |
Comments
Comment #2
wim leersRelying on a version number is impossible because if
jsonapi2.x or 1.x is installed via a git checkout, it's impossible to determine a version number.So we need to inspect the actual route definition.
Fortunately, to generate a URL for a route, that same route definition also needs to be retrieved. The performance cost is therefore minimal.
Of course, the result for the first generated URL also applies to all subsequent ones. So static caching is appropriate in this case (JSON API 2.x is not going to be replaced with 1.x mid-request, or vice versa).
And rather than modifying the existing method that is already pretty long, I've added a new helper method.
static, to prove it is independent of everything else in the class. But most importantly, to make it trivial to remove in the future :)Comment #3
wim leersRebased.
Comment #4
mortona2k commentedI was getting an error trying to get output for a basic page url, and installing the patch fixed it.
Comment #6
e0ipsoThanks for the patch! WFM!