[5.x]: "Save as a new draft" drops all nested entries (Matrix content) from the new draft
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Start by tracing the “Save as a new draft” flow through elements/duplicate and compare it with Drafts::createDraft() and NestedElementManager::maintainNestedElements(). Reproduce the steps with a Matrix field and check whether the new draft receives nested entries and elements_owners rows; done means those entries are preserved.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened?
Description
When you use "Save as a new draft" from an explicitly created draft, the new draft keeps the title and other plain fields, but every Matrix field comes up empty. The original draft and the canonical entry aren't affected.
We've reproduced this on three unrelated sites, none of which have custom code that touches drafts, duplication, or nested element ownership:
- 5.11.5.1
- 5.11.2 (a draft with 11 Matrix blocks produced a new draft with 0)
- 5.10.4.1
The new draft gets no elements_owners rows. It looks like NestedElementManager::maintainNestedElements() skips nested elements for drafts and expects Drafts::createDraft() to copy them, but "Save as a new draft" goes through elements/duplicate instead, so nothing copies them.
On an entry with a Neo field (Neo 5.5.13), the same action returns a 500 instead: "The source element must be canonical."
Steps to reproduce
- Open a published entry that has a Matrix field with a few nested entries.
- Create a draft of it, then save the draft.
- From that draft, choose "Save as a new draft" from the save menu.
- Look at the Matrix field on the new draft.
Expected behavior
The new draft contains the same nested entries as the draft it was created from.
Actual behavior
The new draft's Matrix field is empty. The title and non-nested fields carry over.
Craft CMS version
5.11.5.1 (also reproduced on 5.11.2 and 5.10.4.1)
PHP version
8.4.10
Operating system and version
Linux (DDEV)
Database type and version
MySQL 8.0.40
Image driver and version
Imagick 3.8.0 (ImageMagick 6.9.11-60)
Installed plugins and versions
These are from the 5.11.5.1 site, which is the one the environment details above describe.
- Amazon S3 2.3.2
- Amazon SES 3.1.0
- CKEditor 4.11.4
- Feed Me 6.11.0
- Google Maps 5.2.3
- Icon Picker 3.1.6
- Imager X 5.2.1
- Imager X AWS Serverless Transformer 3.0.2
- JWT Authorization 5.0.1
- Password Policy 5.1.3
- RESTful API 5.0.0
- Retour 5.0.14
- Scout 6.0.0
- SEOmatic 5.1.22
- Sprig 3.7.3
- Table Maker 5.0.7
- Typogrify 5.0.3
- Video Picker 2.1.6
- Vite 5.0.2
- Lingua principale
- PHP
- Stelle
- 3.6k
- Fork
- 712
- Merge medio
- 13h 5m
- PR unite (30g)
- 328
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di craftcms/cms
-
bug repo:cms
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
craftcms/cms#20248 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug repo:cms
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
craftcms/cms#20205 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[6.x]: Element index View menu: sort direction buttons only update after the table has loadedApertabug repo:cms
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
craftcms/cms#20203 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[5.x]: Moving an asset with “Replace it” throws TypeError: volumeUid must be of type string, null givenForse già presa @i-just l’ha presa 5 giorni fa. Apertabug repo:cms
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
craftcms/cms#20128 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
bug repo:cms
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
craftcms/cms#20204 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di craftcms/cms
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Recognise PHP_CodeSniffer (`phpcs`) as a linterForse già presa @HarshRajSinghania l’ha presa oggi. Apertaenhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
MustacheCase/zanadir#507 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
humanmade/query-filter#76 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
jwage/phpamqplib-messenger#163 ·