backdrop-contrib / biblio

Manage and display lists of scholarly publications. Import from Zotero.
GNU General Public License v2.0
0 stars 5 forks source link

array_diff_key() and invalid argument supplied for foreach() #4

Closed quinnanya closed 1 month ago

quinnanya commented 3 years ago

I'm getting this error message on many of the administration pages with Biblio on a site upgraded from D7. Currently running Backdrop 1.17.3:

Warning: array_diff_key(): Argument #1 is not an array in biblio_token_info() (line 12 of /home/modernis/backdropv2.modernistarchives.com/modules/biblio/biblio.tokens.inc).
Warning: Invalid argument supplied for foreach() in biblio_token_info() (line 18 of /home/modernis/backdropv2.modernistarchives.com/modules/biblio/biblio.tokens.inc).
olafgrabienski commented 3 years ago

Confirmed: I see these messages in DBlog of a quite fresh Backdrop site (no D7 upgrade).

jenlampton commented 3 years ago

I'm getting this error message on many of the administration pages with Biblio

Biblio itself doesn't have any administration pages (since it now uses nodes and feeds and other existing Backdrop tools). Can you be more specific as to where you are seeing these errors? (URLs would be ideal)

quinnanya commented 3 years ago

Here's one of the pages, and a screenshot: /admin/structure/taxonomy/biblio_pub_type/add

Screen Shot 2021-02-07 at 10 15 56 PM
olafgrabienski commented 3 years ago

@jenlampton The warnings were on regular admin pages (not specific to Biblio), e.g. admin/modules or admin/structure/types.

jenlampton commented 3 years ago

Thanks! this is really helpful :) Looks like maybe the problem is with Biblio tokens, I'll start there :)

jenlampton commented 6 months ago

This fix was merged and can be seen in 2095dbd6. Closing.

irinaz commented 6 months ago

@jenlampton , I installed module Biblio on core 1.26 and I am getting the following error on php8.1.
Module installs on php7 with warning message

Error
Error message
Warning: Trying to access array offset on value of type bool in biblio_token_info() (line 12 of /Users/irinazaks/Sites/localhost/4-fibo/modules/biblio/biblio.tokens.inc).
TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given in array_diff_key() (line 12 of /Users/irinazaks/Sites/localhost/4-fibo/modules/biblio/biblio.tokens.inc).
Dismissarray_diff_key(): Argument #1 ($array) must be of type array, null given
irinaz commented 6 months ago

@jenlampton , is it possible that there is no release that includes this bug fix?

jenlampton commented 1 month ago

@irinaz You can tell by looking at the merge date (Feb 19, 2024) and then the latest release date Feb 6, 2021. Or, by testing the -dev version.

Looks like it's time for a new release! I'm going to review the queue and will see what else we can get fixed. Closing again.