-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix(RuleRight): remove useless fields for RuleRight Form #21180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 11.0/bugfixes
Are you sure you want to change the base?
Conversation
I do not know if those fields are used or not, but they were present before Twig migration |
It seems that they were used only in a specific case: The condition on |
src/RuleRight.php
Outdated
'match_operators' => $this->getRulesMatch(), | ||
'conditions' => static::getConditionsArray(), | ||
'rand' => mt_rand(), | ||
'short' => true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should only be the "short" form in the context of the Rules tab in the Entity form I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See @cconard96 comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand, to restore the behaviour of GLPI 10.0, you have to invert conditions. Also, the variable name is ambiguous, so it should be renamed.
73478ec
to
b8713bb
Compare
@cedric-anne variable name is still |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, the required changes could be more complex.
Before #17203, the rules forms displayed in the entity tab were processed by the Entity::executeAddRule()
method. This is no longer the case. Maybe it should be restored, but I do not really know how it is supposed to work.
I reverted, it is used elsewhere. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The form in the context of Entities is still broken functionally. I don't really understand the usability of the extra fields, but any RuleRight created from here is done with no criteria or actions.
Checklist before requesting a review
Please delete options that are not relevant.
Description
Since the UI refactor of rules:
#17203
The form for authorization rules contains two additional fields that do not work and do not appear to be used. Their presence in this location seems rather odd.
An initial inconsistency had been detected and fixed here:
https://github.com/glpi-project/glpi/pull/19656/files#diff-186234e2e73b65f55a4e8779745ad83d0863119d64b860b3f80260509049f3d0
However, these two fields are now displayed systematically.
Screenshots (if appropriate):