Problem/Motivation

The current version is not Drupal 10 compliant. Drupal 9 will be end of life shortly

Is there anyone working on a Drupal 10 version?

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

AvO WebWorks created an issue. See original summary.

danrod’s picture

I am wondering the same, is it possible to be a co-maintainer of this module? I'd like to help releasing a D10 version of this module.

robcarr’s picture

Priority: Normal » Critical

The DEV release appears to support D10, but I'm struggling to upgrade from D9 using the DEV release (which has the various patches applied from #3296634: Automated Drupal 10 compatibility fixes due ti module dependencies

When updating via Composer I have a stream of problems, mostly due to the dependency on renanbr/crossref-client which has a dependency on guzzlehttp/guzzle ^6.2 or ^7.4. In D10 guzzlehttp/guzzle is fixed at ^7.5 by drupal/core

https://github.com/renanbr/crossref-client/blob/main/composer.json list the dependencies, but if I run `composer why guzzlehttp/guzzle` (without being able to download either drupal/bibcite_crossref:2.0.x-dev@dev or renanbr/crossref-client via Composer) I get:

drupal/core 10.1.6 requires guzzlehttp/guzzle (^7.5)
drush/drush 12.4.2 requires guzzlehttp/guzzle (^7.0)
php-http/guzzle7-adapter 1.0.0 requires guzzlehttp/guzzle (^7.0)

(Also tried drupal/core:^10.0)

I can download version 0.1.0 if I run `composer require renanbr/crossref-client` but this is a pre-release version that has no dependencies on Guzzle, so doesn't meet the requirements of bibcite_crossref

Is there anyway to get around the dependency version issue on renanbr/crossref-client or guzzlehttp/guzzle? There appears to be no way to download and install this module in D10 (hence change issue priority to Critical).

robcarr’s picture

Have created an issue at https://github.com/renanbr/crossref-client/issues/18 - with a patch to change the version of guzzle to ^7.5 but I don't seem to be able to use Lenient (https://github.com/mglaman/composer-drupal-lenient) to apply it.

Seems only way forward is to uninstall this module to get site running in D10

robcarr’s picture

Category: Feature request » Bug report

Probably more appropriate to change this to 'Bug report' as the formal release of this module is tied to D9 which has reached end of life, and AFAIK it doesn't appear to be possible to install on D10...

aardwolf’s picture

Category: Bug report » Task
Priority: Critical » Major
robcarr’s picture

Having taken a hit on DOI lookup functionality, I disabled this module to allow the site to be upgraded to D10.1 (and removed from Composer.json).

I'm not able to download the module via Composer:
composer require 'drupal/bibcite_crossref:2.0.x-dev@dev' results in

Your requirements could not be resolved to an installable set of packages.

