Problem/Motivation

Using webform_share to embed a form via the /webform/{webform}/share.js route, a '403 Forbidden' response is returned when the form page setting (e.g. Allow users to post submissions from a dedicated URL) is disabled.

Steps to reproduce

  • Check 'Form sharing enabled' (from the webform_share submodule)
  • Uncheck 'Allow users to post submissions from a dedicated URL'
  • Embed the webform on a host page using the JavaScript option (e.g. <script src="//d9.test/webform/share_test/share.js"></script>)
  • The webform will not be embedded on the host page, and developer tools will show a 403 response for the /webform/share_test/share.js URL.

Proposed resolution

Change the _entity_access route requirement from webform.submission_page to webform.submission_create for the entity.webform.share_script route.

This seems OK because the entity.webform.share_page.javascript route, which the share script itself embeds for the iframe src, uses webform.submission_create.

Issue fork webform-3321649

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jeffam created an issue. See original summary.

jeffam’s picture

Title: Shared webforms return HTTP 403 when there is no dedicated URL » 3321649-shared.js-403
Status: Active » Needs review
jeffam’s picture

Title: 3321649-shared.js-403 » Shared webforms return HTTP 403 when there is no dedicated URL

  • 44f1cdf committed on 6.1.x
    Issue #3321649 by jeffam: Shared webforms return HTTP 403 when there is...

  • 44f1cdf committed on 6.x
    Issue #3321649 by jeffam: Shared webforms return HTTP 403 when there is...

  • 44f1cdf committed on 6.2.x
    Issue #3321649 by jeffam: Shared webforms return HTTP 403 when there is...
jrockowitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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