Sitejet publishing breaks collections

nextdoordigital

New Pleskian
Username:

TITLE

Sitejet publishing breaks collections

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Sitejet Builder 1.4.2-9219
On Plesk Obsidian 18.0.79 Update #4
Windows Server 2019

PROBLEM DESCRIPTION

Dynamic collection displays work correctly as long as the page was published before the issue appeared. However, after making even the smallest change to a page and publishing it again, any collection containing a dynamic image no longer renders on the published site.

Collections without dynamic images continue to work.

Investigation performed​

I have already ruled out several possible causes:

  • Created a completely new collection.
  • Created a completely new image field.
  • Uploaded a completely new image.
  • Created a completely new Collection Display.
  • Tested on multiple pages.
  • Verified that the data-collection-bind attribute contains valid JSON and parses correctly.
  • Confirmed the exception occurs later during renderCollectionItems().
Most importantly:

  • Restoring a backup of the published site immediately makes the collection work again.
  • Making a single unrelated text edit (for example changing one character in a headline) and publishing causes the same page to fail again immediately.
  • The content of the collection itself has not changed.
This strongly suggests that the issue is introduced during publishing rather than by the collection configuration itself.

STEPS TO REPRODUCE

  1. Have a page containing a collection display with a dynamic image field where the image renders correctly.
  2. Edit any unrelated content on the page (for example, change a single character in a headline).
  3. Publish the page again.
  4. Reload the published page.

ACTUAL RESULT

The collection remains in the loading state and no collection items are displayed.

The HTML contains:

<div class="inner collection-loading" ... style="opacity:0">

The loading class is never removed.

Browser console​

The published page reports:

Uncaught (in promise) SyntaxError: Expected ',' or '}' after property value in JSON
at JSON.parse
at renderCollectionItems

The error occurs inside the Sitejet JavaScript bundle (app.bundle...js).

EXPECTED RESULT

The collection renders normally, including the dynamic images.

ANY ADDITIONAL INFORMATION

Additional observations​

The problem only occurs when a dynamic image is present in the collection template.

If the dynamic image is removed (or changed to a static image), the collection renders normally.

The issue only occurs on the page where the change is actually made; other pages with collections remain unaffected, until a similar minor text change (or any change) is made and the site republished.

Because a previously published version continues to work until it is republished, this appears to be a regression in the publishing/output generation process rather than an issue with the collection data itself.

Please let me know if you would like the project URL or temporary access to reproduce the issue.

YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
Hello, @nextdoordigital . Could you please provide a URL that shows the described issue? Thank you in advance.

Well, I'm not sure to what extend it 'shows' the issue, because the entire collection isn't displayed. But in the browser console, at least you can see the error:

Uncaught (in promise) SyntaxError: Expected ',' or '}' after property value in JSON at position 22 (line 1 column 23)
at JSON.parse (<anonymous>)
at f (app.bundle.1785311956.js:2:47477)
at app.bundle.1785311956.js:2:55876
at Array.forEach (<anonymous>)
at app.bundle.1785311956.js:2:55855
at Array.forEach (<anonymous>)
at u.renderCollectionItems (app.bundle.1785311956.js:2:55717)
at app.bundle.1785311956.js:2:55218

Here's a very rudimentary site with the issue: dev.bobv.org - Berlin

Hope this helps!
 
One more thing:

- When restoring a backup of an older version, and publishing it, the collections still load.
- When making any change to the restored backup - no matter how unrelated, small and inconsequential - and then publishing, the collection stops loading altogether.
 
Here's an example from a different angle:

1. I've created a completely new site, made by the AI from scrach, so I'm sure it's not me using botched images or something
2. I've added a Collection listing on the home page using the existing (default) collection "Blog". I've used a headline and an image.
3. After publishing, the collection was not shown.
4. I then set the image to static instead of dynamic, published again, and the images load fine (always the first image from the collection, which automatically became the static image)

My conclusion, there's something amiss in the script that loads dynamic images.

 
Back
Top