Problem 1
- cache/array-adapter[1.0.0, ..., 1.0.1] require php ^5.6 || ^7.0 -> your php version (8.1.16) does not satisfy that requirement.
- cache/array-adapter 1.1.0 requires psr/cache ^1.0 -> found psr/cache[1.0.0, 1.0.1] but the package is fixed to 3.0.0 (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.
- cache/array-adapter[1.1.x-dev, ..., 1.2.0] require psr/cache ^1.0 || ^2.0 -> found psr/cache[1.0.0, 1.0.1, 2.0.0] but the package is fixed to 3.0.0 (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.
- renanbr/crossref-client[1.0.0, ..., 1.1.0] require guzzlehttp/guzzle ^6.2 -> found guzzlehttp/guzzle[6.2.0, ..., 6.5.x-dev] but the package is fixed to 7.8.0 (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/bibcite_crossref dev-2.0.x requires renanbr/crossref-client ^1.0 -> satisfiable by renanbr/crossref-client[1.0.0, 1.1.0, 1.1.1].
- drupal/bibcite_crossref 2.0.x-dev is an alias of drupal/bibcite_crossref dev-2.0.x and thus requires it to be installed too.
- renanbr/crossref-client 1.1.1 requires cache/array-adapter ^1.0 -> satisfiable by cache/array-adapter[1.0.0, ..., 1.2.0].
- Root composer.json requires drupal/bibcite_crossref 2.0.x-dev@dev -> satisfiable by drupal/bibcite_crossref[2.0.x-dev (alias of dev-2.0.x)].

Add in dependencies composer require 'drupal/bibcite_crossref:2.0.x-dev@dev' -W results in:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- rtheunissen/guzzle-rate-limiter[v1.0.0, ..., v1.0.1, v2.0.0] require guzzlehttp/guzzle ~6.0 -> found guzzlehttp/guzzle[6.0.0, ..., 6.5.x-dev] but these were not loaded, likely because it conflicts with another require.
- renanbr/crossref-client[1.0.0, ..., 1.1.0] require guzzlehttp/guzzle ^6.2 -> found guzzlehttp/guzzle[6.2.0, ..., 6.5.x-dev] but these were not loaded, likely because it conflicts with another require.
- drupal/bibcite_crossref dev-2.0.x requires renanbr/crossref-client ^1.0 -> satisfiable by renanbr/crossref-client[1.0.0, 1.1.0, 1.1.1].
- drupal/bibcite_crossref 2.0.x-dev is an alias of drupal/bibcite_crossref dev-2.0.x and thus requires it to be installed too.
- renanbr/crossref-client 1.1.1 requires rtheunissen/guzzle-rate-limiter ^1.0 || ^2.0 -> satisfiable by rtheunissen/guzzle-rate-limiter[v1.0.0, v1.0.1, v2.0.0].
- Root composer.json requires drupal/bibcite_crossref 2.0.x-dev@dev -> satisfiable by drupal/bibcite_crossref[2.0.x-dev (alias of dev-2.0.x)].

I also tried deleting composer.lock as it looks like there are circular dependencies, but that's opened up a different can of worms.

Unless it's just me (and it could be, but there are not many users of this module), @AardWolf I'd still say this is a Critical Bug.

robcarr’s picture

Category: Task » Bug report
Priority: Major » Critical

I've just set up a bare D10.1 site (to replicate the problem) and the DEV release cannot be installed with Composer. Same error traces as reported in #7

avo webworks’s picture

I am having the same issues and not able to install this on upgrade to Drupal 10 nor on a bare Drupal 10 site either. Same errors as reported in #7.

uberengineer’s picture

The issue is:
bibcite_crossref 2.0.x-dev requires renanbr/crossref-client ^1.0
renanbr/crossref-client ^1.0 requires rtheunissen/guzzle-rate-limiter ^2.0
rtheunissen/guzzle-rate-limiter ^2.0 requires guzzlehttp/guzzle ^6.0

rtheunissen/guzzle-rate-limiter 3.0 resolves the guzzlehttp/guzzle ^7.0 dependency however renanbr/crossref-client needs updating to reflect this in the dependency chain

I have a review pending that resolves the dependencies https://github.com/renanbr/crossref-client/pull/19

Once this is merged bibcite_crossref can be updated to require the correct version for renanbr/crossref-client

uberengineer’s picture

renanbr/crossref-client pull request merged, Requiring main branch as the module is as of yet not versioned

Forked repo branch "dev-3388342-drupal-10-version" now installs on Drupal core 10.1.6 and MR created

Ready for review/testing

robcarr’s picture

Thanks for your work @uberengineer.

However, I cannot get the module to install via Composer. I've installed Lenient and Composer Patches (see https://github.com/mglaman/composer-drupal-lenient) and tried installing the DEV branch of Bibcite Crossref with the MR applied as a diff patch, but the error traces (as at #7) are still present.

I see your changes are now in the main branch of renanbr/crossref-client so I'm assuming we need to wait until there's a new formal release of crossref-client before installation of bibcite_crossref will work.

avo webworks’s picture

StatusFileSize
new661 bytes

I've uploaded a patch file for now until the merge request is in place. This way @robcarr can test as well.

hxdef’s picture

Status: Active » Fixed
avo webworks’s picture

Great. So I was able to install this on a clean Drupal 10 install but in composer under required:
"drupal/core": "^10.1",
instead of
"drupal/core-recommended": "^10.1",
The core-recommended gave me the composer error:
psr/cache[1.0.0, 1.0.1] but the package is fixed to 3.0.0 (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.

As soon as I moved to core instead of core-recommended I was able to install.
@robcarr this may help you, as I see you were also getting that error message in composer.

Thanks everyone for your work on getting this module working for Drupal 10!!

robcarr’s picture

I still seeing the psr/cache error with the 'core-recommended' clean D10.1 installation.

I'm sceptical about saying that this bug is 'fixed' if it doesn't work with the recommended D10 distribution.

alison’s picture

@AvO WebWorks Is the module working for you in Drupal 10, or just installing cleanly?

@robcarr The psr/cache error you're seeing is during composer tasks, or when actually using the DOI lookup functionality in your site?

I agree that the issue shouldn't be considered "fixed" if we can't use "core-recommended".

-------

But also, when we do all the fiddling to composer-install the latest dev version of this module on a Drupal 10.1 site, we get a WSOD + fatal error when we try to use the DOI Lookup tool, so that's why I'm wondering if the module is really working for you, @AvO WebWork, or is it just composer-installing? I'm not sure if this error we're getting belongs in this thread, a new thread, or the renanbr/crossref-client project, I welcome advice on that front -- I do know that the module definitely isn't working for us on Drupal 10.1 🙂 Here's the fatal error (seen on /admin/content/bibcite/reference/lookup) -- we can re-file elsewhere if necessary, I just didn't want to say "it's not working for us but I'm not going to tell you any details":

Fatal error: Declaration of RenanBr\CrossRefClient\RateLimitProvider::getLastRequestTime() must be compatible with Concat\Http\Middleware\RateLimitProvider::getLastRequestTime(Psr\Http\Message\RequestInterface $request) in /code/vendor/renanbr/crossref-client/src/CrossRefClient/RateLimitProvider.php on line 37
robcarr’s picture

@alison - the error I'm seeing is generated by Composer. I've not tested the module, as it cannot be installed without the various hacks: it is important for this to work on a production site that was recently migrated to D10 (so this site currently has no DOI lookup).
From the WSOD error I'd assume there's an error with the function getLastRequestTime() which must be linked to the class AbstractRateLimitProvider (presumably somewhere in the Guzzle world, but I can't track that down...), which may mean there's an error creeping in because this module's dependencies are now required to support multiple versions.

aardwolf’s picture

Status: Fixed » Active

You're partially right about status of this issue. We applied patch which you suggested with modification. And we installed bibcite crossref to the drupal core 10.
If it's fatal now then the reason in renanbr/crossref-client. We'll make research asap, but you also can make it and suggest another one MR to library.
The reason module can't be installed for recommended version of Drupal is dependency on psr/cache and as result cache/array-adapter. We'll research it too, but the most possible it is issue in core, not in module or library.

aardwolf’s picture

uberengineer’s picture

Created pull request for renanbr/crossref-client https://github.com/renanbr/crossref-client/pull/24
This resolves the error from #21

This patch can be applied in the interim to resolve
https://patch-diff.githubusercontent.com/raw/renanbr/crossref-client/pul...

When commit is merged the commit hash needs to be removed from the composer requirements for renanbr/crossref-client

uberengineer’s picture

StatusFileSize
new433 bytes

Also having this issue
Error: Call to undefined method GuzzleHttp\Utils::json_encode() in Drupal\bibcite_crossref\CrossrefClient->requestRaw()
Which is resolved with 3388342-25.patch

j_ten_man’s picture

Here's how I got this installed via composer on Drupal 10 (10.2.5):

Prerequisites: require cweagans/composer-patches

In your composer.json file, add the following to your "repositories" (before the drupal.org repository):

        {
            "type": "git",
            "url": "https://git.drupalcode.org/issue/bibcite_crossref-3388342.git"
        },
        {
            "type": "git",
            "url": "https://github.com/alvar0hurtad0/cache.git"
        },
        {
            "type": "git",
            "url": "https://github.com/dmlb2000/simple-cache-bridge.git"
        }

Add the following to the "require" section:

        "cache/cache": "dev-patch-1 as 1.2",
        "cache/simple-cache-bridge": "dev-master as 1.2.0",
        "drupal/bibcite_crossref": "dev-3388342-drupal-10-version"

Add the following patches:

           "drupal/bibcite_crossref": {
                "#3388342-25: Fix json_encode call": "https://www.drupal.org/files/issues/2024-04-26/3388342-25.patch"
            },
            "renanbr/crossref-client": {
              "#3388342-24: Fix bad cache check": "https://patch-diff.githubusercontent.com/raw/renanbr/crossref-client/pull/24.patch"
            }

Hopefully the upstream changes are merged soon, but this let me install everything via composer.

toki’s picture

Has anyone managed to install the module and especially to create references under Drupal 10 using the DOI?

Several users are in dire need of this procedure, thank you for any additional information on the installation process through Composer and operation of this critical module for Bibcite.

When trying to require the dev version today (with minimum-stability on dev) on Drupal 10.3.5 :

$ composer require 'drupal/bibcite_crossref:2.0.x-dev@dev'

./composer.json has been updated
Running composer update drupal/bibcite_crossref
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - cache/array-adapter[1.0.0, ..., 1.0.1] require php ^5.6 || ^7.0 -> your php version (8.2.20) does not satisfy that requirement.
    - cache/array-adapter 1.1.0 requires psr/cache ^1.0 -> found psr/cache[1.0.0, 1.0.1] but the package is fixed to 3.0.0 (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.
    - cache/array-adapter[1.1.x-dev, ..., 1.2.0] require psr/cache ^1.0 || ^2.0 -> found psr/cache[1.0.0, 1.0.1, 2.0.0] but the package is fixed to 3.0.0 (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/bibcite_crossref dev-2.0.x requires renanbr/crossref-client dev-main#2e1f52988eca031633823449a92baad3a40f7768 -> satisfiable by renanbr/crossref-client[dev-main].
    - drupal/bibcite_crossref 2.0.x-dev is an alias of drupal/bibcite_crossref dev-2.0.x and thus requires it to be installed too.
    - renanbr/crossref-client dev-main requires cache/array-adapter ^1.0 -> satisfiable by cache/array-adapter[1.0.0, ..., 1.2.0].
    - Root composer.json requires drupal/bibcite_crossref 2.0.x-dev@dev -> satisfiable by drupal/bibcite_crossref[2.0.x-dev (alias of dev-2.0.x)].
toki’s picture

I carefully followed the instructions in comment #26 and launched a composer update -W at the end.
Everything is well installed and I was able to activate Bibcite Crossref under Drupal 10.4.1.

Unfortunately, when I launch a DOI lookup to populate a reference, I get a WSOD and I get the following error:

PHP Fatal error: Declaration of Cache\\Bridge\\SimpleCache\\SimpleCacheBridge::set($key, mixed $value, DateInterval|int|null $ttl = null): bool must be compatible with Psr\\SimpleCache\\CacheInterface::set($key, $value, $ttl = null) in /home/my_website_root/public_html/my_website/vendor/cache/simple-cache-bridge/src/SimpleCacheBridge.php on line 61

toki’s picture

StatusFileSize
new9.17 KB

If I understood correctly (I am not a pure developer but a humble site builder), the tools necessary for Bibcite CrossRef are not compatible with psr/cache version 3.0.

With the assistance of an AI, I tried to modify the files cited by the error messages on the Apache console of my server.

In the end, I was able to modify 6 files following writing constraints of psr/cache v3.0 and I manage to open the DOI lookup import form on Drupal 10 and import a test reference.

Here are the 6 modified files (essentially absence of types for certain functions, parameters and returns):

vendor/cache/cache/src/TagInterop/TaggableCacheItemPoolInterface.php
vendor/cache/cache/src/Adapter/Common/CacheItem.php
vendor/cache/cache/src/Adapter/Common/PhpCachePool.php
vendor/cache/cache/src/Adapter/Common/AbstractCachePool.php
vendor/cache/simple-cache-bridge/src/SimpleCacheBridge.php
vendor/psr/simple-cache/src/CacheInterface.php

See attached files (cache_files_corrected.zip)

If someone could simply look at these changes to get them right, I know AI is probably not the right way to do it but I really need this feature for my clients, so if these modifications can put someone on the right path to finally make this module D10 compatible, I would be really grateful.

Unfortunately the imported data show many problems for the moment, I have many markups everywhere (title, abstract) and the names of contributors are filled with their address too. So if someone can help here to edit the module so it can import data properly from DOI, it would be really great too.

byronveale made their first commit to this issue’s fork.

byronveale’s picture

Status: Active » Needs review
StatusFileSize
new20.97 KB
new21.31 KB

Greetings,

I am reviving this older issue in order to make the module Drupal 10/11 compatible.

According to Claude Opus 4.6:

The renanbr/crossref-client dependency is the biggest problem. The library is pinned to a dev-main commit and hasn't been maintained. It likely has Guzzle or PHP compatibility issues with Drupal 11 (which requires PHP 8.3+).

Recommended fix: Remove the dependency on renanbr/crossref-client and rewrite CrossrefClient.php to use Guzzle directly (similar to how the doi_search module does it).

Including patch and plain diff files for the convenience of devs who would like to test this…

I also would like to inquire about being a co-maintainer of this module.

byronveale’s picture

Pinging to see if anyone following this would be able to take a look at it…

toki’s picture

Thank you for your patch, I am not a maintainer of this module but I am a regular user and my customers clearly need this Crossref tool. So a D10 version then D11 later would be really welcome. I will try to test on my side to see if it works on my environment with a fresh install.

toki’s picture

It works fine!
You may try to contact mark_fullmer or bkosborne, they seem to be the active maintainers on Bibcite globally.

Steps to reproduce to test this patch :

Install drupal ^10.6
Install Bibcite module

composer require drupal/bibcite
drush en bibcite

Add the drupal git repository in composer.json (see comment #26)

{"type": "git",
            "url": "https://git.drupalcode.org/issue/bibcite_crossref-3388342.git"
        }

Then
composer require cweagans/composer-patches
and add the patch in extra composer.json

"patches": {
            "drupal/bibcite_crossref": {
                "Drupal 10/11 compatibility patch": "https://www.drupal.org/files/issues/2026-05-18/3388342-drupal_10_version-31.patch"
            }
        },

Install Bibcite Crossref

composer require drupal/bibcite_crossref
drush en bibcite_crossref

Try to populate reference via DOI lookup and it works perfectly.

byronveale’s picture

Title: Drupal 10 version » Drupal 10/11 version

Thank you for testing!

FWIW, I tested with Drupal 11.3.10, seems to work fine, so updated the title of this issue.

Yes, bkosborne (co-worker) sent me here, so he’s aware.

Paging @adcillc…

byronveale’s picture

For anyone else interested in testing this, FYI I found the patch not applying when following toki’s steps above.

So I added this to composer.json, under repositories:

        "drupal/bibcite_crossref": {
            "type": "git",
            "url": "https://git.drupalcode.org/issue/bibcite_crossref-3388342.git"
        },

Then added bibcite_crossref:

composer require drupal/bibcite_crossref

Which prompted this:

Using version dev-3388342-drupal-10-version for drupal/bibcite_crossref
Version dev-3388342-drupal-10-version looks like it may be a feature branch which is unlikely to keep working in the long run and may be in an unstable state
Are you sure you want to use this constraint (y) or would you rather abort (n) the whole operation [y,n]? y

Finally, I also tested this with Drupal 11.2.12, no issues.

Really finally, watch when commenting, the Fastly test wiped out my comment on reload.

YMMV…

bkosborne’s picture

Status: Needs review » Needs work
bkosborne’s picture

Status: Needs work » Reviewed & tested by the community

Latest MR looks good to me. Tested and confirmed it works as expected.

byronveale’s picture

Status: Reviewed & tested by the community » Fixed

Merged in this update, tested 2.0.x-dev successfully with Drupal 11.2.14 and 11.3.14.

Thanks to all…

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.