Something went wrong.

Trying to get property 'id' of non-object.
Trying to get property 'id' of non-object on line 125 in /home/web-project.uk/billing.web-project.uk/plugins/support_manager/controllers/knowledgebase.php
UnknownException::setErrorHandler
Line 232

/home/web-project.uk/billing.web-project.uk/vendors/monolog/monolog/src/Monolog/ErrorHandler.php

Monolog\ErrorHandler->handleError
Line 125

/home/web-project.uk/billing.web-project.uk/plugins/support_manager/controllers/knowledgebase.php

Knowledgebase->index
Line 142

/home/web-project.uk/billing.web-project.uk/vendors/minphp/bridge/src/Lib/Dispatcher.php

Dispatcher::dispatch
Line 21

/home/web-project.uk/billing.web-project.uk/index.php

93
        $category = null;
94
        $logged_in = $this->isLoggedIn();
95
        if ($current_category_id !== null
96
            && ($category = $this->SupportManagerKbCategories->get($current_category_id))
97
        ) {
98
            // This category cannot be viewed if it is hidden, and is only accessible to users that are logged in
99
            if ($category->company_id != $this->company_id || $category->access == 'hidden'
100
                || ($category->access == 'private' && !$logged_in)
101
            ) {
102
                $category = null;
103
            }
104
        }
105
 
106
        // Fetch popular articles on the home/overview page
107
        $access = array_merge(['public'], ($logged_in ? ['private'] : []));
108
        if ($category === null) {
109
            // Fetch the popular articles
110
            $popular_articles = $this->SupportManagerKbArticles->getPopular(
111
                $this->company_id,
112
                null,
113
                $access,
114
                (int)Configure::get('SupportManager.max_kb_popular_articles')
115
            );
116
 
117
            // Set the article content language to use into the article
118
            foreach ($popular_articles as &$article) {
119
                $article = (object)array_merge((array)$article, (array)$this->getArticleContent($article));
120
                $article->uri_title = $this->getArticleTitleUri($article);
121
            }
122
            $this->set('popular_articles', $popular_articles);
123
        } else {
124
            // Fetch articles from this category
125
            $articles = $this->SupportManagerKbArticles->getAll($this->company_id, $category->id, $access);
126
 
127
            // Set the article content language to use into the article
128
            foreach ($articles as &$article) {
129
                $article = (object)array_merge((array)$article, (array)$this->getArticleContent($article));
130
                $article->uri_title = $this->getArticleTitleUri($article);
131
            }
132
            $this->set('articles', $articles);
133
        }
134
 
135
        // Only show breadcrumbs on subcategory pages
136
        if ($category) {
137
            $this->setBreadCrumbs($category);
138
        }
139
 
140
        $this->set(
141
            'categories',
142
            $this->SupportManagerKbCategories->getAll($this->company_id, $current_category_id, false, $access)
143
        );
144
        $this->set('current_category', $category);
145
        $this->setSearchBar();
146
    }
147
 
148
    /**
149
     * List article results
150
     */
151
    public function search()
152
    {
153
        $logged_in = $this->isLoggedIn();
154
        $access = array_merge(['public'], ($logged_in ? ['private'] : []));
155
        $page = (isset($this->get[0]) ? (int)$this->get[0] : 1);
156
        $total_results = 0;
157
        $search = '';