Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1787 doesn't seem fixed: Live Preview doesn't update eager-loaded matrix fields #4873

Closed
MattWilcox opened this issue Sep 2, 2019 · 2 comments

Comments

@MattWilcox
Copy link

MattWilcox commented Sep 2, 2019

Description

This issue has been closed: #1787

This does not appear to be fixed in 3.3.0.1; I have exactly the same issue as always; when a Matrix is eager loaded, the live preview does not reflect updates to the changes in a Matrix field.

Sample code that is not working with Live Preview:

{% do eagerLoadElements(entry, [
'mixedContent.images:images',
'mixedContent.entries:entries.listingImage',
'mixedContent.files:files'
]) %}

{% for block in entry.mixedContent.all() %} {% include '_partials/mixedcontent/' ~ block.type ignore missing %} {% endfor %}

Steps to reproduce

  1. Create a template with the above code and associated Matrix field
  2. Go to Live Preview and edit the content of the Matrix
  3. Watch the page flash, but no changes be reflected

Additional info

  • Craft version: 3.3.0.1
  • PHP version: 7.2
@brandonkelly
Copy link
Member

brandonkelly commented Sep 4, 2019

@MattWilcox whatever your eagerLoadElements function is doing (that’s not a standard Craft function), it’s not actually eager-loading anything from the looks of it, otherwise you would be getting an error when you try to do entry.mixedContent.all(). Once mixedContent is eager-loaded, it will return an array, not an element query object with an all() method.

@MattWilcox
Copy link
Author

@brandonkelly Thanks! You have just uncovered a snippet of code that I've just pulled over from my Craft2 builds and forgot was not standard. It's from Eager Beaver... https://github.com/nystudio107/eagerbeaver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants