newism / craft3-fields

Address, telephone, email, embed and gender fields for CraftCMS 3.x
Other
54 stars 16 forks source link

[Bug] - Draft field value reset on Craft 3.6 and PHP 7.4 #62

Closed sidedwards closed 7 months ago

sidedwards commented 3 years ago

⚙️ System settings

Craft CMS: 3.6.10 PHP: 7.4.16

🐛 Bug description

With Craft 3.6 and PHP 7.4, when a new draft is created for an Entry with the NSM Embed field, blocks with field values after the embed field get reset.

👣 Reproduction steps

Steps to reproduce the behavior:

  1. Create an Entry with the NSM Embed field.
  2. Click on 'Create a draft'.
  3. While viewing the draft, click on another site and then go back to the original site.
  4. See error. Draft field values after the embed field are reset.

Resources

https://user-images.githubusercontent.com/11489608/110871980-a9c19300-828c-11eb-9551-2ccb3ba69087.mp4

leevigraham commented 3 years ago

Hmm that's super weird… I'll check it out over the weekend.

sidedwards commented 3 years ago

Hi @leevigraham, any update on this? We're still experiencing this issue. I'm pretty sure https://github.com/newism/craft3-fields/issues/45 is related.

Similarly, when an NSM field is within a nested field (i.e., Matrix, Neo, etc.) it does not correctly apply draft values to the entry. This occurs for most NSM fields with the exception of Email. Additionally, it doesn't seem to matter what the nested parent's localization pattern is; it occurs for both localized and non-localized parent blocks.

Steps to reproduce the behavior:

  1. Add NSM field within a nested block.
  2. "Create a draft" and add values to NSM fields.
  3. Publish draft.
  4. See error. NSM field values from draft are not present in Entry.
leevigraham commented 3 years ago

Haven't looked into it yet. I'm running a 3.7 update today so I'll check at the same time.

leevigraham commented 2 years ago

@sidedwards I think I've finally figured this out. Can you try v1.0.4 if you're still using the plugin: https://github.com/newism/craft3-fields/releases/tag/1.0.4