Problem/Motivation
"Per webform" overrides for previous and next label are not taken into account.
Steps to reproduce
Drupal 10.2.5
Webform 6.2.7
1. Create a webform and override the previous and next label, at the "webform" level.
2. Do not override labels at the "wizard page" level
3. Check on the webform : buttons labels are still using the native labels, not the ones overridden at step 1
If I override the labels at "wizard page" level, these values are correctly taken into account.
But as my buttons have the same labels on all pages, it would be much easier if I could enter their value just once, at the webform level.
Issue fork webform-3468142
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
aaron.ferris commentedCan confirm this, seems we fallback to the default global webform settings should a 'per page' wizard next/previous label not be defined.
From a quick look, we could possibly add another condition in WebformSubmissionForm that uses the following order:
1. Per page wizard settings as a priority
2. Then Per webform settings
3. Then fallback to default settings
IE, like the attached MR.
Comment #4
aaron.ferris commentedComment #5
liam morlandComment #6
clemorphyThanks a lot aaron.ferris
I have tested your MR from #3, applied on version 6.2.7, and it works perfectly for me.
Edit : not so perfectly. I have the following warning (without noticeable impact) :
Comment #7
liam morlandIt looks like $next_button_custom is not getting set. That needs to be fixed. This also needs tests.
Comment #8
aaron.ferris commentedAh yes, ive fixed that - id need more time to look at writing a test.
Comment #9
clemorphyI confirm that the error is gone with the updated MR!506
Thank you.
Comment #10
darvanenThe button label doesn't get overridden *there*, but it does get overridden in \Drupal\webform\Element\WebformActions::processWebformActions
Comment #12
jrockowitz commentedLet's see if the tests pass with 6.3.x and decide if additional test coverage is needed.
Comment #13
jrockowitz commentedBelow are my review steps
Comment #14
jrockowitz commentedYep, I am not seeing any test coverage and here is where I think we need to add some \Drupal\Tests\webform\Functional\Wizard\WebformWizardAdvancedTest
Comment #15
jrockowitz commentedComment #16
jrockowitz commentedComment #18
jrockowitz commentedComment #22
clemorphyIs it normal that it hasn't been merged into branch 6.2 too?
Comment #23
liam morlandAt this point, 6.2.x is only fixing serious bugs and security issues. It goes EOL with Drupal 10 in a few months.