You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make the plugin compatible with GLPI 11 and 12 - #72
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.
@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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: version1.4.1, minimum GLPI11.0.0, maximum12.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.getDefaultValueItemId()/items_id(GLPI 11) andgetDefaultValuesItemIds()/items_ids(GLPI 12).config_form.html.twig: render the_glpi_csrf_tokenfield only on GLPI 11; GLPI 12 no longer uses CSRF tokens.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