glpi icon indicating copy to clipboard operation
glpi copied to clipboard

Bug in criteria code for "Tickets waiting for your approval" button

Open akindemirci opened this issue 3 months ago • 2 comments

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • [x] I have searched the existing issues

Version

11.0.2

Bug description

There's a bug in criteria code for "Tickets waiting for your approval" button.

$opt['criteria'][1] is a subgroup of criteria, so this is not effective:

            $opt['criteria'][1]['field']      = 59; // validation aprobator

Criteria for "validation aprobator" should be added within the subgroup like this:

            $opt['criteria'][1]['criteria'][0]['field']      = 59; // validation aprobator
            $opt['criteria'][1]['criteria'][0]['searchtype'] = 'equals';
            $opt['criteria'][1]['criteria'][0]['value']      = 'myself'; // Resolved as current user's ID

And therefore, the second criteria in the subgroup should have a link item:

            $opt['criteria'][1]['criteria'][1]['link']       = 'OR';

Relevant log output


Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

No response

Anything else?

No response

akindemirci avatar Nov 25 '25 09:11 akindemirci

Hi,

Could you please open a pull request with your proposal?

cedric-anne avatar Dec 03 '25 16:12 cedric-anne

Hi,

Could you please open a pull request with your proposal?

Here it is: https://github.com/akindemirci/glpi/pull/1

akindemirci avatar Dec 13 '25 11:12 akindemirci

Hi, Could you please open a pull request with your proposal?

Here it is: akindemirci#1

Pull request must be opened on glpi-project/glpi, not on your fork.

trasher avatar Dec 15 '25 06:12 trasher

Sorry, here it is: https://github.com/glpi-project/glpi/pull/22368

akindemirci avatar Dec 15 '25 11:12 akindemirci