Skip to content

Commit

Permalink
Merge pull request #3 from ashtonlance/master
Browse files Browse the repository at this point in the history
Add conditional to check if Group ID is int or uid. Thanks @ashtonlance
  • Loading branch information
svale authored Dec 4, 2019
2 parents 8ecfd64 + deed95b commit 5806286
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 5806286

Please sign in to comment.