- Issue created by @project update bot
This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.
It is important that any automated tests available are run and that you manually test the changes.
Drupal 11 Compatibility
According to the Upgrade Status module → these changes make this module compatible with Drupal 11! 🎉
Therefore these changes update theinfo.yml
file for Drupal 11 compatibility.Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot → to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.
Debug information
Bot run #11-318179These packages were used to generate the fixes:
- drupal/upgrade_status: 4.3.6
- mglaman/phpstan-drupal: 1.3.1
- palantirnet/drupal-rector: 0.20.3
- Status changed to Needs review
about 1 month ago 10:34am 10 April 2025 - 🇮🇳India flutterstack
#2 is works fine.
In number #5 I have updated README.md file. kindly review and merge the code. thank you.
- 🇨🇦Canada alberto56
@flutterstack thanks! The patch works if I get the code via git, however if I use composer to get 1.0.0, or if I donwload the tar.gz, the Drupal package manager adds some extra code to the info file, causing the patch to fail:
[root@VM2401-001 entity_back_reference]# cat entity_back_reference.info.yml name: Entity Back Reference type: module description: 'Backtracks the entities referenced in other entity' package: Entity Back Reference core_version_requirement: ^9 || ^10 # version: '1.0.0' # project: 'entity_back_reference' # datestamp: 1722608384 # Information added by Drupal.org packaging script on 2024-08-05 version: '1.0.0' project: 'entity_back_reference' datestamp: 1722877289 [root@VM2401-001 entity_back_reference]# curl -O https://www.drupal.org/files/issues/2025-04-10/3482928-automated-drupal-11-compatibility-and-readme-update.patch % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2282 100 2282 0 0 13423 0 --:--:-- --:--:-- --:--:-- 13423 [root@VM2401-001 entity_back_reference]# patch -p1 < 3482928-automated-drupal-11-compatibility-and-readme-update.patch patching file README.md patching file entity_back_reference.info.yml Hunk #1 FAILED at 2. 1 out of 1 hunk FAILED -- saving rejects to file entity_back_reference.info.yml.rej
Could you please make a version of the patch which applies to version 1.0.0 if it is downloaded via tar.gz or composer? Thanks!
- 🇮🇳India flutterstack
Steps I have followed
download entity_back_reference-1.0.0 tag zip from entity_back_reference module releases page.
wget https://ftp.drupal.org/files/projects/entity_back_reference-1.0.0.zip
unzip entity_back_reference-1.0.0.zip file in in web/modules/custom/ folder
deprecation check
------# php vendor/bin/drupal-check -d web/modules/custom/entity_back_reference Deprecated: The drupal_root parameter is deprecated. Remove it from your configuration. Drupal Root is discovered automatically. in /var/www/html/vendor/mglaman/phpstan-drupal/src/Drupal/DrupalAutoloader.php on line 94 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% [OK] No errors Thanks for using drupal-check! Consider sponsoring the development of the maintainers which make drupal-check possible: - phpstan (ondrejmirtes): https://github.com/sponsors/ondrejmirtes - phpstan-deprecation-rules (ondrejmirtes)): https://github.com/sponsors/ondrejmirtes - phpstan-drupal (mglaman)): https://github.com/sponsors/mglaman - drupal-check (mglaman)): https://github.com/sponsors/mglaman
Run the entity_back_reference 1.0.0 tag for analysis:
aea110c218f7:/var/www/html# php vendor/bin/drupal-check -a web/modules/custom/entity_back_reference Deprecated: The drupal_root parameter is deprecated. Remove it from your configuration. Drupal Root is discovered automatically. in /var/www/html/vendor/mglaman/phpstan-drupal/src/Drupal/DrupalAutoloader.php on line 94 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% ------ -------------------------------------------------------------------------------------- Line src/Services/BackReferenceFinder.php ------ -------------------------------------------------------------------------------------- 40 Property Drupal\entity_back_reference\Services\BackReferenceFinder::$backReferenceFields type has no value type specified in iterable type array. 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type 47 Property Drupal\entity_back_reference\Services\BackReferenceFinder::$backReferenceEntityIds type has no value type specified in iterable type array. 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type 82 Property Drupal\entity_back_reference\Services\BackReferenceFinder::$entityQuery (Drupal\Core\Entity\Query\Sql\QueryFactory) does not accept Drupal\Core\Entity\Query\QueryInterface. 131 Left side of && is always true. 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your /tmp/drupal_check_phpstan_1744386558.neon. ------ -------------------------------------------------------------------------------------- [ERROR] Found 4 errors Thanks for using drupal-check! Consider sponsoring the development of the maintainers which make drupal-check possible: - phpstan (ondrejmirtes): https://github.com/sponsors/ondrejmirtes - phpstan-deprecation-rules (ondrejmirtes)): https://github.com/sponsors/ondrejmirtes - phpstan-drupal (mglaman)): https://github.com/sponsors/mglaman - drupal-check (mglaman)): https://github.com/sponsors/mglaman
- 🇮🇳India flutterstack
kindly try to apply patch #8 on entity_back_reference-1.0.0 tag and review
- 🇮🇳India flutterstack
I have tried to apply patch #8 on
download entity_back_reference-1.0.x branch code zip from entity_back_reference module releases page.
wget https://ftp.drupal.org/files/projects/entity_back_reference-1.0.x-dev.zip
unzip entity_back_reference-1.0.x-dev.zip file in in web/modules/custom/ folder
try to apply patch #8
# patch -p1 < 3482928-automated-drupal-11-compatibility-and-readme-update-tag-1.0.0.patch patching file README.md patching file entity_back_reference.info.yml Hunk #1 FAILED at 2. 1 out of 1 hunk FAILED -- saving rejects to file entity_back_reference.info.yml.rej patching file src/Services/BackReferenceFinder.php
patch was failed because in entity_back_reference.info.yml of 1.0.x-dev code we have version: '1.0.x-dev' hence patch failed.
kindly apply #9 on entity_back_reference-1.0.x and review .
thank you
- 🇨🇦Canada alberto56
Still does not work for me.
If I remove this:
-# version: '1.0.0' -# project: 'entity_back_reference' -# datestamp: 1722608384 - -# Information added by Drupal.org packaging script on 2024-08-05
from the patch at #9, then it works.
Here is a new patch
- 🇨🇦Canada alberto56
Here is a new version of the patch; I had mistakenly changed ^9 || ^10 for ^9 || ^11; in this version it's ^10 || ^11