I'm seeing an intermittent but repeatable error that seems to be around the caching of per-webform custom javascript.

The error is:

Warning: file_get_contents(webform/javascript/form_machine_name): failed to open stream: No such file or directory in _locale_parse_js_file() (line 1134 of core/modules/locale/locale.module).

Worth noting is that even on pages that display the error, the custom javascript is being successfully executed. The error seems to be the locale module looking for something that's not available. (...Or maybe is no longer available by the time _locale_parse_js_file() is executed?)

Clearing the cache (via drush cr) causes the error to show consistently on the second subsequent webform admin-page load -- I was mostly testing with the Settings > Submissions tab. Once it's been shown it doesn't seem to appear again until after the cache is re-cleared or otherwise invalidated.

The error will also display after a drush cr on a public-facing page containing the form (positioned within a block). This seems less consistent -- it's usually on the second load, but sometimes on the first.

Strangely, it also occasionally shows on published pages that have nothing to do with the form at all, but as far as I can tell it's only shown after a page referencing the form has been loaded. (e.g. clear cache, load the public webform page, then load an unrelated public page.)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jimaginary created an issue. See original summary.

jrockowitz’s picture

Status: Active » Needs review

This might have been fixed via #2920513: CKEDITOR: autogrow and undefinedlink plugin not found. Please download the latest dev release and see if this issue has been fixed.

jrockowitz’s picture

Status: Needs review » Postponed (maintainer needs more info)
jrsouth’s picture

Unfortunately it's still happening as of #c0ddfb69

jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
1.42 KB

This is a core issue, but there is a workaround which I am including in the attached patch.

@see #1803330: Add file_exists() to _locale_parse_js_file() to prevent PHP warning

Status: Needs review » Needs work

The last submitted patch, 5: custom_form_javascript-2920503-5.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jrsouth’s picture

Despite the failing test #5 applied cleanly and has fixed the error.

jrockowitz’s picture

Status: Needs work » Needs review
FileSize
1.59 KB
jrockowitz’s picture

Status: Needs review » Fixed
jrockowitz’s picture

  • jrockowitz committed 3028ba4 on 8.x-5.x
    Issue #2920503 by jrockowitz, Jimaginary: Custom form javascript --...

Status: Fixed » Closed (fixed)

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