Hello, as it was mentioned here https://www.drupal.org/project/jsonapi_extras/issues/2946790 I have problem with version 8.x-1.10 and extras dev-1.x c2d0f5368a8a19b5aa4f525977ca62d62d7362d6 with patch https://www.drupal.org/files/issues/2946790-2.patch (it doesnt work without patch).. now im getting:
[22-Feb-2018 16:31:48] WARNING: [pool www] child 6 said into stderr: "NOTICE: PHP message: Error: Call to a member function isInternal() on null in /var/www/html/docroot/modules/contrib/jsonapi/src/Normalizer/Value/RelationshipNormalizerValue.php on line 120 #0 /var/www/html/docroot/modules/contrib/jsonapi/src/Normalizer/Value/RelationshipNormalizerValue.php(98): Drupal\jsonapi\Normalizer\Value\RelationshipNormalizerValue::hasNonInternalResourceType(Array)"
[22-Feb-2018 16:31:48] WARNING: [pool www] child 6 said into stderr: "#1 /var/www/html/docroot/modules/contrib/jsonapi/src/Normalizer/Value/RelationshipNormalizerValue.php(68): Drupal\jsonapi\Normalizer\Value\RelationshipNormalizerValue->getLinks('parent')"
[22-Feb-2018 16:31:48] WARNING: [pool www] child 6 said into stderr: "#2 /var/www/html/docroot/modules/contrib/jsonapi/src/Normalizer/Value/EntityNormalizerValue.php(109): Drupal\jsonapi\Normalizer\Value\RelationshipNormalizerValue->rasterizeValue()"
[22-Feb-2018 16:31:48] WARNING: [pool www] child 6 said into stderr: "#3 /var/www/html/docroot/modules/contrib/jsonapi/src/Normalizer/Value/JsonApiDocumentTopLevelNormalizerValue.php(127): Drupal\jsonapi\Normalizer\Value\EntityNormalizerValue->rasterizeValue()"
[22-Feb-2018 16:31:48] WARNING: [pool www] child 6 said into stderr: "#4 /var/www/html/docroot/modules/contrib/jsonapi/src/Normalizer/Value/J..."
I've found that when i try to access my resource without any include it works, when i try to add include for user (uid) or for example paragraphs which i have in this entity im getting it still works, when I try to add include to categories (reference to taxonomy term) it will fail with error above.
Comment | File | Size | Author |
---|---|---|---|
#14 | 2946969--isInternal-on-null--14.patch | 11.19 KB | e0ipso |
#14 | 2946969--interdiff--13-14.patch | 1.21 KB | e0ipso |
Comments
Comment #2
mkolar CreditAttribution: mkolar at Ciklum Western Europe for BurdaForward commentedComment #3
mkolar CreditAttribution: mkolar at Ciklum Western Europe for BurdaForward commentedThis fixes an issue, but dont know why there is NULL value in the $resource_types array.
Comment #4
gabesullice@mkolar, This issue is still in JSON API Extras I believe. It is currently "filtering out" disabled resources. But it should actually be setting them as "internal" per the new strategy in JSON API. It hasn't yet adopted that strategy.
Instead of the ConfigurableResourceTypeRepository just stripping out disabled resources, it should be setting the
$internal
property on theResourceType
by passing TRUE to theConfigurableResourceType
constructor.I may be able to work on this soon, but if someone else can do it, that would make it happen much faster! I'm happy to provide reviews/guidance here.
Comment #5
mkolar CreditAttribution: mkolar at Ciklum Western Europe for BurdaForward commentedComment #6
mkolar CreditAttribution: mkolar at Ciklum Western Europe for BurdaForward commented@gabesullice but I have all resources I'm including enabled, I've just checked.. I have disabled taxonomy_vocabulary--taxonomy_vocabulary and also some other taxonomy_term resources but categories resource is enabled (and overridden)..
Comment #7
e0ipso@mkolar can you share your request? I can't seem to reproduce this.
Comment #8
e0ipsoI think this may work. I was not able to reproduce this, but I have the feeling it's because of this.
@mkolar can you try this patch and see if it works?
Comment #9
bmx269 CreditAttribution: bmx269 as a volunteer commentedThe patch in #8 fixed the issue for me.
Comment #10
mkolar CreditAttribution: mkolar at Ciklum Western Europe for BurdaForward commentedI can also confirm that #8 works.. thanks @e0ipso and @gabesullice...
Comment #11
gabesullice@e0ipso, I can see why #8 fixed the problem. I think it would be okay to commit this immediately to "unbreak" most people's sites. However, I think you'll definitely need a follow-up.
All the relatable resource type stuff in JSON API operates on the principle that every resource type is present, but may be marked internal. If JSON API Extras does any filtering it's probably going to subtly break something else. I actually tried to build the internal thing in a way that would actually simplify this module :) just by marking a ResourceType as internal, JSON API itself will do the necessary filtering on its own.
Comment #12
gabesulliceBehold, simplicity.
Comment #13
e0ipsoComment #14
e0ipsoI need to remove #8 from the patch.
Edit: interdiff was not meant to be a patch 😟
Comment #16
e0ipsoI merged this because this also fixes the branch tests.
Comment #17
vtcore CreditAttribution: vtcore commentedSorry to reopen this, but after this commit the module cannot be enabled.
The commit adds a version requirement
jsonapi:jsonapi (>=8.x-1.10)
but jsonapi does not have a version specified in its jsonapi.info.yml.Comment #19
e0ipsoThanks for noting that. The version is added by the drupal.org packager.
However, according to: https://www.drupal.org/node/2000204
Hence dropping the version range here and adding a composer.json file.
See commit above.