Matrix blocks with multiple redactor fields aren't all converted
Description
If a matrix block contains more than 1 redactor field, running php craft ckeditor/convert will only convert 1 of them. Note that they all seem to be converted in the project config so running the command again doesn't find them, however, only 1 of them is actually converted in the database.
Steps to reproduce
- Create a matrix field with a single block containing 2
redactorfields - Run
php craft ckeditor/convert
Additional info
- Craft version: 4.13.8
- PHP version: 8.2.27
- Database driver & version: MariaDB 10.11.10
- Plugins & versions: Redactor 3.1.0, CKEditor 3.10.0
I’m experiencing the same issue mentioned here. Additionally, I've noticed that after running the command:
php craft ckeditor/convert/redactor
all previously enabled/selected asset volumes in Redactor fields are being deselected. This results in broken links for content that was previously set up using the Redactor fields.
In my circumstance, I think the asset volume issue might stem from the migration process from Craft 3 to Craft 4. During the migration, filesystem configurations silently fail to be created, which likely caused the asset volumes settings within the newly converted ckeditor fields to be omitted completely. I made an issue over on the Craft CMS repo about this, you can find that here.
Additionally, I found this stack overflow post which describes the migration issue, but it unfortunately doesn't have any solutions.
Just to follow up: I've fixed the issue about the filesystems not being automatically created. This had to do with there being deprecated syntax located within my projects general.php file. Once those were addressed, I ran php craft migrate/all and filesystems were successfully created.
However, the main issue this post references is still at play. All ckeditor fields located within matrix fields are now missing content, regardless if there are one or more ckeditor fields existing in a single block.
Could you please try what’s described in this comment: https://github.com/craftcms/ckeditor/issues/301#issuecomment-2503058615?
@jpcarpenter, you could also try doing your 3 -> 4 upgrade first, and once that’s done and everything works as expected, do the Redactor to CKEditor conversion.
@i-just that worked! Just to recap for anyone in the future: I resaved all entries via ddev craft resave/entries, then I also resaved all matrix block fields which had redactor fields via ddev craft resave/matrix-blocks --field=myFieldHandle. Once those were complete, I ran and went through the process of converting redactor fields to ckeditor fields via ddev craft ckeditor/convert/redactor.
I had the same issue. Combining ideas from a few related issues, it worked after I ran:
-
craft resave/entries -
craft project-config/rebuild -
craft resave/matrix-blocks --field=myFieldHandlefor each matrix field -
craft ckeditor/convert/redactor
Hi. I have the same issue, and after trying the steps above my project-config have updated the redactor fields inside my matrix blocks, but after checking the UI i Craft some of the fields are still redactor fields
Added images of one block inside a matrix that had two redactor fields, textRigth and textLeft, and in the project-config it looks like they both have been migrated, but checking the article with the block shows that textLeft is still a redactor field
Linked issue: https://github.com/craftcms/ckeditor/issues/432