Update the webform 'uri' field to come from the referer

Created on 8 December 2021, about 3 years ago
Updated 8 May 2023, over 1 year ago

Problem/Motivation

Currently, when a webform is submitted to through the webform_rest_submit post route, the webform saves the submitted uri as '/webform/' . $webform_data['webform_id'] . '/api'. This is not really useful if a lot of pages are submitting the same form thus making the same post request.

This is noticeable if you are using the [webform_submission:source-url] token in a webform email handler or if you are viewing webform submissions.

Proposed resolution

I am proposing that the webform uri value gets updated to equal the referer. This will become more helpful when view submissions that could be posted from different pages.

The proposed uri field would be $this->request->getCurrentRequest()->headers->get('referer').

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bobbysaul

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024