diff --git a/src/Listeners/GetCategoriesFieldSchema.php b/src/Listeners/GetCategoriesFieldSchema.php index e2bc8239..9812c3de 100644 --- a/src/Listeners/GetCategoriesFieldSchema.php +++ b/src/Listeners/GetCategoriesFieldSchema.php @@ -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'])) {