AssertionError when viewing Fileslog after deleting a Webform

Created on 25 September 2025, 19 days ago

Problem/Motivation

AssertionError: Cannot load the "webform" entity with NULL ID

Description

When using the Fileslog module together with Webform, the following error occurs:
AssertionError: Cannot load the "webform" entity with NULL ID

Steps to reproduce

1. Install and configure the **Webform** module.

2. Install the **Fileslog** module (requires setting up a private directory).

3. Create a Webform and add at least one element.

4. Check `/admin/reports/fileslog` and confirm that log messages related to the Webform element save are recorded.

5. Delete the Webform.

6. Reload `/admin/reports/fileslog`.

- You will now see the error:
`AssertionError: Cannot load the "webform" entity with NULL ID`

Proposed resolution

Update the method - preRenderWebformElement in web/modules/contrib/webform/src/Element/Webform.php

Current:

    $webform = ($element['#webform'] instanceof WebformInterface) ? $element['#webform'] : WebformEntity::load($element['#webform']);

Fixed:

    $webform = ($element['#webform'] instanceof WebformInterface) ? $element['#webform'] : ($element['#webform'] ? WebformEntity::load($element['#webform']) : NULL);

🐛 Bug report
Status

Active

Version

6.3

Component

Code

Created by

🇵🇰Pakistan asghar

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

Merge Requests

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