- Merge request !746Issue#3548587: Fix the log crash issue after webform deleted. → (Open) created by asghar
AssertionError: Cannot load the "webform" entity with NULL ID
When using the
Fileslog →
module together with Webform, the following error occurs:
AssertionError: Cannot load the "webform" entity with NULL ID
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`
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);
Active
6.3
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.