Skip to content

[GLPI 11] Fatal error during install: Declaration of addField() must be compatible (WebApplications interaction) #1125

@BigBadSheep

Description

@BigBadSheep

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

GLPI Version

11.04

Plugin version

1.23.2

Bug description

I am in the process of migrating from GLPI 10.0.17 to GLPI 11.0.4.
I am trying to install/update the fields plugin from version 1.21.0 to version 1.23.2.

When running the installation command via CLI, the process fails with a PHP Fatal error.
The error indicates a strict typing incompatibility between a generated class for the webapplications plugin (PluginFieldsPluginwebapplicationswebapplicationbsi) and the abstract parent class PluginFieldsAbstractContainerInstance.

It seems the code generator creates an addField method signature that does not match the parent class signature in GLPI 11 / Fields 1.23.2.

I have tried:

  1. Clearing files/_plugins/fields/*.
  2. Clearing GLPI cache (bin/console cache:clear).

Relevant log output

# php bin/console plugin:install fields
Przetwarzanie wtyczki "fields"...
Instalacja tabel MYSQL
PHP Fatal error:  Declaration of PluginFieldsPluginwebapplicationswebapplicationbsi::addField($fieldname, $type, array $options) must be compatible with PluginFieldsAbstractContainerInstance::addField($fieldname, $type, array $options = []) in /var/www/html/glpi/files/_plugins/fields/inc/pluginwebapplicationswebapplicationbsi.class.php on line 57

In pluginwebapplicationswebapplicationbsi.class.php line 57:

  Compile Error: Declaration of PluginFieldsPluginwebapplicationswebapplicationbsi::addField($fieldname, $type, array $options) must be compatible with PluginFieldsAbstractContai
  nerInstance::addField($fieldname, $type, array $options = [])

Page URL

No response

Steps To reproduce

  1. Start with GLPI 10.0.17 with fields (1.21.0) and webapplications plugins installed.
  2. Have a custom field block (e.g., labeled "bsi") attached to the Web Application item type.
  3. Upgrade GLPI to 11.0.4.
  4. Update webapplications plugin to version 5.1.3 (or latest).
  5. Attempt to install/update fields to 1.23.2 via CLI: php bin/console plugin:install fields.

Your GLPI setup information

Operating System: Red Hat Enterprise Linux 8.10 (Ootpa)
Kernel: Linux 4.18.0-553.94.1.el8_10.x86_64
Web Server: Nginx 1.24.0
PHP: 8.2.30 (CLI & FPM)

Plugins list:
WebApplications: 5.1.3
Fields: 1.23.2 (trying to install)
Archimap: v3.3.14
Archires: 1.1.1
Archisw: v3.0.25
Data Injection: 2.15.3
Generic Object: 3.0.2
GLPI Inventory: 1.6.5
My Dashboard: 2.2.4
OCS Inventory NG: 2.1.8
Reservation 3.0.0
Statecheck: v2.4.7
Tasklists: 2.1.6
Typology: 4.0.0

plugins]# ls -la
razem 77564
drwxr-xr-x 16 nginx nginx 4096 02-03 19:14 .
drwxr-xr-x 22 skaneb01 1000 4096 12-04 10:19 ..
drwxr-xr-x 8 nginx nginx 4096 02-02 00:05 archimap
-rwxrwxrwx 1 nginx nginx 56636651 02-01 23:22 archimap-v3.3.14.zip
drwxr-xr-x 6 nginx nginx 107 10-02 09:25 archires
drwxr-xr-x 7 nginx nginx 4096 02-02 00:04 archisw
-rwxrwxrwx 1 nginx nginx 96807 02-01 23:27 archisw-v3.0.25.tar.gz
drwxrwxr-x 11 nginx nginx 4096 12-24 07:28 datainjection
drwxrwxr-x 12 nginx nginx 4096 12-24 07:39 fields
drwxrwxr-x 10 nginx nginx 4096 11-20 08:05 genericobject
-rwxrwxrwx 1 nginx nginx 15516 02-01 23:25 glpi-archires-1.1.1.tar.bz2
-rwxrwxrwx 1 nginx nginx 3070531 02-01 23:29 glpi-datainjection-2.15.3.tar.bz2
-rwxrwxrwx 1 nginx nginx 1437784 02-01 23:31 glpi-fields-1.23.2.tar.bz2
-rwxrwxrwx 1 nginx nginx 2845325 02-01 23:50 glpi-genericobject-3.0.2.tar.bz2
-rwxrwxrwx 1 nginx nginx 1681776 02-01 23:50 glpi-glpiinventory-1.6.5.tar.bz2
drwxrwxr-x 12 nginx nginx 4096 01-08 09:01 glpiinventory
-rwxrwxrwx 1 nginx nginx 8679021 02-01 23:53 glpi-mydashboard-2.2.4.tar.bz2
-rwxrwxrwx 1 nginx nginx 3246651 02-01 23:54 glpi-ocsinventoryng-2.1.8.tar.bz2
-rwxrwxrwx 1 nginx nginx 208661 02-01 23:56 glpi-tasklists-2.1.6.tar.bz2
-rwxrwxrwx 1 nginx nginx 55126 02-01 23:56 glpi-typology-4.0.0.tar.bz2
-rw-r--r-- 1 nginx nginx 160092 02-03 19:10 glpi-webapplications-5.1.3.tar.bz2
-rwxrwxrwx 1 nginx nginx 169389 02-01 21:55 glpi-webapplications-5.1.4.tar.bz2
-rwxrwxrwx 1 nginx nginx 714518 02-01 23:53 'impacts-2.0.8 (1).zip'
drwxr-xr-x 8 nginx nginx 4096 02-01 16:07 mydashboard
drwxrwxr-x 13 nginx nginx 4096 02-01 16:11 ocsinventoryng
drwxr-xr-x 10 nginx nginx 4096 01-06 16:49 reservation
-rwxrwxrwx 1 nginx nginx 239153 02-01 23:54 reservation.zip
drwxr-xr-x 8 nginx nginx 4096 02-02 00:04 statecheck
-rwxrwxrwx 1 nginx nginx 74666 02-01 23:55 statecheck-v2.4.7.tar.gz
drwxr-xr-x 9 nginx nginx 4096 02-01 18:34 tasklists
drwxr-xr-x 9 nginx nginx 4096 10-11 14:15 typology
drwxr-xr-x 9 nginx nginx 4096 12-05 13:07 webapplications

Anything else?

I initially attempted to install WebApplications version 5.1.4, but I encountered installation issues (missing dependencies/composer errors). Consequently, I installed WebApplications version 5.1.3, which works correctly.
The error with the Fields plugin (1.23.2) occurs while WebApplications 5.1.3 is active.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions