- ๐บ๐ธUnited States rishi kulshreshtha
Further improvement is required as I can still see errors even after implementing the most recent patch.
================================================================================ Field Collection, -- Scanned on Mon, 05/29/2023 - 13:36 FILE: modules/contrib/field_collection/src/Entity/FieldCollectionItem.php STATUS LINE MESSAGE -------------------------------------------------------------------------------- Check manually 294 Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked. -------------------------------------------------------------------------------- FILE: modules/contrib/field_collection/tests/src/FunctionalJavascript/FieldCollectionA jaxTest.php STATUS LINE MESSAGE -------------------------------------------------------------------------------- Check manually 15 Drupal\Tests\BrowserTestBase::$defaultTheme is required. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use. -------------------------------------------------------------------------------- FILE: modules/contrib/field_collection/field_collection.info.yml STATUS LINE MESSAGE -------------------------------------------------------------------------------- Check manually 0 Value of core_version_requirement: ^8 || ^9 is not compatible with the next major version of Drupal core. See https://drupal.org/node/3070687. --------------------------------------------------------------------------------
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 2:13pm 29 May 2023 - Status changed to RTBC
over 1 year ago 3:47pm 30 May 2023 - ๐ฎ๐ณIndia Bushra Shaikh
I have reviewed and checked the patch #7 this works for drupal 9.5 and drupal 10.0. and 10.0.1
Screenshots of the compatibility on 9.5 have been attached for reference: - @arti_parmar opened merge request.
- ๐ฉ๐ฐDenmark blymemikkel Copenhagen
blyme โ made their first commit to this issueโs fork.
Added
- public function normalize($field_item, $format = NULL, array $context = []) { + public function normalize($field_item, $format = NULL, array $context = []): array|string|int|float|bool|\ArrayObject|NULL {
- ๐ท๐ดRomania sethy
Hello,
We have a situation for one of the sites of our clients. The current version of Drupal for the site is 9.5.8 and we have installed:
- Field collection (version 8.x-1.0-alpha1)
- Field Collection Views (version 8.x-5.0)Most of the content of the site is depending on these modules and rewriting the code of the site is not a solution for us at the current time because we are talking about 3-5 weeks of development.
We would like to update the site's Drupal version to 10.x and we need your help if we can do it or how to do it.
Please let us know if you require additional information, thanks!
- ๐ฌ๐งUnited Kingdom Tom M Fallon
I've noticed the following issue.
> [notice] Update started: block_content_post_update_sort_permissions
> [13-Oct-2023 08:55:50 UTC] PHP Fatal error: Declaration of Drupal\field_collection\Normalizer\FieldCollectionItemNormalizer::normalize($field_item, $format = null, array $context = []) must be compatible with Drupal\serialization\Normalizer\ComplexDataNormalizer::normalize($object, $format = null, array $context = []): ArrayObject|array|string|int|float|bool|null in /var/www/html/docroot/modules/contrib/field_collection/src/Normalizer/FieldCollectionItemNormalizer.php on line 23
> [warning] Drush command terminated abnormally.I suspect it is similar to https://www.drupal.org/project/dynamic_entity_reference/issues/3350347 ๐ Declaration of DynamicEntityReferenceItemNormalizer::normalize() must be compatible Needs review
Setting back to needs work. I'm likely to patch this.
- Status changed to Needs work
about 1 year ago 8:57am 13 October 2023 - ๐ฌ๐งUnited Kingdom Tom M Fallon
Apologies entierly in error. This has already been fixed but I hadn't properly read the above comments. Knocking pack to reviewed & tested as it works.
Sorry again!
- Status changed to RTBC
about 1 year ago 9:06am 13 October 2023 - ๐ฎ๐ณIndia radheymkumar Jaipur, Rajasthan, India
Hi
I have tested this patch is working with drupal 10
Thanks - ๐ฉ๐ชGermany jan kellermann
Thank you for your work. This version works for us.
- ๐ซ๐ทFrance erwangel
Can not apply #11 because of info.yml is patched for core version requirements (4.0.x-dev requires D9 is patched for D10)
See @ https://www.drupal.org/project/drupalorg/issues/3066468 ๐ Packaging info from .info.yml often creates conflicts when patching (ddo) Active
Is there any other option than manual patching ? - ๐ฌ๐งUnited Kingdom RogerB Greenwich, London
@erwangel
I managed to get composer to install drupal/field_collection": "dev-4.0.x with patch #17.
First I added an explicit requirement for drupal/core 10.1.6 aliased as 9.5.11 to the required section of composer.json.
"require": { ... "drupal/core": "10.1.6 as 9.5.11", "drupal/core-composer-scaffold": "^10.0.0", "drupal/core-recommended": "^10.0.0", ... }
... and then ran composer update drupal/core.
Then I added the patch to my composer.json:
"extra": { ... "patchLevel": { "drupal/core": "-p2" }, "enable-patching": true, "patches": { "drupal/field_collection": { "3297187 - Automated Drupal 10 compatibility fixes": "https://www.drupal.org/files/issues/2023-10-25/field_collection_for_drupal10.patch" } } }
Then ran composer require 'drupal/field_collection:dev-4.0.x'.
Puzzled over this for a couple of days. Not a well documented solution to the problem of installing D9 modules patched for D10.
- ๐ซ๐ทFrance erwangel
Thank you RogerB for your quick answer. However I still have a problem reported by composer
- Root composer.json requires drupal/field_collection dev-4.0.x -> satisfiable by drupal/field_collection[dev-4.0.x].
- drupal/field_collection dev-4.0.x requires drupal/core ^8 || ^9 -> found drupal/core[8.0.0-beta6, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev] but it conflicts with your root composer.json require (10.1.6 as 9.5.11).My question is
1 - should I try it with the option --with-all-dependencies, and in such case is there any risk to import update dependencies to D9.5.11 for other parts/modules that are properly running as D10 compatible ?
2- do I have to remove the line "drupal/core": "10.1.6 as 9.5.11" after installation in order to avoid other modules being downloaded with a D9 version ? - ๐ฌ๐งUnited Kingdom RogerB Greenwich, London
@erwangel
When I developed my fix described in #20 ๐ Automated Drupal 10 compatibility fixes RTBC comment #18 had not been posted.
Using mglaman/composer-drupal-lenient is a much better solution than aliasing the core version. You can target only the package for which you want composer to ignore the core version constraints. This also addresses the concerns you expressed above.
I have tested this and if works fine with patch at #11 ๐ Automated Drupal 10 compatibility fixes RTBC . The patch at #17 does not actually patch the module's info file for D10!
- ๐ซ๐ทFrance erwangel
I couldn't install it event with #11 + mglaman/composer-drupal-lenient. "composer.json" was correctly updated with the
composer config --merge --json extra.drupal-lenient.allowed-list '["field_collection"]' instruction
but the composer require gave the following error:Problem 1
- drupal/field_collection dev-4.0.x requires drupal/core ^8 || ^9 -> found drupal/core[8.0.0-beta6, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev] but the package is fixed to 10.1.6 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- drupal/field_collection 4.0.x-dev is an alias of drupal/field_collection dev-4.0.x and thus requires it to be installed too.
- Root composer.json requires drupal/field_collection 4.0.x-dev@dev -> satisfiable by drupal/field_collection[4.0.x-dev (alias of dev-4.0.x)].I then tried to remove composer.lock and install mglaman/composer-drupal-lenient globally as indicated on its page but this doesn't seem to be the road as it gave a huge list of require incompatibilities. I finally ported the patch modifications manually and installed the module without composer.
- ๐บ๐ฆUkraine _shy Ukraine, Lutsk ๐บ๐ฆ
Hi @erwangel
Please, check if you allowed a lenient plugin in
composer.json
file.It could be done with the following command:
composer config --no-plugins allow-plugins.mglaman/composer-drupal-lenient true
- ๐บ๐ฆUkraine pingwin4eg Zaporizhia ๐บ๐ฆ
@radheymkumar What's the purpose of the patch you uploaded? If I understand correctly, there are only changes to field_collection.api.php and tests (from the patch #11).
- ๐ซ๐ทFrance erwangel
Hi @_shY,
Still no chance, with your command composer.json was indeed update to allow lenient but still compatibility errors:Problem 1
- Root composer.json requires drupal/field_collection dev-4.0.x -> satisfiable by drupal/field_collection[dev-4.0.x].
- drupal/field_collection dev-4.0.x requires drupal/core ^8 || ^9 -> found drupal/core[8.0.0-beta6, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev] but the package is fixed to 10.1.7 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
In my composer I have :
"require": { "mglaman/composer-drupal-lenient": "^1.0" ... }, "minimum-stability": "dev", "prefer-stable": true, "config": { "allow-plugins": { "mglaman/composer-drupal-lenient": true ... }, }, "extra": { "patchLevel": { "drupal/core": "-p2" }, "patches": { "drupal/field_collection": { "3297187-11 - Automated Drupal 10 compatibility fixes": "https://www.drupal.org/files/issues/2023-09-13/field_> } }, "drupal-lenient": { "allowed-list": ["field_collection"] } } ...
Well, this is no more a real problem as I could proceed with a manual patching and installation but just trying to understand why lenient is not working to do it the composer way...
- ๐บ๐ฆUkraine _shy Ukraine, Lutsk ๐บ๐ฆ
@erwangel
Two more things that I want to check about your situation.
1. I hope you apply patch from the comment #11 ๐ Automated Drupal 10 compatibility fixes RTBC .
2. You need to change the allowed list setting. It should be
drupal/field_collection
. Like this one:"drupal-lenient": { "allowed-list": ["drupal/field_collection"] }
- ๐ซ๐ทFrance erwangel
@_shY,
1. yes, it is patch from #11
2. As you can see below, it works after your correction!["drupal/field_collection"] not ["field_collection"]
From the composer require print out:
- Installing drupal/field_collection (dev-4.0.x 81ea688): Cloning 81ea6884dc from cache
- Applying patches for drupal/field_collection
https://www.drupal.org/files/issues/2023-09-13/field_collection-3297187-... โ (3297187-11 - Automated Drupal 10 compatibility fixes)Thanks @_shY and @RogerB for all your guidance!!!
I get an error with patch from #11
an accessCheck is missing in field_collection_field_storage_config_delete- ๐ฆ๐นAustria drupalfan2
Patch #11 helped me to get this module work with Drupal 10.
- ๐บ๐ฆUkraine ankondrat4 Lutsk
+1 RTBC for MR6.
It works as expected on Drupal 10. - First commit to issue fork.
- ๐ฉ๐ชGermany jan kellermann
In D10.2 was with #1038316 โ a new "Removed" button introduced which destroys the field collection widget. There is no change record for this change.
The main problem seems a naming collision, I changed the name of remove-button.
The issue #3421903 โ has the same problem with two buttons and i adapted the patch.
I added also the missing accessCheck from comment #29.
I added these changes to the patch #11.