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

[4.0] Unable to initialize field without Element #181

Closed
ryssbowh opened this issue Feb 29, 2024 · 2 comments
Closed

[4.0] Unable to initialize field without Element #181

ryssbowh opened this issue Feb 29, 2024 · 2 comments
Assignees
Labels

Comments

@ryssbowh
Copy link

Description

When initializing ckeditor with this sort of code :

use craft\ckeditor\Field;

$config = [
    'type' => Field::class,
    'name' => 'Body',
    'handle' => 'body',
    'ckeConfig' => $ckeConfig
];
$field = \Craft::$app->fields->createField($config);
return $field->getInputHtml($someValue, null);

And passing null as element, an Error exception is thrown on line 883: $value = $this->_prepNestedEntriesForDisplay($value, $element->siteId, $static); as the $element is null

Additional info

  • Craft version: 5.0.0-beta.3
  • PHP version: 8.2
@i-just
Copy link
Contributor

i-just commented Mar 4, 2024

Hi, thanks for reporting! I raised a PR for this.

@brandonkelly
Copy link
Member

CKEditor 4.0.0-beta.8 is out with a fix for this (#182).

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

3 participants