ckeditor icon indicating copy to clipboard operation
ckeditor copied to clipboard

Matrix blocks with multiple redactor fields aren't all converted

Open brucejxz opened this issue 1 year ago • 6 comments

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

  1. Create a matrix field with a single block containing 2 redactor fields
  2. 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

brucejxz avatar Jan 03 '25 20:01 brucejxz

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.

jpcarpenter avatar Jan 09 '25 20:01 jpcarpenter

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.

jpcarpenter avatar Jan 10 '25 20:01 jpcarpenter

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 avatar Jan 13 '25 08:01 i-just

@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.

jpcarpenter avatar Jan 13 '25 17:01 jpcarpenter

I had the same issue. Combining ideas from a few related issues, it worked after I ran:

  1. craft resave/entries
  2. craft project-config/rebuild
  3. craft resave/matrix-blocks --field=myFieldHandle for each matrix field
  4. craft ckeditor/convert/redactor

realjoshharrison avatar Apr 07 '25 14:04 realjoshharrison

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

Image Image

Linked issue: https://github.com/craftcms/ckeditor/issues/432

torgeirbeyer avatar Jun 06 '25 08:06 torgeirbeyer