Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form copying with logic rules that contain: "Inschakelen vanaf stap:" breaks Logic tab in new copy #3378

Closed
LaurensBurger opened this issue Aug 18, 2023 · 5 comments · Fixed by #3478
Assignees
Labels
bug Something isn't working needs-backport Fix must be backported to stable release branch

Comments

@LaurensBurger
Copy link
Collaborator

LaurensBurger commented Aug 18, 2023

Product versie / Product version

2.2.x - 2.3.0
Haarlemmermeer: 28

Omschrijf het probleem / Describe the bug

If a form containing logic rules that are enabled from a certain step, the copy of the form will have a broken Logic tab as it seems the "Inschakelen vanaf stap" still pointing to the original form:

 {
        "uuid": "de3cc210-aa72-437c-9e37-8aeec24ebe5b",
        "url": "http://localhost/api/v2/forms/de3cc210-aa72-437c-9e37-8aeec24ebe5b/logic-rules",
        "form": "http://localhost/api/v2/forms/1dacaf4f-bc68-4197-8c7b-84ad7ec913c1",
        "json_logic_trigger": true,
        "description": "",
        "order": 3,
        "trigger_from_step": "http://localhost/api/v2/forms/1dacaf4f-bc68-4197-8c7b-84ad7ec913c1/steps/72d4bdb5-90f0-4d89-9c3b-1bf3373c49d7",
        "actions": [
            {
                "component": "",
                "variable": "lijstvoorkvkvestiginen",
                "form_step": "",
                "form_step_uuid": null,
                "action": {
                    "type": "variable",
                    "value": ...
                }
            }
        ],
        "is_advanced": true
    }

json in copied form, notice the: "trigger_from_step": "http://localhost/api/v2/forms/1dacaf4f-bc68-4197-8c7b-84ad7ec913c1/steps/72d4bdb5-90f0-4d89-9c3b-1bf3373c49d7" instead of http://localhost/api/v2/forms/1968d36e-8932-43ff-8a83-8c22a2ad97dd

    {
        "uuid": "5fa0ea6f-c0d8-43b5-adb0-ad2584208bda",
        "url": "http://localhost/api/v2/forms/5fa0ea6f-c0d8-43b5-adb0-ad2584208bda/logic-rules",
        "form": "http://localhost/api/v2/forms/1968d36e-8932-43ff-8a83-8c22a2ad97dd",
        "json_logic_trigger": true,
        "description": "",
        "order": 3,
        "trigger_from_step": "http://localhost/api/v2/forms/1dacaf4f-bc68-4197-8c7b-84ad7ec913c1/steps/72d4bdb5-90f0-4d89-9c3b-1bf3373c49d7",
        "actions": [
            {
                "component": "",
                "variable": "lijstvoorkvkvestiginen",
                "form_step": "",
                "form_step_uuid": null,
                "action": {
                    "type": "variable",
                    "value": ...
                }
            }
        ],
        "is_advanced": true
    }

Importing the form does work.

@LaurensBurger LaurensBurger added bug Something isn't working triage Issue needs to be validated. Remove this label if the issue considered valid. labels Aug 18, 2023
@sergei-maertens
Copy link
Member

sergei-maertens commented Aug 21, 2023

Refinement: this is similar to the logic action to mark a step as not applicable - the solution there was to store the UUID reference rather than the fully qualified API resource URL. A similar approach is needed here.

It's a bug, but not a 2.3.0 release blocker, since it is broken all the way to 2.0.x probably.

@LaurensBurger do I understand it correctly the logic tab is broken in the sense that you can't fix the problem at all (i.e. no workaround)?

@sergei-maertens sergei-maertens added needs-backport Fix must be backported to stable release branch and removed triage Issue needs to be validated. Remove this label if the issue considered valid. labels Aug 21, 2023
@hlmr-erik
Copy link

AFAIK no workaround to 'revive' the logic tab once the form has been copied. As @LaurensBurger mentioned a woraround to get the form duplicated still consists of exporting the original form and then re-importing it - this duplicates the form with a working logic tab.

@sergei-maertens
Copy link
Member

thanks for reporting back! this will be fixed in the upcoming patch releases (in a month at the latest)

@hlmr-erik
Copy link

hlmr-erik commented Aug 25, 2023

Regretfully, where everything seemed fine originally, upon editing the export-imported form and trying to save, this showed up:
afbeelding

So it seems the workaround isn't one really, as now the copies automagically share their tabs.

Perhaps as another workaround @LaurensBurger can share which string to replace by which in the form formLogic.json? I tried to fiddle with it based on the explanation in the original post, but didn't manage.

@sergei-maertens
Copy link
Member

I believe this may be caused by #3335 - so if we can fix that, then the workaround should be viable.

vaszig added a commit that referenced this issue Sep 18, 2023
vaszig added a commit that referenced this issue Sep 18, 2023
sergei-maertens added a commit that referenced this issue Sep 18, 2023
…h-logic-rules-breaks-copy-logic-tab

[#3378] Fix formstep url in logic rules of copied form
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-backport Fix must be backported to stable release branch
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants