Problem/Motivation
There is route for webform submissions, which allows to browse all submission, if it has wizard pages. But if we have translation for the webform, then this route is inaccessible, because checkWizardPagesAccess() method checks raw 'elements' and searches for occurrences of such strings, as "'#type': webform_wizard_page" or "'#type': webform_card", but in case of translation, we don't have such strings, because 'type' attribute is not translatable, so for translation we have e.g. 'title' or 'placeholder' attributes.
Steps to reproduce
1. Make sure there are at least 2 languages on this site.
2. Create webform and add Wizard page element and some other elements.
3. Add translation to the webform.
4. Submit webform.
5. Check path like 'admin/structure/webform/manage/[webform_id]/submission/1/edit/all' under both languages.
Proposed resolution
Make such pages accessible.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3163980-5.patch | 2.94 KB | jrockowitz |
| #4 | 3163980-4.patch | 1.19 KB | jrockowitz |
| #2 | edit-all-route-inaccessible-when-non-language-3163980-2.patch | 794 bytes | ilya.no |
Comments
Comment #2
ilya.no commentedAttaching initial patch. Updated checkWizardPagesAccess() to use hasWizardPages(), as it seems to be logical. On the other hand using strpos is less resource consuming, but when translated elements are returned, then it's useless. Is there any better idea?
Comment #3
ilya.no commentedComment #4
jrockowitz commentedThis problem is related to #3162592: Webform Cards not working for translations of webform. Attached is a similar solution.
Comment #5
jrockowitz commentedComment #6
jrockowitz commentedComment #8
jrockowitz commented