Problem/Motivation
There are a number of Deprecation warning in the bibcite_entity module after upgrading to PHP8.4. I am assuming the resolution is similar to https://www.drupal.org/project/bibcite/issues/3555329
Steps to reproduce
- Upgrade to PHP8.4
- Run drush cr
- You will see a number of Deprecation warnings:
PHP Deprecated: Drupal\bibcite_entity\Access\ReferenceAddAccessCheck::access(): Implicitly marking parameter $bibcite_reference_type as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/bibcite/modules/bibcite_entity/src/Access/ReferenceAddAccessCheck.php on line 46
Deprecated: Drupal\bibcite_entity\Access\ReferenceAddAccessCheck::access(): Implicitly marking parameter $bibcite_reference_type as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/bibcite/modules/bibcite_entity/src/Access/ReferenceAddAccessCheck.php on line 46
PHP Deprecated: Drupal\bibcite_entity\ReferenceViewBuilder::__construct(): Implicitly marking parameter $theme_registry as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/bibcite/modules/bibcite_entity/src/ReferenceViewBuilder.php on line 38
Deprecated: Drupal\bibcite_entity\ReferenceViewBuilder::__construct(): Implicitly marking parameter $theme_registry as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/bibcite/modules/bibcite_entity/src/ReferenceViewBuilder.php on line 38
PHP Deprecated: Drupal\bibcite_entity\ReferenceViewBuilder::__construct(): Implicitly marking parameter $entity_display_repository as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/bibcite/modules/bibcite_entity/src/ReferenceViewBuilder.php on line 38
Deprecated: Drupal\bibcite_entity\ReferenceViewBuilder::__construct(): Implicitly marking parameter $entity_display_repository as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/bibcite/modules/bibcite_entity/src/ReferenceViewBuilder.php on line 38
PHP Deprecated: Drupal\bibcite_entity\Form\ReferenceForm::__construct(): Implicitly marking parameter $entity_type_bundle_info as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/bibcite/modules/bibcite_entity/src/Form/ReferenceForm.php on line 30
Deprecated: Drupal\bibcite_entity\Form\ReferenceForm::__construct(): Implicitly marking parameter $entity_type_bundle_info as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/bibcite/modules/bibcite_entity/src/Form/ReferenceForm.php on line 30
PHP Deprecated: Drupal\bibcite_entity\Form\ReferenceForm::__construct(): Implicitly marking parameter $time as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/bibcite/modules/bibcite_entity/src/Form/ReferenceForm.php on line 30
Deprecated: Drupal\bibcite_entity\Form\ReferenceForm::__construct(): Implicitly marking parameter $time as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/bibcite/modules/bibcite_entity/src/Form/ReferenceForm.php on line 30
PHP Deprecated: Drupal\bibcite_entity\Controller\ReferenceViewController::revisionTitle(): Implicitly marking parameter $bibcite_reference_revision as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/bibcite/modules/bibcite_entity/src/Controller/ReferenceViewController.php on line 77
Deprecated: Drupal\bibcite_entity\Controller\ReferenceViewController::revisionTitle(): Implicitly marking parameter $bibcite_reference_revision as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/bibcite/modules/bibcite_entity/src/Controller/ReferenceViewController.php on line 77
Remaining tasks
Resolved the Deprecations
Comments
Comment #3
zipymonkey commentedComment #4
mark_fullmerThanks for reporting this. These do indeed need to be addressed. However, when I run these tests locally, I'm seeing a large number of the same deprecations that have not been addressed in the MR. To give just a few examples:
Complicating this is the fact that a change in Drupal core between 11.2 and 11.3 now is causing
bibcite_entity/tests/src/Kernel/ReferenceAccessTestto fail. I'll create a separate issue for that so it can be dealt with in isolationComment #5
mark_fullmerActually, the issue with the newly failing test was pretty easily cleaned up with https://git.drupalcode.org/project/bibcite/-/commit/39c6bdefd81d5ed806dc... . I've merged that change into the MR. Work can continue with cleaning up the other deprecated nullable calls.
Comment #7
mark_fullmer