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

Changed Matrix fields in drafts don't show up on edit screen since eb5dc9f #4105

Closed
d--j opened this issue Apr 5, 2019 · 7 comments
Closed

Comments

@d--j
Copy link
Contributor

d--j commented Apr 5, 2019

Description

The commit eb5dc9f broke saving entry drafts with matrix fields. Changes to matrix fields do get saved to the draft (are part of the [[entrydrafts.data]] column's JSON) but they do not get shown on the edit form anymore and thus are lost when the draft will get re-saved or published.

Steps to reproduce

  1. Create a section with a matrix field (Use the Architect JSON to speed things up)
  2. Create a new entry
  3. Create a new draft for this entry, change or add something in a matrix field
  4. Save the draft. Your changes to the matrix field are not there anymore on the edit screen.
  5. Bonus (If you have a template assigned): Click "Share" and see your changes on the frontend.

Additional info

  • Craft version: 3.1.21 and 3.1.21.1
  • PHP version: 7.2
  • Database driver & version: MySQL
  • Plugins & versions: not relevant

Here is an Architect JSON for your tests:

{
    "fieldGroups": [
        "Common"
    ],
    "sections": [
        {
            "name": "Test Section",
            "handle": "testSection",
            "type": "structure",
            "enableVersioning": true,
            "maxLevels": null,
            "siteSettings": [
                {
                    "hasUrls": true,
                    "uriFormat": "test-section\/{slug}",
                    "template": "",
                    "enabledByDefault": true
                }
            ]
        }
    ],
    "fields": [
        {
            "group": "Common",
            "name": "Test Matrix",
            "handle": "testMatrix",
            "instructions": "",
            "type": "craft\\fields\\Matrix",
            "minBlocks": "",
            "maxBlocks": "",
            "localizeBlocks": false,
            "blockTypes": [
                {
                    "name": "Test Block",
                    "handle": "testBlock",
                    "fields": [
                        {
                            "required": false,
                            "name": "Test Field",
                            "handle": "testField",
                            "instructions": "",
                            "type": "craft\\fields\\PlainText",
                            "typesettings": {
                                "placeholder": "",
                                "code": "",
                                "multiline": "1",
                                "initialRows": "4",
                                "charLimit": "",
                                "columnType": "text"
                            }
                        }
                    ]
                }
            ]
        }
    ],
    "entryTypes": [
        {
            "sectionHandle": "testSection",
            "name": "Test Section",
            "handle": "testSection",
            "hasTitleField": true,
            "titleLabel": "Titel",
            "titleFormat": "",
            "fieldLayout": {
                "Tab 1": [
                    "testMatrix"
                ]
            }
        }
    ]
}
@brandonkelly
Copy link
Member

Thanks for reporting that and tracking down the culprit! Fixed for the next release.

@EFWall
Copy link

EFWall commented Apr 23, 2019

Hello @brandonkelly and everyone -- I still experience this problem in at least the following situation --

When the field is inside a matrix block which is a part of a matrix that is inside a Super Table which is, itself, inside a block of a matrix.

I haven't tested all possible combinations of super tables and matrix fields. I will report back if I get further specificity. But for now, I wanted to report there are still issues in these more complex field structures (our site contains a LOT of these).

Any thoughts?

=======

Update -- I did a little more testing and the only field configuration on our site for which I can replicate the problem is when there is a matrix inside a super table, inside another matrix.

@d--j
Copy link
Contributor Author

d--j commented Apr 24, 2019

@EFWall did you update Super Table to 2.1.17+ Super Table fields had the same bug as Matrix field – that should have been fixed in that version.

@EFWall
Copy link

EFWall commented Apr 24, 2019

@d--j yes we are on SuperTable 2.1.17. However, I see they just posted 2.1.18 and it claims to fix an issue related to SuperTables nested inside matrix fields. We will update to that version and see if it resolves the issue.

@EFWall
Copy link

EFWall commented Apr 24, 2019

@d--j @brandonkelly we just updated to Craft 3.1.24 and SuperTable 2.1.18 and the issue still persists.

@brandonkelly
Copy link
Member

@EFWall can you send in your composer.json and composer.lock files, and a database backup, to [email protected] ?

@EFWall
Copy link

EFWall commented Apr 26, 2019

@brandonkelly done. Thanks!

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

3 participants