Closed (fixed)
Project:
Consumer Image Styles
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Mar 2018 at 16:11 UTC
Updated:
14 Apr 2018 at 09:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
pixelwhip commentedSame here. Downgrading jsonapi to 1.13 along with the patch listed in the description worked for me as well.
Comment #3
TikaL13 commentedSame here. Below is the error message I'm receiving:
The website encountered an unexpected error. Please try again later.
ArgumentCountError: Too few arguments to function Drupal\jsonapi\Normalizer\Value\NullFieldNormalizerValue::__construct(), 0 passed in /Users/me/project/SourceCode/web/modules/contrib/consumer_image_styles/src/Normalizer/ImageEntityNormalizer.php on line 127 and exactly 2 expected in Drupal\jsonapi\Normalizer\Value\NullFieldNormalizerValue->__construct() (line 32 of modules/contrib/jsonapi/src/Normalizer/Value/NullFieldNormalizerValue.php).
Comment #4
pavel.bulatI wrote a patch that works for me, but I have very little experience with Drupal. Do a review of this patch please.
Comment #5
pavel.bulatComment #6
skdrupal88Fun, thanks @C5uJI, was just about to publish my own patch too 😃
Attaching it as it might also help.
Attached patch contains workaround fixes and must be reviewed and enhanced by module’s maintainer, use it on your own risk.
Works well to me with following packages:
Also had to upgrade page_manager and simple_oauth to dev versions during migration to 8.5.1 (if it helps someone)
Some more errors I’ve experienced during implementation:
ArgumentCountError: Too few arguments to function Drupal\jsonapi\Normalizer\Value\NullFieldNormalizerValue::__construct(), 0 passed in /var/www/html/web/modules/contrib/consumer_image_styles/src/Normalizer/ImageEntityNormalizer.php on line 127 and exactly 2 expected in Drupal\jsonapi\Normalizer\Value\NullFieldNormalizerValue->__construct() (line 32 of modules/contrib/jsonapi/src/Normalizer/Value/NullFieldNormalizerValue.php).Fatal error: Drupal\jsonapi\Normalizer\Value\FieldItemNormalizerValue and Drupal\Core\Cache\RefinableCacheableDependencyTrait define the same property ($cacheMaxAge) in the composition of Drupal\consumer_image_styles\Normalizer\Value\ImageVariantItemNormalizerValue. However, the definition differs and is considered incompatible. Class was composed in /var/www/html/web/modules/contrib/consumer_image_styles/src/Normalizer/Value/ImageVariantItemNormalizerValue.php on line 15TypeError: Argument 1 passed to Drupal\consumer_image_styles\Normalizer\Value\ImageNormalizerValue::__construct() must implement interface Drupal\jsonapi\Normalizer\Value\ValueExtractorInterface, instance of Drupal\consumer_image_styles\Normalizer\Value\ImageVariantItemNormalizerValue given, called in /var/www/html/web/modules/contrib/consumer_image_styles/src/Normalizer/ImageEntityNormalizer.php on line 108 in Drupal\consumer_image_styles\Normalizer\Value\ImageNormalizerValue->__construct() (line 29 of modules/contrib/consumer_image_styles/src/Normalizer/Value/ImageNormalizerValue.php).Comment #7
skdrupal88By the way, @C5uJI, I can give you a few advices if you don't mind:
1) Better to include issue and comment numbers into the patch name, like this: [project-name]-[description]-[issue-number]-[comment-number].patch
2) Patch should be made from latest dev version of the module
Comment #8
pavel.bulat@skorzh Thanks for the advice, I will try to apply them in practice. =)
Comment #9
e0ipsoWelcome to our community @C5uJI I hope you enjoy it here! Thank you both for the awesome patches. I'll be adding a requirement to have jsonapi 1.14 or older and merge it.
Comment #10
e0ipsoThanks for fixing this!
Comment #13
e0ipsoI created a second commit with credit for @C5uJI to welcome him to our community.