Php 8.1 TypeError

Created on 1 March 2024, 9 months ago
Updated 20 March 2024, 8 months ago

Problem/Motivation

After upgrading php to 8.1 biblio returns this error:
TypeError: Cannot access offset of type string on string in theme_biblio_page_number() (line 717 of ../sites/all/modules/biblio/includes/biblio_theme.inc).

Steps to reproduce

Upgrade php to 8.1, follow site/biblio

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΏπŸ‡¦South Africa breck

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

Comments & Activities

  • Issue created by @breck
  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    I suspect the problem is at line 374 of biblio_style_vancouver.inc. theme_biblio_page_number() should not be called directly. It should be called via theme() like it is on line 376 or at least have it param be an array with the keys required by theme_biblio_page_number().

    The comment about formatPageInfo() doesn't make any sense. I suspect that this line has been changed at some point. I suggest using git blame to find out the history of this code.

    Bug reports are always against the development branch.

  • πŸ‡ΏπŸ‡¦South Africa breck

    Thanks. Changing the default style (away from Vancouver) gets rid of the fatal error.

Production build 0.71.5 2024