We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f359fd8 commit 9aa5872Copy full SHA for 9aa5872
easyblog/easyblog/category.php
@@ -36,12 +36,20 @@ public function get() {
36
$search = $input->get('search', null, 'STRING');
37
$posts = array();
38
39
+
40
+ if (!isset($id)) {
41
+ $categoriesmodel = EasyBlogHelper::getModel( 'Categories' );
42
+ $categories = $categoriesmodel->getCategoryTree('ordering');
43
+ $this->plugin->setResponse( $categories );
44
+ return;
45
+ }
46
47
$category->load($id);
48
49
// private category shouldn't allow to access.
50
$privacy = $category->checkPrivacy();
51
- if(! $privacy->allowed )
52
+ if(!$category->id || ! $privacy->allowed )
53
{
54
$this->plugin->setResponse( $this->getErrorResponse(404, 'Category not found') );
55
return;
0 commit comments