cite-php library incompatible with PHP 8.1

Created on 26 November 2022, about 2 years ago
Updated 2 April 2024, 9 months ago

Problem/Motivation

When viewing the citations for a contributor using the Contributor view (bibcite_contributor) if using PHP 8.1, several PHP deprecation warnings are displayed if error reporting all is enabled:
Deprecated function: implode(): Passing null to parameter #1 ($separator) of type array|string is deprecated....

Steps to reproduce

Set PHP to 8.1 and set error reporting to all messages, enable the module and add one or more citations for a contributor then use the view to display them.

Proposed resolution

I don't know how update the academicpuma/citeproc-php library and there is another issue addressing that it is abandoned. But if a site is using cweagans/composer-patches, then the attached patch can be applied to the library by composer with

            "academicpuma/citeproc-php": {
                "PHP 8.1 compatibility fix": "patches/cite-php-implode-php81.patch"
            },

I don't know if it would be appropriate to put the composer-patches and patch into the module composer.json.

Drupal's caches need to be cleared after applying the patch to see the difference.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States greggmarshall Aurora/Denver, Colorado

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024