-
Notifications
You must be signed in to change notification settings - Fork 638
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
Live Preview: Disabled matrix blocks still appear #1576
Comments
Just noticed that you have already fixed this on Craft 3 (#13). If you'd like to port your fix back to Craft 2, I'd love to have this fixed, but otherwise you can close this issue. |
Just fixed this for Craft 2 as well. |
good man ;) |
Hey Brandon - not sure if this was a side effect of this fix being put in (as i don't recall this behaviour previously), but if I am editing a draft, and view the tokenized preview link, it still shows the disabled Matrix blocks on the page? Live preview behaves as expected, disabled blocks don't show. |
@michaelroper Drafts are separate from Live Preview. Can you post as a new issue? |
@brandonkelly Hi there! I'm still experiencing this issue on Craft 2.6.3015 - I've disabled a neo module (using https://github.com/benjamminf/craft-neo) and it's still appearing in the Live Preview. Any ideas? |
@kblizeck You’ll have to post that at https://github.com/benjamminf/craft-neo/issues, thanks! |
@brandonkelly Oh yea.... Thank you! |
@alexbech are you doing anything special when querying for Matrix blocks in your template, besides just |
@brandonkelly I'm eager-loading an image like this:
|
It's seems to be related to the eager-loading - took it out, and that fixed the problem. |
Yeah… when you eager-load the Matrix blocks, the posted blocks will be overridden with the eager-loaded ones. That seems like something we could make a special case for though. Will look into it. |
Great, this seems to do the trick - but it's a bit convoluted:
|
Yep. This was an easy fix - feel free to patch your install with the changes in f44907b while you wait for the next v2 release to go out. |
Great, thanks for the prompt response! |
Description
Matrix blocks continue to appear in live preview, even when disabled. They don't appear on the front-end (live site) only in live preview.
Note also that (in live preview) they continue to register as part of matrix field's "length". So even if all of the blocks in a matrix field were disabled, if you were checking against the length of that field to hide/show something, it would display even though no blocks were enabled, so the field's "length" should be 0.
Steps to reproduce
The text was updated successfully, but these errors were encountered: