Notice: Use of undefined constant JSON_UNESCAPED_SLASHES - assumed 'JSON_UNESCAPED_SLASHES' in structured_data_preprocess_html() (line 62 of /xxx/sites/all/modules/structured_data/structured_data.module).
Warning: json_encode() expects parameter 2 to be long, string given in structured_data_preprocess_html() (line 62 of /xxx/sites/all/modules/structured_data/structured_data.module).
When installed
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | check_for_constant-2560483-3.patch | 636 bytes | wayneloftus |
| #2 | check_for_constant-2560483-2.patch | 634 bytes | wayneloftus |
Comments
Comment #2
wayneloftus commentedI am seeing the same issue.
As it turns out, the constant JSON_UNESCAPED_SLASHES is only available after PHP 5.4.0 http://php.net/manual/en/json.constants.php#constant.json-unescaped-slashes. You might check your PHP version. If you're like me, your architecture has you stuck at 5.3.3. Thanks Red Hat!
Removing it does make the urls look a bit odd (e.g., 'https:\/\/\drupal.org\/project\/structured_data'), but double-checking in Google's Structured Data Testing Tool, it interprets the escaped urls correctly: https://developers.google.com/structured-data/testing-tool/
Above is a patch which checks to see if the constant exists before using it.
Comment #3
wayneloftus commentedComment #4
wayneloftus commentedOops. Jumped the gun on that one and didn't quote the constant.
Fixed.
Comment #6
k_zoltan commentedThanks for your contribution.
Pushed to dev.
Will be included in the next stable release.