Hello,

I am working on the migration of a moderately complex Drupal 7 site to Backdrop that has quite a bit of content using the D7 biblio module. To put things in numbers, the site has 685 nodes, of which 266 are type:biblio.

I was very happy upon finding that there is a (seemingly?) matching Backdrop biblio module, but turns out it does not seem to be compatible (or am I doing something wrong?): If I enable the module, all I get is two messages to the log — First, a warning:

> Warning: Trying to access array offset on value of type bool en biblio_token_info() (line 12  in /var/www/sites_data/bkdrp_proglo/modules/biblio/biblio.tokens.inc).

Immediately followed by an error:

TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given en array_diff_key() (line 12 in /var/www/sites_data/bkdrp_proglo/modules/biblio/biblio.tokens.inc).

 This error happens quite early, upon the first check that biblio_token_info() does on the biblio schema. Lines 10-17 of the mentioned file are:

function biblio_token_info() {  $schema = backdrop_get_schema('biblio');  $fields = array_diff_key($schema['fields'], array('nid' => '', 'vid' => '', 'biblio_formats' => ''));  $node_token['biblio'] = array(    'name' => t('Biblio'),    'description' => t('Tokens related to the Biblio content type.'),    'type' => 'biblio',  );

I am at a loss on how to proceed. I thought about adding a new content type and diving into the DB data, hand-migrating the fields to the matching structure, but it surely looks like a lot of pain... can you help me find a better way out?

Comments

I saw your post on Zulip. Be sure to use the dev version of the module. For some reason the maintainers merged PRs, but haven't done a new release since 2021. It looks like the dev version fixes the issue.

Thank you very much for your help!

I'm replying here as well, to increase the chance this helps somebody else. The recommendation you gave me worked... partially ☹

Using the -dev version results in a site that does not crash (yay!), however, the Biblio module's functionality is yet nowhere to be seen. I enabled the biblio module and updated the datbase («Move biblio settings from variables to config»), and also uninstalled biblio_bibtex, which is not available in Backdrop and my old site used. I can confirm I now have a biblio.settings.json file in my active configuration, with sensible values.

However, I cannot find the module's functionality. The canonical URL for the main listing, /biblio, leads to a "page not found". Creating biblio content request the regular fields I had defined for said content type, but the bibliographic details are missing. I cannot find anything in the configuration for the module, and the views I had defined still complain of "deteriorated or absent handler".

If it helps, I've encountered the same issue as I'm running PHP 8.2. 

I went ahead and edited line 12 of biblio.tokens.inc so it looks like this:

$fields = array_diff_key($schema['fields']??[], array('nid' => '', 'vid' => '', 'biblio_formats' => ''));

This was preventing me from doing anything once I was logged in. Of course this will be overriden next time the maintainers deploy an update but for now this sorts my problem with the array_diff_key() error.