Wizard previous and next label not overridden

Created on 14 August 2024, 8 months ago

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.

🐛 Bug report
Status

Active

Version

6.2

Component

Code

Created by

🇫🇷France clemorphy Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @clemorphy
  • 🇬🇧United Kingdom aaron.ferris

    Can confirm this, seems we fallback to the default 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

  • Pipeline finished with Failed
    8 months ago
    Total: 1818s
    #254095
  • Status changed to Needs review 8 months ago
  • 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
  • 🇫🇷France clemorphy Paris

    Thanks a lot aaron.ferris
    I have tested your MR from #3, applied on version 6.2.7, and it works perfectly for me.

  • Status changed to Needs work 8 months ago
  • 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦

    It looks like $next_button_custom is not getting set. That needs to be fixed. This also needs tests.

  • 🇬🇧United Kingdom aaron.ferris

    Ah yes, ive fixed that - id need more time to look at writing a test.

  • Pipeline finished with Failed
    8 months ago
    Total: 1954s
    #259158
  • 🇫🇷France clemorphy Paris

    Ah yes, ive fixed that - id need more time to look at writing a test.

    I confirm that the error is gone with the updated MR!506
    Thank you.

  • Pipeline finished with Success
    6 months ago
    Total: 229s
    #299639
  • Pipeline finished with Success
    3 months ago
    Total: 883s
    #385181
  • Pipeline finished with Skipped
    3 months ago
    #387557
  • 🇦🇺Australia darvanen Sydney, Australia

    The button label doesn't get overridden *there*, but it does get overridden in \Drupal\webform\Element\WebformActions::processWebformActions

          // Apply custom label.
          $has_custom_label = !empty($element[$button_name]['#webform_actions_button_custom']);
          if (!empty($element['#' . $settings_name . '__label']) && !$has_custom_label) {
            if (isset($element[$button_name]['#type']) && ($element[$button_name]['#type'] === 'link')) {
              $element[$button_name]['#title'] = $element['#' . $settings_name . '__label'];
            }
            else {
              $element[$button_name]['#value'] = $element['#' . $settings_name . '__label'];
            }
          }
    
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 212s
    #424692
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1074s
    #424694
  • Pipeline finished with Failed
    about 2 months ago
    Total: 814s
    #424721
  • Pipeline finished with Success
    about 2 months ago
    Total: 933s
    #424731
Production build 0.71.5 2024