Skip to content

Conversation

Lainow
Copy link
Contributor

@Lainow Lainow commented Jun 19, 2025

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

Screenshots (if appropriate):

image

@Lainow
Copy link
Contributor Author

Lainow commented Jun 19, 2025

#472

@stonebuzz
Copy link
Contributor

The import process does not complete as expected.
As shown in the screenshot below, the process stops at this stage and does not proceed further:

image

@stonebuzz
Copy link
Contributor

can you adapt form import like this

image

@stonebuzz
Copy link
Contributor

Cancel button should be red and ghost

DL example file should by secondary ghost

Save button seems to be useless here

@Rom1-B Rom1-B self-assigned this Jun 19, 2025
@stonebuzz stonebuzz mentioned this pull request Jun 25, 2025
4 tasks
@Lainow Lainow self-assigned this Jun 25, 2025
@Lainow Lainow requested a review from stonebuzz July 1, 2025 07:31
@stonebuzz stonebuzz force-pushed the feature/glpi-11.0 branch from b6c7675 to a8079e3 Compare July 1, 2025 08:01
composer.json Outdated
Copy link
Contributor

@Rom1-B Rom1-B Jul 15, 2025

Choose a reason for hiding this comment

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

Please add phpstan-glpi:

composer require --dev glpi-project/phpstan-glpi

setup.php Outdated
Comment on lines 247 to 252
function plugin_datainjection_geturl(): string
{
/** @var array $CFG_GLPI */
global $CFG_GLPI;
return sprintf('%s/plugins/datainjection/', $CFG_GLPI['url_base']);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a fan of using a function in this case, because it doesn't make the code easier to read.
What's more, in some cases, you have to use $CFG_GLPI[‘root_doc’] instead of $CFG_GLPI[‘url_base’].

@@ -408,7 +408,7 @@ public static function getBlacklistedOptions($itemtype)
if (in_array($itemtype, $CFG_GLPI["networkport_types"])) {
$raw_options_to_blacklist = array_merge(
$raw_options_to_blacklist,
NetworkPort::rawSearchOptionsToAdd($itemtype)
NetworkPort::rawSearchOptionsToAdd($itemtype) /* @phpstan-ignore-line */
Copy link
Contributor

Choose a reason for hiding this comment

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

Please specify the ignored error in the code comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

Parameter #1 $itemtype of static method NetworkPort::rawSearchOptionsToAdd() expects null, string given.

The function does not use $itemtype and sets a default value, so you can remove it without changing the behavior:

NetworkPort::rawSearchOptionsToAdd()

@@ -68,6 +68,10 @@ function plugin_init_datainjection()
)
);
}
$PLUGIN_HOOKS["config_page"]['datainjection'] = "front/clientinjection.form.php";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
$PLUGIN_HOOKS["config_page"]['datainjection'] = "front/clientinjection.form.php";
$PLUGIN_HOOKS[Hooks::CONFIG_PAGE]['datainjection'] = "front/clientinjection.form.php";

@stonebuzz
Copy link
Contributor

@Lainow can you check for #486

@Rom1-B Rom1-B force-pushed the feature/glpi-11.0 branch from daea3de to b040fa9 Compare August 20, 2025 11:42
@stonebuzz
Copy link
Contributor

@Lainow
can you take a look at #495

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