Skip to content

Conversation

@tograss
Copy link

@tograss tograss commented Sep 30, 2025

Checklist before requesting a review

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
    The added code is covered by existing tests. If you need more tests for this Feature could you advise where to place them ?
  • This change requires a documentation update.

Description

  • It fixes Log from which position a user is removed #21059
    This pull requests does two things:
    It adds recording to which position an Actor is assigned for problems and changes.
    It adds recording when a user is removed from a position for tickets, problems and changes.

@cedric-anne
Copy link
Member

The added code is covered by existing tests. If you need more tests for this Feature could you advise where to place them ?

If there are existing tests testing the produced logs entries, please indicate their class/method name, so we can check them. Otherwise, you should add tests for each impacted class and you can see how it is done in the Profile_UserTest::testLogOperationOnAddAndDelete() test method.

@cedric-anne cedric-anne added this to the 11.0.2 milestone Oct 7, 2025
}

// Values from CommonITILObject::getSearchOptionsActors()
if (static::$itemtype_2 === 'User') {
Copy link
Contributor

@trasher trasher Oct 27, 2025

Choose a reason for hiding this comment

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

Suggested change
if (static::$itemtype_2 === 'User') {
if (static::$itemtype_2 === User::class) {

case CommonITILActor::ASSIGN:
return 5;
}
} elseif (static::$itemtype_2 === 'Group') {
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
} elseif (static::$itemtype_2 === 'Group') {
} elseif (static::$itemtype_2 === Group::class) {

case CommonITILActor::ASSIGN:
return 8;
}
} elseif (static::$itemtype_2 === 'Supplier') {
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
} elseif (static::$itemtype_2 === 'Supplier') {
} elseif (static::$itemtype_2 === Supplier::class) {

}

$current_log_option = $this -> _force_log_option;
$this -> _force_log_option = $this -> get_force_log_option();
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
$this -> _force_log_option = $this -> get_force_log_option();
$this->_force_log_option = $this->get_force_log_option();

$current_log_option = $this -> _force_log_option;
$this -> _force_log_option = $this -> get_force_log_option();
parent::post_addItem();
$this -> _force_log_option = $current_log_option;
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
$this -> _force_log_option = $current_log_option;
$this->_force_log_option = $current_log_option;

$current_log_option = $this -> _force_log_option;
$this -> _force_log_option = $this -> get_force_log_option();
parent::post_deleteFromDB();
$this -> _force_log_option = $current_log_option;
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
$this -> _force_log_option = $current_log_option;
$this->_force_log_option = $current_log_option;

Comment on lines +215 to +216
$current_log_option = $this -> _force_log_option;
$this -> _force_log_option = $this -> get_force_log_option();
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
$current_log_option = $this -> _force_log_option;
$this -> _force_log_option = $this -> get_force_log_option();
$current_log_option = $this->_force_log_option;
$this->_force_log_option = $this->get_force_log_option();

Copy link
Contributor

@trasher trasher left a comment

Choose a reason for hiding this comment

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

After a quick look, this seems globally OK

@trasher trasher modified the milestones: 11.0.2, 11.0.3 Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log from which position a user is removed

3 participants