YAML Form's form submission remote post handler sends the complete form submission structure to a specified remote post endpoint, including Drupal-specific metadata. The remote post handler should only send the actual submitted form data as doing otherwise will lead to incompatibilities with many remote services.

Comments

bonus created an issue. See original summary.

gg4’s picture

StatusFileSize
new615 bytes
gg4’s picture

StatusFileSize
new587 bytes
gg4’s picture

gg4’s picture

jrockowitz’s picture

I understand the problem but what if the remote server needs to capture some of the submissions meta data like the submission id or user's IP address.

I think we might need to refactor the YamlFormRemotePostHandler to allow the posted elements to be selected. This feature would be similar to how users can select which elements are exported. By default I think only the elements should be posted.

gg4’s picture

Yea, that is tricky because there is valuable data no longer being sent with this change. My D7 workaround was to create a #hidden or #value element and populate it with token, or to otherwise amend the data in a submit hander.

Unfortunately, the way the current solution works, it is not usable for creating simple forms that connect to services like Salesforce's Webtolead endpoints.

jrockowitz’s picture

StatusFileSize
new462.14 KB

The below element selection code is reusable so I think it should be relatively easy to add it to the remote post handler.

gg4’s picture

Oh that's awesome and probably the way to go longterm. We will need to deal with possible key collisions if we are merging data that are now the root level items in $request_post_data with those in $request_post_data['data'].

  • jrockowitz committed 12a25c3 on 2831576-remote-post-customize-data
    Issue #2831576 by bonus, jrockowitz: Remote post handler should use only...
jrockowitz’s picture

StatusFileSize
new100.68 KB

Below a screenshot of the new configuration settings.

jrockowitz’s picture

StatusFileSize
new7.82 KB
jrockowitz’s picture

By default only the form elements are posted but users now have the option to include any additional meta data.

  • jrockowitz committed 7045c75 on 8.x-1.x
    Issue #2831576 by bonus, jrockowitz: Remote post handler should use only...
jrockowitz’s picture

Status: Needs review » Fixed

Fixed! Please checkout or download the latest dev release.

  • jrockowitz committed 5e2d76c on 8.x-1.x
    Issue #2831576 by bonus, jrockowitz: Remote post handler should use only...

  • jrockowitz committed 5e2d76c on 2831576-custom-data-remote-post
    Issue #2831576 by bonus, jrockowitz: Remote post handler should use only...
  • jrockowitz committed 7045c75 on 2831576-custom-data-remote-post
    Issue #2831576 by bonus, jrockowitz: Remote post handler should use only...

Status: Fixed » Closed (fixed)

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