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

The convert command doesn't find Redactor fields in super table fields nested in matrix fields #109

Open
MoritzLost opened this issue Jun 14, 2023 · 9 comments
Labels

Comments

@MoritzLost
Copy link
Contributor

MoritzLost commented Jun 14, 2023

Description

I just noticed that Redactor fields inside Super Table fields inside Matrix fields are not converted by the ckeditor/convert command. Looks like the command can't find those fields, because they don't show up in the output of the command at all. Regular Super Table fields (not nested inside Matrix fields) work fine.

Edit: I was wrong, the nested fields do show up and they are even converted correctly in the config/project/ folder. However, the changed config is not applied to the database for some reason, so the field still shows up as a Redactor field in the field settings. Running php craft project-config/apply --force fixes this, after that the field correctly shows up as a CKEditor field.

Can this be fixed inside the command? Or is this a Super Table issue?
In the meantime, it would probably be a good idea to add a note regarding this issue and the workaround to the README.

Steps to reproduce

  1. Install the Super Table plugin.
  2. Create a matrix field and add a new block type. Inside the block type, add a Super Table field. Inside the Super Table field, add a Redactor field.
  3. Run php craft ckeditor/convert. The YAML file inside config/project/superTableBlockTypes/ will be updated correctly. But the field will still show up as a Redactor field in the field settings in the backend.
  4. Run php craft project-config/apply --force. Now the field settings in the backend should correctly show the field as a CKEditor field.

Additional info

  • Craft version: 4.4.13
  • PHP version: 8.2
  • Database driver & version: MySQL 8.0.32
  • Plugins & versions: CK Editor 3.4.0
@MoritzLost MoritzLost added the bug label Jun 14, 2023
@brandonkelly
Copy link
Member

I wasn’t able to reproduce this locally. Is it still happening for you?

@MoritzLost
Copy link
Contributor Author

@brandonkelly Sorry for the late reply!

Yes, I'm still seeing this issue. Note it only occurs in this specific setup (Redactor field inside a Super Table field inside a Matrix field). After running ckeditor/convert, even though the field shows up in the list of converted fields, after reloading the settings page for the Matrix field, the nested field still shows a Redactor field. Only after running project-config/apply --force does it show up as a CKEditor field. So the project config is correctly modified, it's only not fully applied to the current environment. Not a huge issue, but still annoying and can potentially cause confusion.

@chrismlusk
Copy link

I also experienced this issue when running ckeditor/convert. Running project-config/apply --force resolved it, but yes, it was confusing. A note in the README would have been useful.

@brandonkelly
Copy link
Member

Running project-config/apply --force should not be necessary. Any chance either of you could share a database backup from before running ckeditor/convert, plus your composer.json file? If so please send to [email protected].

@MoritzLost
Copy link
Contributor Author

@brandonkelly Can't share a DB backup unfortunately :/

I'm still seeing the issue on the latest Craft & CKEditor versions. It's only happening with the specific field setup (Matrix field with a block type that contains a Super Table field, which in turn contains a Redactor field). Did you try to reproduce with that exact field setup?

Not super important I guess since it's just a one-time operation to fix it.

@TheFunkyMonk
Copy link

Running project-config/apply --force should not be necessary. Any chance either of you could share a database backup from before running ckeditor/convert, plus your composer.json file? If so please send to [email protected].

We experienced the same issue, just shared those files via email.

@TheFunkyMonk
Copy link

Update: rebuilding project config with php craft project-config/rebuild resolved this issue for us!

@jenibelle08
Copy link

Likewise, this error just happened with us, with a Matrix field with a block type that contains a Super Table field. We'll send over the files if/when it happens again.

@nikolowry
Copy link

nikolowry commented Aug 20, 2024

Be great to add a little notice to the README until someone figures out a fix. Not fun having a panic attack during an upgrade and needing to dig-through GitHub bugs


EDIT: project-config/apply --force helped some, but still missed about ~10 Matrix/SuperTable fields. Had to open up every field to validate, which kind of defeats the purpose of having a migration in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants