Closed (fixed)
Project:
JSON:API
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
26 Jan 2018 at 10:12 UTC
Updated:
2 Mar 2018 at 11:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
gabesulliceUpdating credits.
Comment #3
wim leers#2937279: [META] Introduce concept of internal resource types says this is minor, but this issue is marked major. Which is it?
Comment #4
gabesulliceOne small step for man, one giant leap for JSON API.
Or something like that :P
In the parent issue it's minor wrt to progress, i.e., "it shouldn't be much work". It's still a "major" priority. I should have a patch today.
Comment #5
wim leers👍
Comment #6
gabesulliceThis depends on #2944992: Empty relationships do not have a links object.
Comment #8
gabesullicederp
Comment #10
wim leersThis is 90% duplicating
\Drupal\Tests\jsonapi\Functional\InternalEntitiesTest::testIncludes().I think it makes sense to refactor to share code now — because now there's clearly multiple callers. (
::testEntryPoint()is another one.)This is not testing an internal resource type? Why then are we changing this? I think I'm missing something obvious, sorry :(
AFAICT this means that we never set the
relatedlink? Even if there's 10 relatable resource types that are non-internal, and a single one that is internal?Comment #11
gabesullice1. Done.
2. Calling
getRelatableResourceTypesrequires thatsetRelatableResourceTypesis called first. Which is done automatically by the resource type repository, but we have to do manually in tests. This might be worth a follow-up, as it's a tedious thing to do everywhere.3. static::hasNonInternalResourceType, so it will set
relatedas long as just one resource type is not "internal". It's inverse would be "allInternalResourceTypes".Comment #12
wim leersMarking NR to get this patch tested.
Comment #13
gabesulliceComment #15
wim leersWeird, #12 should totally have triggered testing of #11.
I totally forgot about
@link! ❤️If we use
$documentelsewhere, then why not also here?Fixing on commit.
Comment #16
e0ipso💥
Thank you for taking care of this guys!