Skip to content

Commit

Permalink
Merge pull request #364 from craftcms/bugfix/359-source-editing-group…
Browse files Browse the repository at this point in the history
…s-can-be-null

`sourceEditingGroups` can be null too
  • Loading branch information
brandonkelly authored Feb 18, 2025
2 parents 4af3244 + 6fa6292 commit ceee4a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for CKEditor for Craft CMS

## Unreleased

- Fixed an error that occurred if the “Who should see the ‘Source’ button?” field setting was totally blank. ([#359](https://github.com/craftcms/ckeditor/issues/359))

## 3.11.0 - 2025-01-23

- CKEditor fields no longer have extra bottom padding, and the CKEditor logo is now displayed over the bottom border. ([#252](https://github.com/craftcms/ckeditor/pull/252))
Expand Down
4 changes: 4 additions & 0 deletions src/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,10 @@ private function isSourceEditingAllowed(User $user): bool
return true;
}

if ($this->sourceEditingGroups === null) {
return false;
}

$sourceEditingGroups = array_flip($this->sourceEditingGroups);

if ($user->admin && isset($sourceEditingGroups['__ADMINS__'])) {
Expand Down

0 comments on commit ceee4a7

Please sign in to comment.