Steps for reproduction:
- Create an arbitrary Webform
- CSS/JS: Add a Javascript snippet for your form
- Clear Drupal cache (Configuration)
Test with that Javascript snippet:
(function ($) {
console.log ("javascript called");
})(jQuery);
It works befor clearing cache.
Error after clearing cache:
2016/12/19 07:33:19 [error] 20257#20257: *1863 FastCGI sent in stderr: "PHP message: Error: Unsupported operand types in /var/www/html/modules/webform/webform.module on line 321 #0 /var/www/html/modules/webform/webform.module(296): _webform_asset_alter(Array, Object(Drupal\Core\Asset\AttachedAssets), 'javascript')
#1 /var/www/html/core/lib/Drupal/Core/Extension/ModuleHandler.php(501): webform_js_alter(Array, Object(Drupal\Core\Asset\AttachedAssets), NULL)
#2 /var/www/html/core/lib/Drupal/Core/Asset/AssetResolver.php(276): Drupal\Core\Extension\ModuleHandler->alter('js', Array, Object(Drupal\Core\Asset\AttachedAssets))
#3 /var/www/html/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php(298): Drupal\Core\Asset\AssetResolver->getJsAssets(Object(Drupal\Core\Asset\AttachedAssets), true)
#4 /var/www/html/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php(161): Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAssetLibraries(Object(Drupal\Core\Asset\AttachedAssets), Array)
#5 /var/www/html/core/modules/big_pipe/src/Render/BigPipeResponseAttachme" while reading upstream, client: 192.168.0.6, server: _, request: "GET /form/registrierung HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "www-test.lan", referrer: "https://www-test.felsing.net/admin/structure/webform"
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | Screen Shot 2016-12-20 at 4.35.51 PM.png | 404.11 KB | jrockowitz |
| #2 | yamlform.yamlform.js_.yml | 2.17 KB | jrockowitz |
Comments
Comment #2
jrockowitz commentedI can't duplicate the issue. Attached is the form I am using.
What version for Drupal are you using?
Comment #3
jrockowitz commentedComment #4
ip6li commentedFollowing versions are installed
Drupal core 8.2.4
CAPTCHA 8.x-1.0-alpha1
CDN 8.x-3.0
CKEditor CodeSnippet 8.x-1.6
CKEditor Font Size and Family 8.x-1.0
Composer Manager 8.x-1.0-rc2+1-dev (2016-Jun-22)
ImageMagick 8.x-1.0-alpha5
IMCE 8.x-1.4
JSON/JSONB Field 8.x-1.0-beta1
Mail System 8.x-4.1
Memcache Storage 8.x-1.0-beta2
Monitoring 8.x-1.1
OAuth2 Server 8.x-1.x-dev (2015-Okt-01)
reCAPTCHA 8.x-2.2
Superfish 8.x-1.0-rc5
Symbol 8.x-1.0
Webform 8.x-5.0-beta2
BTW: How did you got complete YAML source from webforms?
Comment #5
jrockowitz commentedhttps://www.youtube.com/watch?v=sRXUR2c2brA&feature=youtu.be
Comment #6
ip6li commentedDevelopment export of failing form:
Comment #7
jrockowitz commentedForm is working fine on my local dev. See below screenshot.
Can you test your form using a plain D8 install? Maybe try https://simplytest.me/project/drupal/8.2.x?add[]=webform
Comment #8
ip6li commentedProblem was caused by enabled experimental Drupal 8 feature BigPipe. After disabling that, Webform works with my Javascript snippet.
Comment #9
jrockowitz commentedOkay, that is fixable. I will look into it.
Comment #10
jrockowitz commentedHere are the steps that I am using to replicate the issue using simplytest.me.
Comment #12
jrockowitz commentedFixed! Please download or checkout the latest dev release.