By ugenda on Friday, 18 March 2022
Replies 9
Likes 0
Views 1K
Votes 0
I can't edit an existing category. If I try to open a category for editing, I get the following error:

Call to a member function getData() on null


I can create a new category and change the order of categories. But editing is a problem.
Hello,

Can you please enable debug mode and provide the stack trace, that should explain where the issue lyes. Can you edit normal Joomla! categories?

Many thanks
Tony
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
0 Call to a member function getData() on null

administrator/components/com_jevents/fields/jevuser.php:101

Call stack
# Function Location
1 () JROOT/administrator/components/com_jevents/fields/jevuser.php:101
2 JFormFieldJEVuser->getOptions() JROOT/libraries/joomla/form/fields/list.php:58
3 JFormFieldList->getInput() JROOT/administrator/components/com_jevents/fields/jevuser.php:53
4 JFormFieldJEVuser->getInput() JROOT/libraries/src/Form/FormField.php:975
5 Joomla\CMS\Form\FormField->renderField() JROOT/layouts/joomla/edit/fieldset.php:47
6 include() JROOT/libraries/src/Layout/FileLayout.php:125
7 Joomla\CMS\Layout\FileLayout->render() JROOT/libraries/src/Layout/LayoutHelper.php:73
8 Joomla\CMS\Layout\LayoutHelper::render() JROOT/layouts/joomla/edit/params.php:123
9 include() JROOT/libraries/src/Layout/FileLayout.php:125
10 Joomla\CMS\Layout\FileLayout->render() JROOT/libraries/src/Layout/LayoutHelper.php:73
11 Joomla\CMS\Layout\LayoutHelper::render() JROOT/administrator/components/com_categories/views/category/tmpl/edit.php:73
12 include() JROOT/administrator/components/com_jevents/views/com_categories/category/tmpl/edit.php:34
13 include() JROOT/libraries/src/MVC/View/HtmlView.php:701
14 Joomla\CMS\MVC\View\HtmlView->loadTemplate() JROOT/libraries/src/MVC/View/HtmlView.php:230
15 Joomla\CMS\MVC\View\HtmlView->display() JROOT/administrator/components/com_categories/views/category/view.html.php:97
16 CategoriesViewCategory->display() JROOT/administrator/components/com_categories/controller.php:95
17 CategoriesController->display() JROOT/libraries/src/MVC/Controller/BaseController.php:702
18 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_categories/categories.php:27
19 require_once() JROOT/libraries/src/Component/ComponentHelper.php:402
20 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:377
21 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:101
22 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:159
23 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:225
24 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/index.php:51
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I'm having the same problem. (And the same debug error) Can't edit any of my categories now. I used toi be able to edit one of my 10 categories, but all of the sudden, this one is broken too. I did change the access rights to the category, but was able to edit it afterwards.
I can't find anything in the database that's different. Looked into the categories tabel and the assests table. The error suggests it has something to do with a user. Where does JEvents store the user that manages to category?
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Do you still see the error in the jevuser custom field?

What version of the custom fields addon do you have as there is no call to getData in the referenced file
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Custom fields version: 3.7.4

I don't know what you mean with the jevuser custom field?
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I don't know what you mean with the jevuser custom field?


I think I may need my eyes tested again - I missread "administrator/components/com_jevents/fields/jevuser.php" as the custom fields plugin file "jevruser.php"

There is something strange about your asset rules tables since this line refers to core.admin permissions (which is the right to managed com_categories) and implies it is not set or is empty.

There is a workaround - change line 101 of "administrator/components/com_jevents/fields/jevuser.php" to read

$creatorgroupsdata = isset($creatorgroups["core.admin"]) ? $creatorgroups["core.admin"]->getData() : array();


I'll include the change in the next release.
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I've applied your line of code, but that only shifted the error to line 103, because it seems $creatorgroups["core.admin"]->getData() is empty.

But I've managed to solve the problem myself. After multiple times comparing two tables and altering database records, the solution was much more easy: I created a new root category and moved all the current (sub)categories to the new root. And voilá the existing categories could be edited again. I have absolutely no idea what the difference is when I look at the assets or categories table*, but this can be checked off our to do list.

(*I have no idea if Joomla uses other tables for references to categories of components)
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
One question related to categories, which I came across when testing: I noticed that when I create a new category, the category admin is not set to myself as default, but to an admin that is alphabetically the first in sort order. Is that true? Or am I missing a setting?
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
For the category admin we should not be setting a default value at all - thanks for highlighting this issue.

The next release (later today) will fix this
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post