Wizard previous and next label not overridden

Created on 14 August 2024, about 1 year 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
    about 1 year ago
    Total: 1818s
    #254095
  • Status changed to Needs review about 1 year ago
  • πŸ‡¬πŸ‡§United Kingdom aaron.ferris
  • πŸ‡¨πŸ‡¦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 about 1 year 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
    about 1 year 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
    12 months ago
    Total: 229s
    #299639
  • Pipeline finished with Success
    8 months ago
    Total: 883s
    #385181
  • Pipeline finished with Skipped
    8 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
    7 months ago
    Total: 212s
    #424692
  • Pipeline finished with Failed
    7 months ago
    Total: 1074s
    #424694
  • Pipeline finished with Failed
    7 months ago
    Total: 814s
    #424721
  • Pipeline finished with Success
    7 months ago
    Total: 933s
    #424731
  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    Let's see if the tests pass with 6.3.x and decide if additional test coverage is needed.

  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    Below are my review steps

    • Install webform_examples module (/admin/modules)
    • Goto Example: Wizard (/form/example-wizard)
    • Set the Wizard button label to {prev} and {next} (/admin/structure/webform/manage/example_wizard/settings/form)
    • Confirm that labels are NOT applied.
    • Switch to the MR
    • Confirm that labels are applied.
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    Yep, I am not seeing any test coverage and here is where I think we need to add some \Drupal\Tests\webform\Functional\Wizard\WebformWizardAdvancedTest

  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY
  • Now that this issue is closed, please review the contribution record.

    As a contributor, attribute any organization helped you, or if you volunteered your own time.

    Maintainers, please credit people who helped resolve this issue.

Production build 0.71.5 2024