Error when creating new article Topic is solved

General questions relating to Joomla! 4.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
User avatar
madesign
Joomla! Intern
Joomla! Intern
Posts: 82
Joined: Fri Nov 13, 2009 12:55 pm
Contact:

Error when creating new article

Post by madesign » Tue Jan 18, 2022 11:11 am

Hello,

I am getting this error when creating a new article on fresh installation of 4.0.6.

Class 'Joomla\CMS\Categories\CategoryNode' not found

Sincerely, Michael

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 14574
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Error when creating new article

Post by toivo » Tue Jan 18, 2022 11:55 am

Change the level of error reporting in Global Configuration to 'Maximum' and turn on the Debug option, then enable the plugin System - Debug so that the error message is displayed with the location where in Joomla it comes from.
Toivo Talikka, Global Moderator

User avatar
madesign
Joomla! Intern
Joomla! Intern
Posts: 82
Joined: Fri Nov 13, 2009 12:55 pm
Contact:

Re: Error when creating new article

Post by madesign » Tue Jan 18, 2022 12:03 pm

Thank you!

# Function Location
1 () JROOT/libraries/src/Categories/Categories.php:393
2 Joomla\CMS\Categories\Categories->_load() JROOT/libraries/src/Categories/Categories.php:187
3 Joomla\CMS\Categories\Categories->get() JROOT/plugins/finder/content/content.php:322
4 PlgFinderContent->index() JROOT/administrator/components/com_finder/src/Indexer/Adapter.php:335
5 Joomla\Component\Finder\Administrator\Indexer\Adapter->reindex() JROOT/plugins/finder/content/content.php:170
6 PlgFinderContent->onFinderAfterSave() JROOT/libraries/src/Plugin/CMSPlugin.php:285
7 Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}() JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:486
8 Joomla\Event\Dispatcher->dispatch() JROOT/libraries/src/Application/EventAware.php:111
9 Joomla\CMS\Application\WebApplication->triggerEvent() JROOT/plugins/content/finder/finder.php:41
10 PlgContentFinder->onContentAfterSave() JROOT/libraries/src/Plugin/CMSPlugin.php:285
11 Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}() JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:486
12 Joomla\Event\Dispatcher->dispatch() JROOT/libraries/src/Application/EventAware.php:111
13 Joomla\CMS\Application\WebApplication->triggerEvent() JROOT/libraries/src/MVC/Model/AdminModel.php:1412
14 Joomla\CMS\MVC\Model\AdminModel->save() JROOT/administrator/components/com_content/src/Model/ArticleModel.php:834
15 Joomla\Component\Content\Administrator\Model\ArticleModel->save() JROOT/libraries/src/MVC/Controller/FormController.php:705
16 Joomla\CMS\MVC\Controller\FormController->save() JROOT/libraries/src/MVC/Controller/BaseController.php:730
17 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:146
18 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:389
19 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:143
20 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:186
21 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:278
22 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:63
23 require_once() JROOT/administrator/index.php:32

User avatar
ceford
Joomla! Guru
Joomla! Guru
Posts: 716
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Error when creating new article

Post by ceford » Tue Jan 18, 2022 9:07 pm

There is a use statement missing in the update to 4.0.6 - this is definitely a Joomla bug. I do not see the error message so it is up to someone else to report it. You could type it in yourself:

use Joomla\CMS\Categories\CategoryNode;

in libraries/src/Categories/Categories.php amongst the other use statements at the top of the file. But: if that is missing who knows what else might be wrong.

User avatar
madesign
Joomla! Intern
Joomla! Intern
Posts: 82
Joined: Fri Nov 13, 2009 12:55 pm
Contact:

Re: Error when creating new article

Post by madesign » Tue Jan 18, 2022 9:16 pm

Thanks!
You mean this line: namespace Joomla\CMS\Categories;
Do I replace it with "Joomla\CMS\Categories\CategoryNode;" or add it?

User avatar
ceford
Joomla! Guru
Joomla! Guru
Posts: 716
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Error when creating new article

Post by ceford » Tue Jan 18, 2022 9:32 pm

No! The namespace is OK. Add it before the other use statements on line 13.

User avatar
madesign
Joomla! Intern
Joomla! Intern
Posts: 82
Joined: Fri Nov 13, 2009 12:55 pm
Contact:

Re: Error when creating new article

Post by madesign » Tue Jan 18, 2022 9:46 pm

