Skip to content

Commit

Permalink
Merge pull request #1 from ashtonlance/master
Browse files Browse the repository at this point in the history
Cherrypick fix for categories
  • Loading branch information
Mike Pierce authored Dec 10, 2019
2 parents caa1264 + deed95b commit 3719a96
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Listeners/GetCategoriesFieldSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ function handle(GetFieldSchema $event) {
->type($inputObject)
->lists()
->onSave(function ($values) use ($groupId) {
$group = Craft::$app->getCategories()->getGroupById($groupId);
if (!is_numeric($groupId)) {
$group = Craft::$app->getCategories()->getGroupByUid($groupId);
} else {
$group = Craft::$app->getCategories()->getGroupById($groupId);
}

foreach ($values as &$value) {
if (!empty($value['id']) && is_numeric($value['id'])) {
Expand Down

0 comments on commit 3719a96

Please sign in to comment.