Skip to content

validuntil gets lost during approval #496

Closed

Description

@asattler

Is this a regression?

Yes

Severity

🔴 Critical – blocks key functionality

Please provide the branch(es) you discovered this issue in

v93

Environment Details

9.3 v93-348245

Please provide a minimal set of steps to reproduce the issue

  1. Have a product with an approval workflow where some user needs to approve (for better visibility I recommend having 2 approval steps, each having a user to approve)
  2. Request this product with a valid until date (e.g. 25.06.2026)
  3. Login as 1st approver
  4. go the the pending requests view
  5. click on approve of the just requested product, the sidesheet opens.
  6. notice that the valid until date is shown as requested before. Do not click into the input element or change anything.
  7. click on approve to submit the approval
  8. login as 2nd approver and repeat steps 4 + 5
  9. notice that valid until date is empty now

Description

Requests will loose its previously set valid until date during approval.
This leads to very bad data situations, as it's impossible to check if this modification was done by the approver or by this bug.
From my point of view this is critical. If you think of audits etc...

The problem came in with commit #483 and is related to the changes in imxweb/projects/qer/src/lib/itshopapprove/workflow-action/workflow-action.service.ts:

if (request.canSetValidUntil(itShopConfig) && actionParameters.validUntil) {
          const until = actionParameters.validUntil.column.GetValue();
          if (until) {
            request.ValidUntil.value = addTimeNowToDate(until);
          } else {
            // The value was removed, so set it to null in order to not send an invalid date to the backend
            await request.ValidUntil.Column.PutValue(null);
          }

I verified this by removing the lines added by the commit. Primary
await request.ValidUntil.Column.PutValue(null);

I'm pretty sure that the same applies to the valid from date, but I did not test it.

Based on my analysis the root cause for this is, actionParameters.validUntil is only used if you approve more than 1 object at the same time and use the "common editor" at the top of the sidebar.
In other cases the changes are directly performed on the object "request".

Describe what you expected to happen versus what actually happened

I would expect that if the approver doesn't touch the given valid until date, that this date is kept.

Relevant logs or console output

Add a screenshot(s) if that helps illustrate the problem

Initial Request
Image
1st approver approves without editing anything
Image
2nd approver finds the valid until date to be empty
Image

Suggested Fix

No response

Anything else?

No response

Before submitting...

  • I have searched for existing issues that match this one on github and on the community support page
  • I have included all necessary details to reproduce this issue

Activity

  1. asattler commented on Jun 4, 2026

    @asattler
    Author

    I've tried to think of a solution for the issue.
    From my point of view the code change done with the mentioned commit is wrong. It doesn't cover the designed UI.

    For single approvals the WorkflowSingleActionComponent is used. It does not use the actionParameters, so the result of const until = actionParameters.validUntil.column.GetValue(); is always null.

    You could e.g. check in the if-clauses for a multiselection by requests.length > 1, so that you don't run into the code for that.

    But also multi-approvals are broken by the original fix.
    Using the WorkflowMultiActionComponent you can either change the ValidUntil for all selected requests, or modify each one-by-one.
    This means that actionParameters is needed, but actionParameters.validUntil.column.GetValue(); can again be null without the intention to empty this for all selected requests.

    So I think the original problem (to clear the date for all selected items) needs a new solution, the implemented one breaks everything else...

  2. changed the title [-]validuntil gets lost during approval if not changed by approver[/-] [+]validuntil gets lost during approval[/+] on Jun 5, 2026
  3. kovtib commented on Jun 5, 2026

    @kovtib
    Contributor

    Thanks @asattler, we already have an internal ticket for this error and we are working on it.

  4. kovtib commented on Jun 5, 2026

    @kovtib
    Contributor

    /link-devops 709042

  5. github-actions commented on Jun 5, 2026

    @github-actions

    ✅ DevOps work item #709042 linked and label added by @kovtib. Closing this issue - keep an eye out for branch syncing to resolve this work item.

  6. asattler commented on Jun 22, 2026

    @asattler
    Author

    Hi @kovtib, I've seen your commited fix. But unfortunately it doesn't work (or to be clear: the bulk-edit will not work).
    In the workflow-action.service.ts the case of the 1st character for the control is mixed. It needs to be lowercase to match the formgroup. so the piece of code nevers runs.

    When the typo is fixed and you re-run your tests you will notice that the problem wasn't solved. Still you're unsetting the validUntil-Dates which where individually configured during request.
    As mentioned initially from a UX-perspective having an empty-field for the "bulk operation" should not reset individually configured values. I think you need to implement some kind of "remove individual configurd values" or similiar to avoid overwriting those by accident.

  7. kovtib commented on Jun 23, 2026

    @kovtib
    Contributor

    Hi @asattler,
    I work on this issue. It will be fixed in the next github sync.

  8. kovtib commented on Jul 2, 2026

    @kovtib
    Contributor

    @asattler Fixed in v93.

  9. asattler commented on Jul 2, 2026

    @asattler
    Author

    Hi @kovtib , thanks for working on this.
    I just reviewed the code. Isn't there still a mix of the first character?
    workflow-multi-action.component.html (small "v" in "validUntil"

    <imx-cdr-editor
            *ngIf="data.actionParameters.validUntil"
            [cdr]="data.actionParameters.validUntil"
            [validateOnlyOnChange]="true"
            (controlCreated)="formGroup.addControl('validUntil', $event)"
            data-imx-identifier="workflow-action-property-validUntil"
          >
    

    workflow-action.service.ts (capital "V" in "ValidUntil", also in the surrounding lines)

    const until = formGroup.controls.ValidUntil!.value;
    

    Also I can't find a solution for the multi-approvals. For this, at least what I see, you still clear individual configured values.
    See my previous post:

    But also multi-approvals are broken by the original fix.
    Using the WorkflowMultiActionComponent you can either change the ValidUntil for all selected requests, or modify each one-by-one.
    This means that actionParameters is needed, but actionParameters.validUntil.column.GetValue(); can again be null without the intention to empty this for all selected requests.

    BR
    Andreas

  10. kovtib commented on Jul 3, 2026

    @kovtib
    Contributor

    @asattler you are right. I updated the addControl validUntil and validFrom events.

  11. asattler commented on Jul 7, 2026

    @asattler
    Author

    @kovtib Thanks :)

    Can you also give feedback to my concerns about the multi-approvals? As mentioned this is also not working as users will expect.

  12. kovtib commented on Jul 8, 2026

    @kovtib
    Contributor

    @asattler
    Only the single approval workflow updates the validUntil column with null:

              if (until) {
                request.ValidUntil.value = addTimeNowToDate(until);
              } else if (requests.length === 1) {
                // The value was removed, so set it to null in order to not send an invalid date to the backend
                await request.ValidUntil.Column.PutValue(null);
              }
    
  13. asattler commented on Jul 11, 2026

    @asattler
    Author

    Thanks @kovtib, seems like I didn't read the code properly :)

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

    DevOps:709042Linked to internal DevOps issue #709042bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions