wingsuit-designsystem / wingsuit

Twig for Storybook
GNU General Public License v2.0
90 stars 16 forks source link

Only local files should be passed to _locale_parse_js_file() error. #228

Closed adubovskoy closed 1 year ago

adubovskoy commented 1 year ago

Describe the bug With enabled locale module from drupal.core I've got message: "Only local files should be passed to _locale_parse_js_file()"

To Reproduce Can't provide reproduce steps. Try to enable locale, add more than 2 languages and check.

Additional context While debugging, found that reason was with 'ws-assets://...' in drupal core validation function. Patch as workaround solution:

diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index 1bf5ba1346..a149ec5618 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -1106,7 +1106,7 @@ function _locale_parse_js_file($filepath) {
   $filepath = $parsed_url['path'];

   // If there is still a protocol component in the path, reject that.
-  if (strpos($filepath, ':')) {
+  if (strpos($filepath, ':') && !str_contains($filepath, "ws-assets://")) {
     throw new Exception('Only local files should be passed to _locale_parse_js_file().');
   }
christianwiedemann commented 1 year ago

This is quit old core issue. See https://www.drupal.org/project/drupal/issues/2735717