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

Issue fork bibcite-3567728

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

zipymonkey created an issue. See original summary.

zipymonkey’s picture

Status: Active » Needs review
mark_fullmer’s picture

Status: Needs review » Needs work

Thanks 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:

23) Drupal\Tests\bibcite_import\Functional\ImportTest::testPopulateForm with data set "1" ('@article{1,\n title = {Lorem...,\n}\n', 'BibTeX', 'Lorem ipsum dolor sit amet, c... elit.', 1992)
Test code or tested code printed unexpected output:
Deprecated: Drupal\bibcite_entity\ReferenceStorageSchema::getDedicatedTableSchema(): Implicitly marking parameter $entity_type as nullable is deprecated, the explicit nullable type must be used instead in /app/web/modules/contrib/bibcite/modules/bibcite_entity/src/ReferenceStorageSchema.php on line 46

Deprecated: Drupal\bibcite_entity\Plugin\Action\EntitySaveBase::access(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /app/web/modules/contrib/bibcite/modules/bibcite_entity/src/Plugin/Action/EntitySaveBase.php on line 16

Deprecated: Drupal\bibcite_entity\Plugin\Action\EntityDeleteBase::access(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /app/web/modules/contrib/bibcite/modules/bibcite_entity/src/Plugin/Action/EntityDeleteBase.php on line 68

Deprecated: Drupal\bibcite_entity\Plugin\Action\EntityMergeBase::access(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /app/web/modules/contrib/bibcite/modules/bibcite_entity/src/Plugin/Action/EntityMergeBase.php on line 67

/app/web/modules/contrib/bibcite/modules/bibcite_import/tests/src/Functional/ImportTest.php:68

24) Drupal\Tests\bibcite_import\Functional\ImportTest::testSettingsImportForm
Test code or tested code printed unexpected output:
Deprecated: Drupal\bibcite_entity\ReferenceStorageSchema::getDedicatedTableSchema(): Implicitly marking parameter $entity_type as nullable is deprecated, the explicit nullable type must be used instead in /app/web/modules/contrib/bibcite/modules/bibcite_entity/src/ReferenceStorageSchema.php on line 46

Deprecated: Drupal\bibcite_entity\Plugin\Action\EntitySaveBase::access(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /app/web/modules/contrib/bibcite/modules/bibcite_entity/src/Plugin/Action/EntitySaveBase.php on line 16

Deprecated: Drupal\bibcite_entity\Plugin\Action\EntityDeleteBase::access(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /app/web/modules/contrib/bibcite/modules/bibcite_entity/src/Plugin/Action/EntityDeleteBase.php on line 68

Deprecated: Drupal\bibcite_entity\Plugin\Action\EntityMergeBase::access(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /app/web/modules/contrib/bibcite/modules/bibcite_entity/src/Plugin/Action/EntityMergeBase.php on line 67

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/ReferenceAccessTest to fail. I'll create a separate issue for that so it can be dealt with in isolation

mark_fullmer’s picture

Actually, 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.

mark_fullmer’s picture

Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.