Skip to content

Make the plugin compatible with GLPI 11 and 12 - #72

Closed
andrefelipeufcg wants to merge 3 commits into
pluginsGLPI:mainfrom
andrefelipeufcg:glpi-11-12-compatibility
Closed

andrefelipeufcg wants to merge 3 commits into
pluginsGLPI:mainfrom
andrefelipeufcg:glpi-11-12-compatibility

Conversation

@andrefelipeufcg

@andrefelipeufcg andrefelipeufcg commented Oct 20, 2026 •

Copy link
Copy Markdown

Related to #59

GLPI 11 and 12 compatibility

This PR only makes the plugin run on both GLPI 11 and GLPI 12 (bumped to 1.4.1). It contains no translation files; those are in a separate PR (pt_BR translation).

Changes

  • setup.php: version 1.4.1, minimum GLPI 11.0.0, maximum 12.0.99.
  • advancedforms.xml: add a 1.4.1 entry with compatibility >=11.0.0; the 1.4.0 entry is unchanged.
  • TicketReservationRequest: remove the redeclared static properties ($itemtype, $items_id, $rightname) and set the inherited ones during plugin init. These are untyped in GLPI 11 and typed in GLPI 12, so redeclaring them with either form is a fatal error on the other version.
  • Tree cascade dropdown (question type, children controller, text condition handler): handle both getDefaultValueItemId()/items_id (GLPI 11) and getDefaultValuesItemIds()/items_ids (GLPI 12).
  • config_form.html.twig: render the _glpi_csrf_token field only on GLPI 11; GLPI 12 no longer uses CSRF tokens.
  • Reservation calendar (reservation_question.html.twig, ReservationQuestionWidget.js): on GLPI 11 use the core FullCalendar v5 with its stylesheet; on GLPI 12 load the bundled FullCalendar v6.

Validation

  • PHP and JavaScript syntax checks pass.
  • Static check of the APIs against GLPI 11.0.11 and 12.0.0 sources.
  • PHPUnit was not run, and 11.0.0 as the minimum has not been tested.

@Rom1-B
Rom1-B self-requested a review November 9, 2026 12:44
@Rom1-B

Rom1-B commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

@andrefelipeufcg Thanks for the work, but we don't ship a single version for both GLPI 11 and 12: GLPI 11 support lives on the 11.0/bugfixes branch (1.3.x) and main targets GLPI 12 only, so we only maintain one code path per branch.

This change also breaks the plugin on GLPI 12: without the redeclaration, the assignments in setup.php write to the parent's static properties, so CommonGLPI::$rightname becomes 'ticket' for every class that doesn't declare its own. That widens rights checks globally, and 28 tests fail.

I'm closing this one. If you need a fix or feature on GLPI 11, open a PR against 11.0/bugfixes. Translations are managed on Transifex and synced automatically (pt_BR is already on main), so please contribute there rather than through a PR.

@Rom1-B Rom1-B closed this Nov 9, 2026
@andrefelipeufcg
andrefelipeufcg deleted the glpi-11-12-compatibility branch November 9, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants