Problem/Motivation

When importing or encountering invalid WebformYaml, the module will log this event as a notice ("%title elements are not valid. @message").

An invalid WebformYaml makes the associated Webform unusable, uneditable and is not a normal condition. As such, it should be logged as an error, not as a notice.

This would also make it easier to spot invalid WebformYaml during an import, as error-messages stand out and can be searched for programmatically.

Steps to reproduce

  1. Create a Webform
  2. Export the config of this Webform
  3. Accidentally (or intentionally) invalidate the WebformYaml (the Yaml-String under .elements in the Config-Yaml)
  4. Import the Webform
  5. Visit the Webform. You will get the warning "Unable to display this webform. Please contact the site administrator."
  6. Go to /admin/reports/dblog. It will show no error.

Remaining tasks

Review patch.

User interface changes

API changes

Data model changes

Issue fork webform-3337991

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:

Comments

RobinCS created an issue. See original summary.

robincs’s picture

Issue summary: View changes
Status: Active » Needs review
cilefen’s picture

Version: 6.1.3 » 6.2.x-dev

I am moving this to the feature branch as it is marked as a feature request.

jrockowitz’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

renatog’s picture

Status: Reviewed & tested by the community » Needs work

Seems good. The MR needs reroll Merge blocked: the source branch must be rebased onto the target branch.

renatog’s picture

Status: Needs work » Reviewed & tested by the community

MR updated. Now is mergeable: https://git.drupalcode.org/project/webform/-/merge_requests/282#note_147926

I'm going to back to RTBC, since was approved previously

  • jrockowitz committed ca6551fe on 6.2.x authored by RobinCS
    Issue #3337991 by RobinCS, RenatoG, jrockowitz: Log invalid elements as...
jrockowitz’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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