Cms: Live Preview issue with matrix blocks

Created on 9 Oct 2020  路  4Comments  路  Source: craftcms/cms

Description

This bug report is likely to be in relation to the plugin Spoon, but I'm putting this here to see if there is something bigger going on with live preview.

The issue is that when I try and add a new matrix block to an entry it is only displaying one type of block. Initially, live preview can show all of the content that was added to an entry but then as soon as I add a new block it refreshes and will only register one specific type. I have blocks like image, copy, columns, etc... and in this case only registers they type "copy".

What happened was Craft was updated from 3.4.20 to 3.5.11.1 and then an additional field was needed for one of the matrix blocks so I created a field with the Position plugin. I proceeded to add the field using the spoon settings and realized nothing was editable until I saw there was an update to Spoon for 3.6.0. I upgraded added the field and then edited the entries that needed the new setting. It was after that I realized a common pattern that the only block I had changed was the copy matrix block and now is the only one that will register when attempting to add a new block.

Clicking save will update the entry with new content and be viewable from the frontend. Sometimes when clicking publish changes will allow the new preview to render correctly sometimes it still just shows the one block type. I've also had to leave and go back to the entries section of the admin and click back in to have the preview work again.

I have since updated Craft 3.5.12.1 to see if that would help and it did not.

Steps to reproduce

  1. Start with Craft 3.4.20 and Spoon 3.5.2 with matrix blocks created for content
  2. Updated Craft to 3.5.11.1 and Spoon to 3.5.3
  3. Added a Position field to copy block
  4. Update Spoon to 3.6.0
  5. Added field to only the copy block
  6. Edit an entry with multiple matrix blocks in place already
  7. Open live preview and add a new block
  8. Issue happens for me and only the copy block displays

Additional info

  • Craft version: Craft Pro 3.5.12.1
  • PHP version: 7.2.31
  • Database driver & version: MySQL 5.7.20
  • Plugins & versions:
    Amazon S3 1.2.11
    Asset Rev 6.0.2
    EZMap 1.0.1
    Freeform 3.8.1
    Icon Picker 1.1.9
    ImageOptimize 1.6.17
    Migration Assistant 3.2.1
    Minify 1.2.10
    Navigation 1.3.29
    Position Fieldtype 1.0.16
    Redactor 2.8.1
    Retour 3.1.41
    SEOmatic 3.3.18
    Spoon 3.6.0
    Sprout Active 2.2.0
    Super Table 2.6.3
    Twigpack 1.2.6
    Video Embedder 1.1.4
    Wordsmith 3.3.0.1
bug

All 4 comments

If you reload the draft鈥檚 edit page, do all of your blocks still show up, along with whatever changes you just made?

Yes. All of the blocks still show and changes exist but the preview doesn't display all of the blocks. It will only show the matrix block type "copy".

This sounds like it might be similar to #6902, where something (e.g. the SEO Description Source setting in SEOmatic) is applying parameters to the Matrix block query, which are still applied when the page template is rendered.

Thank @brandonkelly, it looks like that did the trick.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

angrybrad picture angrybrad  路  3Comments

leigeber picture leigeber  路  3Comments

davist11 picture davist11  路  3Comments

bitboxfw picture bitboxfw  路  3Comments

timkelty picture timkelty  路  3Comments