initFocalPointPictures error

Created on 22 April 2024, 2 months ago
Updated 16 June 2024, 13 days ago

Problem/Motivation

When viewing Shorthand stories, the title section image is blurred due to JS errors.

Uncaught SyntaxError: Unexpected identifier 'g' 
    at 6:811

 Uncaught TypeError: Cannot read properties of undefined (reading 'initFocalPointPictures')
    at 6:811:23
    at 6:812:11

The issue seems to be in the code on line 44: $head = strip_tags(file_get_contents($filePathHead), '<link><style><script><title>');. A temporary workaround for this, you need to replace this line with $head = file_get_contents($filePathHead). After making this change, clear the cache or import a new story. This should allow the story to load properly in Drupal.

I've also verified that this is the issue by swapping line 44 from article.html to index.html which works fine.

Steps to reproduce

1) Import a story from Shorthand
2) Create the content article
3) View the story as a user, which will show the console errors, and the title section image will be blurred.

Proposed resolution

Some work needs doing to identify what is being stripped that is required and why on this line:
$head = strip_tags(file_get_contents($filePathHead), '<link><style><script><title>');

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024