Skip to main content
Some formatting improvements
Source Link
mickmackusa
  • 4.8k
  • 4
  • 18
  • 48

Error JLIB_APPLICATION_ERROR_INVALID_CONTROLLER from CLI on Joomla 3.7

I have an issue with a cli php script that I'm trying to execute. I want to add an article with custom fields.

The part where I add articles is working well. But, but when I add the code to load the article I just stored and set its custom fields values, there is the following error: Call to undefined method AddArticle::getTemplate(): JLIB_APPLICATION_ERROR_INVALID_CONTROLLER

Call to undefined method AddArticle::getTemplate(): JLIB_APPLICATION_ERROR_INVALID_CONTROLLER

The error seems to be related to the following line  : $article_joom = JControllerLegacy::getInstance('Content')->getModel('Article')->getItem($article['id']);

$article_joom = JControllerLegacy::getInstance('Content')->getModel('Article')->getItem($article['id']);

I've tried to load the ContentLoader class because someone said it would help, but it didn't really change anything. From

From what I've seen, I may not be able to use the JController on a cli script. But, but I haven't found another way to load articles.

Error JLIB_APPLICATION_ERROR_INVALID_CONTROLLER on Joomla 3.7

I have an issue with a cli php script I'm trying to execute. I want to add article with custom fields.

The part where I add articles is working well. But when I add the code to load the article I just stored and set its custom fields values, there is the following error: Call to undefined method AddArticle::getTemplate(): JLIB_APPLICATION_ERROR_INVALID_CONTROLLER

The error seems to be related to the following line  : $article_joom = JControllerLegacy::getInstance('Content')->getModel('Article')->getItem($article['id']);

I've tried to load the ContentLoader class because someone said it would help but it didn't really change anything. From what I've seen, I may not be able to use the JController on a cli script. But I haven't found another way to load articles.

Error JLIB_APPLICATION_ERROR_INVALID_CONTROLLER from CLI on Joomla 3.7

I have an issue with a cli php script that I'm trying to execute. I want to add an article with custom fields.

The part where I add articles is working well, but when I add the code to load the article I just stored and set its custom fields values, there is the following error:

Call to undefined method AddArticle::getTemplate(): JLIB_APPLICATION_ERROR_INVALID_CONTROLLER

The error seems to be related to the following line:

$article_joom = JControllerLegacy::getInstance('Content')->getModel('Article')->getItem($article['id']);

I've tried to load the ContentLoader class because someone said it would help, but it didn't really change anything.

From what I've seen, I may not be able to use the JController on a cli script, but I haven't found another way to load articles.

Source Link

Error JLIB_APPLICATION_ERROR_INVALID_CONTROLLER on Joomla 3.7

I have an issue with a cli php script I'm trying to execute. I want to add article with custom fields.

The part where I add articles is working well. But when I add the code to load the article I just stored and set its custom fields values, there is the following error: Call to undefined method AddArticle::getTemplate(): JLIB_APPLICATION_ERROR_INVALID_CONTROLLER

The error seems to be related to the following line : $article_joom = JControllerLegacy::getInstance('Content')->getModel('Article')->getItem($article['id']);

I've tried to load the ContentLoader class because someone said it would help but it didn't really change anything. From what I've seen, I may not be able to use the JController on a cli script. But I haven't found another way to load articles.