Skip to content

fix: Steps in tutorial that were outdated#215

Open
jdurand-teclib wants to merge 3 commits into
glpi-project:masterfrom
jdurand-teclib:chore/enhancement-suggestions
Open

fix: Steps in tutorial that were outdated#215
jdurand-teclib wants to merge 3 commits into
glpi-project:masterfrom
jdurand-teclib:chore/enhancement-suggestions

Conversation

@jdurand-teclib

Copy link
Copy Markdown

This fix proposition aims to change some parts of the tutorial that are outdated. The changes are mostly about some files that are no longer needed due to new templates or automatic actions made into GLPI's core, some parts of the code that now work differently, or some code pieces that were no longer passing the linters.

Here is a sum up:

  • In the "Common actions on a object" part:
    • Removed the instruction to create the superasset.form.php file, as standard CRUD actions are automaticaly handled by CommonDBTM class. The example content of the file remains in the doc, so the user can see what it would look like if he needed to create a file to handle specific actions.
  • In the "Hooks" part:
    • The "MENU_TOADD" hook was not documented in the hooks page.
    • The hook example for the ITEM_ADD was using an array of parameter, but this hook is called with an item as parameter, so the callback method was not reached. I updated the code to make this hook called with an item as parameter.
  • In the "Importing libraries (Javascript/CSS)" part:
    • The second exercise was asking to create a button that already exists. I updated it to make simply change the appearance of the button.
    • The tutorial was asking to create a file named "ticket.js.php", but this file naming practice is no longer at use in our coding standards. I changed the file name to "ticket.js"
    • The provided template for common.js and ticket.js was not passing the ESLint, during the CI jobs. I updated it to make it pass the linter.
  • In the "Notifications" part:
    • A code template was making the user display a "Submit" button in the method "showMassiveActionsSubForm", which is no longer required, as the template in which this template adds content already displays a Submit button.
    • A warning about the setup of a SMTP server was displayed, recommanding to install mailhog or mailcatcher. This warning is no longer needed, as the docker environment provides a mailpit already setup.

@Rom1-B
Rom1-B requested review from Rom1-B and RomainLvr July 20, 2026 14:29
@cedric-anne
cedric-anne requested a review from SebSept July 20, 2026 14:35
Comment thread source/plugins/hooks.rst Outdated
Comment thread source/plugins/tutorial.rst Outdated
Comment thread source/plugins/tutorial.rst
Comment thread source/plugins/tutorial.rst Outdated
Comment thread source/plugins/tutorial.rst Outdated
Comment thread source/plugins/tutorial.rst
Comment thread source/plugins/tutorial.rst

@SebSept SebSept left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contribution :)
I did not run the code.
The comment about mailing utility is needed for me.

(and yes a doc about docker is needed too, but that's another work).

Comment thread source/plugins/tutorial.rst
Comment thread source/plugins/tutorial.rst
@SebSept
SebSept self-requested a review July 21, 2026 09:29
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.

4 participants