namespace problem with ApiRouter

Need help with the Administration of your Joomla! 4.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
roland_d_alsace
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Thu Nov 07, 2013 8:53 am

namespace problem with ApiRouter

Post by roland_d_alsace » Thu Mar 21, 2024 8:08 pm

Hi.

In webservice i have a problem at libraries/src/Router/Route.php line 150

Call to undefined method Joomla\\CMS\\Router\\ApiRouter::build()

I think its the namespace that is not resolved, because the file called with this namespace is here (librairies/src/Router/ApiRouter.php)

I have the problem on 2 website, and on another no.

Somebody have an idea

Regards.

SharkyKZ
Joomla! Hero
Joomla! Hero
Posts: 2941
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: namespace problem with ApiRouter

Post by SharkyKZ » Fri Mar 22, 2024 6:59 am

Enable debug and post stack trace.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 31019
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: namespace problem with ApiRouter

Post by Per Yngve Berg » Fri Mar 22, 2024 8:19 am

Why are there Double back-slashes.?

roland_d_alsace
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Thu Nov 07, 2013 8:53 am

Re: namespace problem with ApiRouter

Post by roland_d_alsace » Fri Mar 22, 2024 11:13 am

Thanks Yngve and sharkyks

The double back-slashes comes with x-debug viewer.

I find the problem, it's came from a non joomla plugin wich test only the site and the administrator application type and try to make a redirect to the profil view of the user, because the profil informations are not up to date.

But after this i have the problem with an other component...

I thinks that a lot of extension did not foresee this 3rd kind of application, and treats api like site application, with possilities of redirection, change menu option, etc...

roland_d_alsace
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Thu Nov 07, 2013 8:53 am

Re: namespace problem with ApiRouter

Post by roland_d_alsace » Sat Mar 23, 2024 9:37 am

Hi.
Here is the stack trace of an API call to a single article :

'code' => '500',
'title' => 'Internal server error',
'detail' => 'Error: Call to undefined method Joomla\Component\Content\Administrator\Model\ArticleModel::setUpWorkflow() in /var/www/sites/web3/web/administrator/components/com_content/src/Model/ArticleModel.php:122 Stack trace: #0 /var/www/sites/web3/web/libraries/src/MVC/Factory/MVCFactory.php(146): Joomla\Component\Content\Administrator\Model\ArticleModel->__construct()
#1 /var/www/sites/web3/web/libraries/src/MVC/Factory/ApiMVCFactory.php(41): Joomla\CMS\MVC\Factory\MVCFactory->createModel()
#2 /var/www/sites/web3/web/libraries/src/MVC/Controller/BaseController.php(546): Joomla\CMS\MVC\Factory\ApiMVCFactory->createModel()
#3 /var/www/sites/web3/web/libraries/src/MVC/Controller/BaseController.php(724): Joomla\CMS\MVC\Controller\BaseController->createModel()
#4 /var/www/sites/web3/web/libraries/src/MVC/Controller/ApiController.php(160): Joomla\CMS\MVC\Controller\BaseController->getModel()
#5 /var/www/sites/web3/web/libraries/src/MVC/Controller/BaseController.php(693): Joomla\CMS\MVC\Controller\ApiController->displayItem()
#6 /var/www/sites/web3/web/libraries/src/Dispatcher/ApiDispatcher.php(61): Joomla\CMS\MVC\Controller\BaseController->execute()
#7 /var/www/sites/web3/web/libraries/src/Component/ComponentHelper.php(361): Joomla\CMS\Dispatcher\ApiDispatcher->dispatch()
#8 /var/www/sites/web3/web/libraries/src/Application/ApiApplication.php(418): Joomla\CMS\Component\ComponentHelper::renderComponent()
#9 /var/www/sites/web3/web/libraries/src/Application/ApiApplication.php(112): Joomla\CMS\Application\ApiApplication->dispatch()
#10 /var/www/sites/web3/web/libraries/src/Application/CMSApplication.php(293): Joomla\CMS\Application\ApiApplication->doExecute()
#11 /var/www/sites/web3/web/api/includes/app.php(53): Joomla\CMS\Application\CMSApplication->execute()
#12 /var/www/sites/web3/web/api/index.php(31): require_once('...')
#13 {main}',


Post Reply

Return to “Administration Joomla! 4.x”