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

Error during installation – TypeError with ksort #15

Closed
MoritzLost opened this issue Jun 20, 2023 · 6 comments
Closed

Error during installation – TypeError with ksort #15

MoritzLost opened this issue Jun 20, 2023 · 6 comments

Comments

@MoritzLost
Copy link

MoritzLost commented Jun 20, 2023

Describe the bug

I'm getting an error when trying to install the plugin in a development environment. This error occurs after all the migrations have run successfully:

Screenshot 2023-06-20 at 15 33 10

Relevant logs entry:

2023-06-20 13:30:27 [web.ERROR] [craft\controllers\BaseUpdaterController::installPlugin] Plugin installation failed: ksort(): Argument #1 ($array) must be of type array, null given {"memory":9533528}

I could be wrong, but looks like it's coming from the Settings model?

https://github.com/ryssbowh/craft-emails/blob/master/src/models/Settings.php#L49

We don't have Redactor installed, so $options will be null there.

To Reproduce

  1. Try to install the plugin on a site without the Redactor plugin.

Software:

  • Emails version: 2.0.10
  • Craft version: 4.4.13
  • Email adaptor (sendgrid etc): SMTP
@ryssbowh
Copy link
Owner

The redactor plugin would be installed automatically, it's used to write html emails.
I've fixed this error on 2.0.11, so it's installable but you won't be able to create emails without at least one redactor config file

@MoritzLost
Copy link
Author

@ryssbowh Thanks for the quick resolution! I'll give that a shot later today.

Given that Redactor will reach its end of life in six months and Craft now recommends CKEditor, are there plans to switch to CKEditor for this plugin? Or maybe support different WYSIWYG fields, or even just have an option to only use plain-text fields?

@MoritzLost
Copy link
Author

@ryssbowh The fix works, thanks! I can now install the plugin normally, though as you said, I can't create any emails without having at least one Redactor config. I'm closing this issue as the error is resolved. That said, having the plugin work with other WYSIWYG editors or fallback to plaintext would be a great addition.

@theurbanu
Copy link

Given that Redactor will reach its end of life in six months and Craft now recommends CKEditor, are there plans to switch to CKEditor for this plugin? Or maybe support different WYSIWYG fields, or even just have an option to only use plain-text fields?

Any word on this?

@ryssbowh
Copy link
Owner

ryssbowh commented Jul 9, 2023

Yes CKEditor will be supported, will probably make it up to the user to select which whey want to use and disable the html fields if none is selected

@ryssbowh
Copy link
Owner

ryssbowh commented Jul 21, 2023

CKEditor support is out in 2.1.0 and 1.5.0.
The Wygiwys editor is now chosen in the config and it's up to you which you want to install.
Note that if you didn't have Redactor required in your composer.json you will need to require it manually, the plugin doesn't require it anymore

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