Skip to content

Conversation

SebSept
Copy link
Contributor

@SebSept SebSept commented Apr 29, 2025

Group managed OLA

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.
  • This change requires a documentation update.

Description

  • It fixes # (issue number, if applicable)
  • Here is a brief description of what this PR does

Screenshots (if appropriate):

@SebSept SebSept force-pushed the feature-group-managed-ola branch 2 times, most recently from 028c139 to 6abca80 Compare May 2, 2025 14:45
@SebSept SebSept force-pushed the feature-group-managed-ola branch 2 times, most recently from 82524f3 to 73ed39c Compare May 28, 2025 12:06
@SebSept SebSept force-pushed the feature-group-managed-ola branch 2 times, most recently from 2cdabea to 6a2478a Compare June 25, 2025 11:40
@SebSept SebSept force-pushed the feature-group-managed-ola branch 2 times, most recently from d4e606f to e6660fe Compare June 27, 2025 15:28
@SebSept SebSept force-pushed the feature-group-managed-ola branch from e6660fe to 846746f Compare July 9, 2025 09:23
@SebSept SebSept force-pushed the feature-group-managed-ola branch 6 times, most recently from 0e3a22f to 6b9b8b2 Compare July 18, 2025 14:48
@cedric-anne cedric-anne added this to the 11.1.0 milestone Jul 21, 2025
@SebSept SebSept force-pushed the feature-group-managed-ola branch 4 times, most recently from b679d9c to f359192 Compare July 28, 2025 12:22
* @param CommonDBTM<T> $item
* @return T
*/
protected function reloadItem(CommonDBTM $item): CommonDBTM
Copy link
Contributor

Choose a reason for hiding this comment

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

You shouldn't need a new item instance in most cases. getFromDB replaces all of the fields. If some old data remains, it may be an indication of a missing post_getFromDB.
$item->getFromDB($item->getID);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was not sure, to I decided to create a new Object, this is to be sure that anything hidden remains.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remaining values inside the object is the problem, as you noticed.
In tests we can use the same object for convenience. But in source code, the object saving and loading don't happens at the same time. I don't think I introduced this kind of problem (no cache or static data implemented). But getting a fresh object is a way to be closer of real usage and avoid special cases.
It's more safe and we avoid having a test to pass because of remaining data (which is not the case at runtime, not in tests).

On the other hand, the code tend to use the same variable object to do different things. But that's a bad practice imo.

What do you think about it @cedric-anne ?

@SebSept SebSept force-pushed the feature-group-managed-ola branch 3 times, most recently from 071267e to 9ffbe4f Compare July 29, 2025 15:32
@SebSept SebSept force-pushed the feature-group-managed-ola branch 2 times, most recently from ea43204 to 3729b85 Compare August 12, 2025 12:19
@SebSept SebSept force-pushed the feature-group-managed-ola branch from 38616c6 to 08b4eeb Compare August 14, 2025 10:41
@SebSept SebSept requested a review from cconard96 August 14, 2025 11:42
@SebSept SebSept self-assigned this Aug 14, 2025
@SebSept SebSept requested a review from cedric-anne August 14, 2025 11:42
@SebSept SebSept force-pushed the feature-group-managed-ola branch from 05e52e5 to 8019bfe Compare August 14, 2025 12:01
@SebSept SebSept marked this pull request as ready for review August 14, 2025 13:00
@PierreTeclib
Copy link

PierreTeclib commented Aug 14, 2025

@SebSept :

Small issue. This field doesn’t seem relevant here:

image

Moreover, when a change is made and a date is displayed, the calendar icon on the right does nothing when clicked.

image

@SebSept
Copy link
Contributor Author

SebSept commented Aug 14, 2025

this is a readonly datetime input, not the best option.

I just removed this field from display.

- testOlaTtoIsNotCompleteWhenTicketIsAssignedToDedicatedGroupByRuleAndOlaIsAddedByRule()
- testOlaTtoIstCompleteWhenTicketIsAssignedToDedicatedGroupByRuleAndOlaIsAddedByRuleThenGroupRemoved()
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.

6 participants