diff --git a/com_oauthserver/administrator/src/Model/ClientsModel.php b/com_oauthserver/administrator/src/Model/ClientsModel.php index a3c34f2..8ccd7d3 100644 --- a/com_oauthserver/administrator/src/Model/ClientsModel.php +++ b/com_oauthserver/administrator/src/Model/ClientsModel.php @@ -84,6 +84,44 @@ class ClientsModel extends ListModel return parent::getStoreId($id); } + /** + * @inheritDoc + * @since version + */ + public function getItems() + { + $result = parent::getItems(); + + if (!$result) + { + return $result; + } + + // Get a storage key. + $store = $this->getStoreId(); + + /** @var \stdClass $row */ + foreach ($result as &$row) + { + // Convert `public` field to bool + $row->public = !empty($row->public); + + if (!empty($row->scopes)) + { + $row->scopes = json_decode($row->scopes, true); + } + + if (!empty($row->grants)) + { + $row->grants = json_decode($row->grants, true); + } + } + + $this->cache[$store] = $result; + + return $this->cache[$store]; + } + /** * Method to get a DatabaseQuery object for retrieving the data set from a database. *