Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-6490

Blocks that use code splitting not rendered in preview mode unless the post had the block before edits

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Merged
    • Icon: Should have Should have
    • 2.68.1
    • None
    • 3
    • Blocks (all)

      We use the has_block function to conditionally enqueue front end scripts for some of our blocks, which allows us to avoid serving the script if no block on the page needs it.

      However this function doesn't work as expected in preview mode, which caused these blocks to not be displayed. The function seems to look for the block in the published version of the post, and not in the preview.

      We fixed this by always serving all split scripts in preview mode.

            pvincent Pieter Vincent
            pvincent Pieter Vincent
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: