Problem/Motivation
If you have Rest and Views UI install and you try to access Views via rest everything breaks because of missing link relationships.
Discovered in #2571235: [regression] Roles should depend on objects that are building the granted permissions
Proposed resolution
One option is to provide the link relationships.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 3088282-2.patch | 1.51 KB | alexpott |
| #5 | 3088282-4-with-tests.patch | 2.52 KB | gabesullice |
| #4 | 3088282-4.patch | 1.83 KB | gabesullice |
| #2 | 3088282-2.patch | 1.51 KB | alexpott |
| #2 | 3088282-2-test-only.patch | 779 bytes | alexpott |
Comments
Comment #2
alexpottHere's a test and a possible fix.
Comment #4
gabesulliceCopying part of my comment from #2571235-102: [regression] Roles should depend on objects that are building the granted permissions
Instead of adding
Linkheaders for every link template, we should be adding them for every link template with a defined link relation type and then follow that up by removing link relation types that don't make sense in the REST use-case.Comment #5
gabesulliceComment #6
alexpottBut doesn't this link relation make sense? I guess maybe having just the link relation to the edit-form is enough.
The flip-side of the approach taken in #5 - this makes discovering missing link relations really hard.
Comment #7
wim leersWhile I agree with the questionability of the design choice that was made for the REST module (@gabesullice++), I think that it makes more sense to be consistent about our current approach rather than starting to deviate from it (@alexpott++).
It's possible that in the case of a decoupled UI, you want to be able to link to the
edit-display-form. You're right that in that case the client would be bridging between an API-consumption context and a HTML-UI context. That's odd. But it's the vision that was behind the original REST architecture, and in principle it allows a gradual creation of a decoupled admin UI.You're right that the current implementation violates the letter of the spec with regard to extension link relation types, that's indeed why I created #2848945: EntityType link templates: using link relation type names as keys is a problem. But that doesn't make it any less usable in practice.
Long story short: I think this is not the time or place to start deviating from the principle for the REST module that was established a long time ago. That requires a longer discussion, specifically dedicated to that scope. This issue is just a bugfix to ensure all REST resources behave consistently.
Comment #8
alexpottSo in light of #7 re-upping that patch.
Comment #9
wim leersComment #10
gabesulliceFair enough.
Comment #12
larowlanFixed on commit
Committed 34c888b and pushed to 9.0.x. Thanks!
Backported to 8.9.x
Comment #14
alexpottBoth I and @catch +1'd the backport.
Comment #16
larowlan