Found it:

use Joomla\CMS\Categories\CategoryNode;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Multilanguage;
use Joomla\Database\ParameterType;

But get same error.

User avatar
ceford
Joomla! Guru
Joomla! Guru
Posts: 716
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Error when creating new article

Post by ceford » Tue Jan 18, 2022 10:12 pm

Can you explain the steps you go through to generate the error? I have created articles on two J4.0.6 test sites with no errors.

Getting the same error is no big surprise - I did say what else might be wrong.

User avatar
madesign
Joomla! Intern
Joomla! Intern
Posts: 82
Joined: Fri Nov 13, 2009 12:55 pm
Contact:

Re: Error when creating new article

Post by madesign » Wed Jan 19, 2022 3:16 am

It's a new installation from yesterday. I try to create my first article and that is producing the error.
I can give you access.

User avatar
ceford
Joomla! Guru
Joomla! Guru
Posts: 716
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Error when creating new article

Post by ceford » Wed Jan 19, 2022 4:04 am

I just did a clean install of Joomla 4.0.6 newly downloaded, created an Article and Saved it. All went normally. The Smart Search / Index shows that it has been indexed.

I have stepped through with the debugger and can see your stack trace sequence. The use statement I mentioned is used in several places so must have been used in a previously loaded file.

Do you have a test site in which you can install a completely new 4.0.6 with new database?

User avatar
madesign
Joomla! Intern
Joomla! Intern
Posts: 82
Joined: Fri Nov 13, 2009 12:55 pm
Contact:

Re: Error when creating new article

Post by madesign » Wed Jan 19, 2022 4:07 am

I will perform a new installation and will report back.

User avatar
ceford
Joomla! Guru
Joomla! Guru
Posts: 716
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Error when creating new article

Post by ceford » Wed Jan 19, 2022 9:05 am

Which php version? Can you use the Forum Post Assistant (red box above) and post the result here?

User avatar
madesign
Joomla! Intern
Joomla! Intern
Posts: 82
Joined: Fri Nov 13, 2009 12:55 pm
Contact:

Re: Error when creating new article

Post by madesign » Wed Jan 19, 2022 9:44 am

I did a complete new installation and now I get this error in the backend home dashboard:

0 Invalid controller class: display

PHP is 7.4.27

User avatar
madesign
Joomla! Intern
Joomla! Intern
Posts: 82
Joined: Fri Nov 13, 2009 12:55 pm
Contact:

Re: Error when creating new article

Post by madesign » Wed Jan 19, 2022 9:47 am

When I now create an article I got the error:

0 Class 'Joomla\CMS\Button\FeaturedButton' not found

User avatar
ceford
Joomla! Guru
Joomla! Guru
Posts: 716
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Error when creating new article

Post by ceford » Wed Jan 19, 2022 9:59 am

Open your browser Developer Tools and look for Javascript errors. Which browser are you using? Firefox and Chrome may behave differently.

User avatar
madesign
Joomla! Intern
Joomla! Intern
Posts: 82
Joined: Fri Nov 13, 2009 12:55 pm
Contact:

Re: Error when creating new article

Post by madesign » Wed Jan 19, 2022 10:25 am

Sorry, thanks for the help but I go back to Joomla 3.
Too many issues with Joomla 4. At least on this host.

Sincerely, Michael

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 41259
Joined: Sat Apr 05, 2008 9:58 pm

Re: Error when creating new article

Post by Webdongle » Wed Jan 19, 2022 10:50 am

Then the problem is with your Host not J4
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
madesign
Joomla! Intern
Joomla! Intern
Posts: 82
Joined: Fri Nov 13, 2009 12:55 pm
Contact:

Re: Error when creating new article

Post by madesign » Wed Jan 19, 2022 11:05 am

Might be the case but no issue with Joomla 3.

User avatar
ceford
Joomla! Guru
Joomla! Guru
Posts: 716
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Error when creating new article

Post by ceford » Wed Jan 19, 2022 12:53 pm

I am a bit disappointed not to see this problem through to a solution. The fact that the new install gave different errors does point to a hosting or htaccess problem. There have been several problems arising from hosting services providing php settings that work with J3 but not with J4 (I should have made a list). An FPA dump may have told us something - you could even do that for J3. Come back when you eventually bite the bullet and try again.


Post Reply

Return to “General Questions/New to Joomla! 4.x”