Hi, I'm using some form for sending data to another form with "Custom form settings > form method" where I can add my destination address (and passing fields data by GET).
The point is that I've realized that I can't translate the destination URL in case I have diferent language versions of the destination form (let's say of the destination page). Is there any way to send the get action to different URLs based on language ??
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 3081154-12.patch | 21.7 KB | jrockowitz |
| #11 | 3081154-11.patch | 9.03 KB | jrockowitz |
| #10 | 3081154-10.patch | 11.81 KB | jrockowitz |
| #5 | webform.webform.issue_3081154.yml | 4.34 KB | jrockowitz |
| #5 | 3081154-5.patch | 2.27 KB | jrockowitz |
Comments
Comment #2
jorditr commentedComment #3
jrockowitz commentedOuch!!! This is not easy to fix via the UI. It should very easy to fix via custom code. I even think you can embed the current page's langcode as token in your custom URL
Comment #4
jrockowitz commentedSo I determined that token replacement is not working for the form #action. The attached patch fixes this issue.
Comment #5
jrockowitz commentedThe attached webform provides a reasonable work-around where you can create a hidden form action element and populate the #action using a token.
The attached patch is required to make this possible. The attached patch requires a lot of testing because it is extracting the default values from every form element and passing to the Webform Submission's data. I think this is a really important improvement that just needs work, test coverage, and even a change record.
Comment #8
jorditr commentedHei Jacob, thanks a lot! Let me check your code.
Comment #10
jrockowitz commentedAttached patch is probably the best solution but it still needs some test coverage.
Comment #11
jrockowitz commentedArg!!! The previous was not sync'd with the 8.x-5.x branch.
Comment #13
jrockowitz commentedComment #15
jrockowitz commentedSince the patch has test coverage, I committed it. Please download the latest dev release to review.