Skip to content

Can't add credit to ticket #256

Description

@cedric-sis

Code of Conduct

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

Is there an existing issue for this?

  • I have searched the existing issues

GLPI Version

11.0.6

Plugin version

1.15.7

Bug description

Hi

I have an AccessDeniedHttpException when trying to add credit to a ticket, even with Super-Admin profile.
Bug is there since 1.15.5.

I think the problem is in ticket.form.php, line 62 (for 1.15.7) as the variable passed to Session::haveAccessToEntity should be the entity id of GLPI and not the voucher id.

if (!Session::haveAccessToEntity($_REQUEST['plugin_credit_entities_id'])) {
    throw new AccessDeniedHttpException();
}

$_REQUEST['plugin_credit_entities_id'] contains plugin_credit_entities table "id" field and not "entities_id" field

If I remove this test, everything works.

The entity test in ticket.php is checking the correct field.

Best regards,

Relevant log output

Page URL

No response

Steps To reproduce

  1. Try to add credit to a ticket

Your GLPI setup information

No response

Anything else?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions