Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I am a drupal site builder and I would like to install entityshare on version 8.7 beta 1 but the required version of jsonapi is limited to version ~ 2.0
Could someone create a patch?
thank you for your help.
Alex
Comment | File | Size | Author |
---|---|---|---|
#11 | entity_share-jsonapi_2_x-3044732-11.patch | 14.47 KB | Grimreaper |
#9 | 3044732.patch | 2.36 KB | borgenk |
Comments
Comment #2
Musa.thomas+1
Comment #3
Antonín Slejška CreditAttribution: Antonín Slejška commentedWe have tried the development version: 8.x-2.x-dev of the entity_share module together with Drupal 8.7.0-beta1. During the installation we receive the following error message:
[php7:notice] [pid 127] [client 10.0.0.26:35908] Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException: The service "entity_share_client.jsonapi_helper" has a dependency on a non-existent service "jsonapi.serializer_do_not_use_removal_imminent". in /var/www/html/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php on line 31 #0 /var/www/html/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(60): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Object(Symfony\\Component\\DependencyInjection\\Reference), false)\n#1 /var/www/html/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(28): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass->processValue(Array, false)\n#2 /var/www/html/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(67): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Array)\n#3 /var/www/html/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(28): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass->processValue(Object(Symfony\\Component\\DependencyInjection\\Definition), true)\n#4 /var/www/html/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(60): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Object(Symfony\\Component\\DependencyInjection\\Definition), true)\n#5 /var/www/html/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(28): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass->processValue(Array, true)\n#6 /var/www/html/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(39): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Array, true)\n#7 /var/www/html/vendor/symfony/dependency-injection/Compiler/Compiler.php(141): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass->process(Object(Drupal\\Core\\DependencyInjection\\ContainerBuilder))\n#8 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(788): Symfony\\Component\\DependencyInjection\\Compiler\\Compiler->compile(Object(Drupal\\Core\\DependencyInjection\\ContainerBuilder))\n#9 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(1346): Symfony\\Component\\DependencyInjection\\ContainerBuilder->compile()\n#10 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(920): Drupal\\Core\\DrupalKernel->compileContainer()\n#11 /var/www/html/core/lib/Drupal/Core/Update/UpdateKernel.php(42): Drupal\\Core\\DrupalKernel->initializeContainer()\n#12 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(476): Drupal\\Core\\Update\\UpdateKernel->initializeContainer()\n#13 /var/www/html/core/lib/Drupal/Core/Update/UpdateKernel.php(65): Drupal\\Core\\DrupalKernel->boot()\n#14 /var/www/html/update.php(28): Drupal\\Core\\Update\\UpdateKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#15 {main}, referer...
Comment #4
Antonín Slejška CreditAttribution: Antonín Slejška commentedDrupal 8.7 is available now. We would like to update our sites, but we use entity_share for synchronization of some content types. Is there any chance, that the entity_share will be updated for JSON API ~2.0 or should we look for some other solution?
Comment #5
Antonín Slejška CreditAttribution: Antonín Slejška commentedIt looks like, the module is no longer developed because of the issue: Provide a supported API for entity denormalization.
Comment #6
OWastQuick fix for this problem:
in your composer.json.
Comment #7
Antonín Slejška CreditAttribution: Antonín Slejška commentedHi Oskar,
if I try:
I get the following conflict:
Comment #8
OWastOkay, unexpected, but I just realised it doesn't help anyway. The service `jsonapi.serializer_do_not_use_removal_imminent` will still be missing so even if you get it to install the site won't run.
EDIT: I also realise I posted my quick fix idea in the wrong issue. Everything was wrong :-)
Comment #9
borgenk CreditAttribution: borgenk commentedHere's a patch for all the necessary changes found so far.
I've never used this module prior to Drupal 8.7 so there might be other issues I've not found and upgrade path from jsonapi contrib to core module is not tested.
Comment #10
GrimreaperHello,
I will update the project page to indicate that the module is not compatible with JSONAPI 2.x and Core 8.7.x.
As mentioned in comment 5, the main problem is to fix the issue #2939827: Provide a supported API for entity denormalization. The composer.json constraint can easily be removed but the module won't work.
Also, thanks for pointing this.
Comment #11
GrimreaperHello,
I am almost to a working state.
Here is a patch. In entity_share/modules/entity_share_client/src/Form/PullForm.php you need to comment:
For this to work, so all the content will be pulled not the selected one. I have asked on the jsonapi channel on Slack if it was still possible to make filter on uuid. I am waiting for a response.
Thanks @borgenk, your patch points me some places to look at. There was still a lot of other places to fix.
Thanks for the review.
Comment #12
GrimreaperI think I found my answer: https://www.drupal.org/node/3015183
I will test and update the patch if it is ok.
Comment #13
GrimreaperWorking ok. Also found other problems.
Will commit soon!
Comment #15
GrimreaperI have made a bunch of commits to separate all the problem founds.
Please test the last dev version.
Comment #16
OWastThanks for working on this!
Running
- drupal/core, 8.7.1
- drupal/entity_share, dev-2.x
I get the following error when pulling content entities to the client.
Comment #17
OWastComment #18
GrimreaperThanks for testing!
I am currently updating ess_test sub-module because I got errors on install.
Would it be possible to have the structure of your entities? And/Or steps to reproduce starting from a fresh Drupal install?
Comment #19
OWastThe least I can do.
We're running this on a pretty complex site, and some of the logic is probably things my client doesn't want me to share. So a complete setup is probably a bad idea. But the entity we're syncing is just a node with these fields:
field_body Text (formatted, long)
field_category Entity reference (taxonomy term)
field_footnote Text (formatted, long)
field_headline Text (plain)
field_image Image
field_members_only Boolean
field_reference Entity reference (node)
field_date Date
field_summary Text (formatted, long)
field_tags Entity reference (taxonomy term)
Comment #20
borgenk CreditAttribution: borgenk commentedThanks for the updates.
It seems to work now with the latest commits.
@OWast: You probably need to apply this Drupal core patch (scheduled for 8.8) https://www.drupal.org/files/issues/2019-04-24/3048348-9.patch due to a bug in the JSONAPI module. See https://www.drupal.org/project/drupal/issues/3048348.
Comment #22
OWastConfirmed. Outstanding!
Comment #23
GrimreaperThanks for the details.
I have pushed an update of the ess_test module that provides a basic structure to test field types. I have no problem except for dynamic entity reference field.
Because in entity_share/modules/entity_share_client/src/Service/JsonapiHelper.php updateRelationships()
For dynamic entity reference fields there is no "related" link only "self". So I will need to update the logic to get related entities. I think that unfortunately will mean more requests and I know that some of our projects suffer from performance due to data volume or complex data structure.
@OWast, I think I got a similar bug on friday when for testing I used devel generate and the entities were not very well generated. Maybe in your app you have some generated entities with missing attributes or a null value where it should not be possible.
Keeping the issue open for dynamic entity reference fix.
Comment #24
GrimreaperThe dynamic entity reference issue has its dedicated issue now: #3056102: Support dynamic entity reference fields.
Thanks all for testing.
I will make an alpha version soon to have more people testing.
Comment #26
GrimreaperComment #29
alexmoreno CreditAttribution: alexmoreno commentedI'm testing with the alpha version 5, and Core 8.7.7
I applied the patch in #20, but the issue is still there:
any feedback on what I'm doing wrong? I am using the default landing page/basic page that comes with Drupal, and a basic taxonomy. All cases fail with that error ^^.
Comment #30
GrimreaperHi,
@alexmoreno, please open a new bug report.
Do you have any special fields, like metatag?
It is really strange that you got errors, now with all the automated tests, standards fields are covered.
Comment #31
alexmoreno CreditAttribution: alexmoreno commentednothing special, just default fields, although I am using Acquia Lightning distribution. Maybe something is going on in the Lightning fields as it adds some extra beef. However I also synced taxonomies, which should have not anything extra, and that failed as well.
I'll open a ticket as suggested and will do some testings today.
Comment #32
srinivas@pennywisesolutions CreditAttribution: srinivas@pennywisesolutions commentedThe same issue is coming for me
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /batch?id=12&op=do_nojs&op=do
StatusText: OK
ResponseText: Error: Call to a member function getClass() on null in Drupal\jsonapi\Normalizer\FieldItemNormalizer->denormalize() (line 130 of /app/docroot/core/modules/jsonapi/src/Normalizer/FieldItemNormalizer.php).
Comment #33
alexmoreno CreditAttribution: alexmoreno commentedto be clear, the error I was getting was a problem with my own setup, I should have updated that @Grimreaper helped finding that out.
If you have a different field between server and client, when the client tries to pull those fields it will crash and show that 200 error. I would recommend you to simplify your setup as much as you can (less fields) and start adding from there so you can find what's going on.
I wonder if some debugging or better messaging could be added here, like instead of the
Call to a member function getClass() on null
something more descriptive or that could even point to what field is exactly crashing. Just thinking out loud
Comment #34
srinivas@pennywisesolutions CreditAttribution: srinivas@pennywisesolutions commentedHi Team,
Yes we are using metatag may that is the reason we are getting the below error
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /batch?id=12&op=do_nojs&op=do
StatusText: OK
ResponseText: Error: Call to a member function getClass() on null in Drupal\jsonapi\Normalizer\FieldItemNormalizer->denormalize() (line 130 of /app/docroot/core/modules/jsonapi/src/Normalizer/FieldItemNormalizer.php).
Please suggest us anyway to resolve this issue.
Comment #35
srinivas@pennywisesolutions CreditAttribution: srinivas@pennywisesolutions commentedHi Team,
Yes we are using metatag may that is the reason we are getting the below error
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /batch?id=12&op=do_nojs&op=do
StatusText: OK
ResponseText: Error: Call to a member function getClass() on null in Drupal\jsonapi\Normalizer\FieldItemNormalizer->denormalize() (line 130 of /app/docroot/core/modules/jsonapi/src/Normalizer/FieldItemNormalizer.php).
Please suggest to us anyway to resolve this issue.
Comment #36
Grimreaper@svsrinivas2, please see the dedicated issue to Metatag support #3060702: Compatibility with Metatag Fields and the updated README.txt file and project description.
This issue is closed, so it is not advised to post comment on it.
Comment #37
hazra.bhaskar CreditAttribution: hazra.bhaskar commentedhave any update on this issue