-
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
[4.x]: Matrix blocks not propagated properly when blocks contain link plugin field #12858
Comments
I'm investigating this issue as well. I've shortened the reproduction slightly:
Here's a video The only thing that looks fishy to me is the request payload at step 4 as soon as you pick "Site B" from the status (the initial propagation to the other site):
So what's interesting here is that I'm just trying to figure out what's the correct thing here. Firstly, it seems incorrect that the field is being marked as changed on "Site A" when I've done nothing to change that value. I've only propagated a new entry on "Site B". Next, Hyper (and other fields) seem to be doing the correct thing here by copying the content from "Site A" to the new entry in "Site B", and it's everything else that seems to be incorrect. Is that right? Or should a new entry in another site have empty content? |
This can also be confirmed by simplifying the Hyper field to remove all Vue components and reduce it to a single text field for the Link Text. This at least helps isolate things. Again, in Step 4 where I've just picked the other site to add the entry to, you can see the changed content is registered for the Matix field overall, the Hyper field, but not the Text field. Technically, Hyper is in the wrong here, as the content hasn't changed, so I (and the other plugins) are possibly doing something wrong. After more testing, if I change the value of the Hyper field to be a simple value, and not a |
And just to simplify it even further (or maybe I'm going down the wrong path here), is that fields are incorrectly marked as being modified on "Site A" when all I've done is propagate to "Site B" - even when outside of a Matrix field. After more testing, if I change the value of the Hyper field to be a simple value, and not a I did pick up on the below check which thought might be the key to this but omitting it doesn't do anything. Lines 1488 to 1493 in 73771c5
|
The culprit here was these lines: cms/src/fieldlayoutelements/CustomField.php Lines 259 to 261 in 0f27b72
Which tell the element editor to ignore whatever the input’s actual initial post value is, and pretend it was null, if the field type’s That logic was originally added in d13a51f, to fix a bug where Dropdown fields that had no value weren’t getting their default option to be selected on save, despite it looking like it was, because the input value on save matched what it was on initial page load (#5632). But that’s actually not needed anymore as of 4.4, thanks to e2eb651, which adds a blank option to Dropdown fields that don’t have a value yet (#12235). So those lines have been removed for the next release, and now Hyper (and theoretically similar fields) now behaves as expected – only being seen as modified when the post data actually changes. |
Thanks for the investigation @brandonkelly ! |
4.4.2 is out with that change! |
What happened?
Description
Seeing a strange issue where Matrix blocks are missing after propagating to another entry. The strange part is that I can only reproduce when the entry contains an entry Typed Link Field, LinkIt or Hyper field. I’m not able to reproduce when the entry only contains blocks with native fields.
Seems related to sebastian-lenz/craft-linkfield#233
Steps to reproduce
Expected behavior
All blocks will be propagated
Actual behavior
Only the link fields are propagated
screenshot_2023_03_10._11.34.mp4
Craft CMS version
4.4.1
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: