I cannot find the settings where I can hide the 'edit' button when using wizard pages in a webform.

Any help how can i hide the 'edit' button ?

Hide 'Edit' button

UPDATE:
The 'Enable preview page' settings is set to 'Disabled' and also the 'Link to previous pages in preview' checkbox is 'unchecked' and still and can see the 'edit' button.

Thank you,

Comments

C.E.A created an issue. See original summary.

c.e.a’s picture

Category: Support request » Bug report
Issue summary: View changes
Priority: Normal » Major
jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new4.24 KB

I am unable to replicate this issue using the attached webform.

c.e.a’s picture

Status: Postponed (maintainer needs more info) » Needs work
StatusFileSize
new22.39 KB

Ok... The problem is generated due to the webform is being launched within a dialog.

See it in action!

Visit: /admin/structure/webform/manage/issue_3042982_hide_the_edit_butt/settings and try to launch the webform from the "Test Normal" button.

Edit button

Thank you,

jrockowitz’s picture

Status: Needs work » Needs review
StatusFileSize
new1.94 KB

This a tricky issue with a simple but confusing patch. I might need to rethink the approach.

Please test the patch.

c.e.a’s picture

Patch #5 is worked for me tested on '8.x-5.2-rc3' version.

A bit of explanation which might be useful:

1)

  1. #5 patch is applied
  2. 'Enable preview page' settings is set to 'Disabled'
  3. 'Link to previous pages in preview' checkbox is 'unchecked'

Results: 'Hide' button is indeed hidden from display (Expected behavior)

2)

  1. #5 patch is applied
  2. 'Enable preview page' settings is set to 'Enabled'
  3. 'Link to previous pages in preview' checkbox is 'Checked'

Results: 'Hide' button is displayed (Expected behavior)... But the 'edit' button is displayed inside the dialog form and not on its edges. (Which is great)

Usually all buttons of a webform are displayed at the bottom edge of the dialog and not inside it due to how Drupal core behaves. (See the image posted in the question above)

Note:
"< Previous" button and "Submit" button are still displayed at the bottom edge of the dialog.... only the "edit" button is displayed inside the webform.

jrockowitz’s picture

The issue is Drupal.behaviors.dialog.prepareDialogButtons grabs all buttons in .form-actions and places them at the bottom of the dialog.

c.e.a’s picture

The issue is Drupal.behaviors.dialog.prepareDialogButtons grabs all buttons in .form-actions and places them at the bottom of the dialog.

I am aware of this issue but I was surprised because after applying the patch #5 the 'edit' button is not following this behavior (http://cgit.drupalcode.org/drupal/tree/core/misc/dialog/dialog.ajax.js?i...) (which is just great)

jrockowitz’s picture

StatusFileSize
new1.58 KB

The attached patch is a better approach because it solves this issue in only one place and includes test coverage.

c.e.a’s picture

Patch #9 is hiding the 'edit' button as required!

  • jrockowitz committed e037ca1 on 8.x-5.x
    Issue #3042982 by jrockowitz, C.E.A: Hide the 'edit' button in wizard...
jrockowitz’s picture

Status: Needs review » Fixed

I committed the patch. Please download the latest dev release to review.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.