Hot answers tagged

2 votes

Execute Joomla CLI script to bulk import JSON data to articles

I found when running CLI scripts that other things that you don't really need to execute, i.e. plugins, will cause failures because they don't check themselves to disable if they are running under a ...
user avatar
  • 2,275
2 votes
Accepted

Invalid controller class from custom component ajax call to json method

In J4 default MVC factory uses PSR-4 autoloading. So InputDataController.json.php filename is invalid, your controller class will not be found at all. Secondly, default component dispatcher doesn't ...
user avatar
  • 8,581
2 votes

Integrate external news content API into com_content articles

Do you want to do a fetch only from the news website (GET requests only) or do you need to push back information from your Joomla! 3 website eg (POST request) ? Joomla 3 HTTP Client is the same than ...
user avatar
2 votes
Accepted

How to output just raw json from my Joomla controller for Ajax requests?

To use format=json query parameter, the controller filename needs to be suffixed with the format, e.g. ajax.json.php. This is mentioned in the linked documentation: If you are developing an MVC ...
user avatar
  • 8,581
2 votes
Accepted

Decode json strings from a database table column

It looks like you are mangling valid json data with explode() (the wrong tool for the job). You just need to call json_decode() on each string. This can be done with array_map() or a classic foreach()...
user avatar
  • 4,448
1 vote

Execute Joomla CLI script to bulk import JSON data to articles

Here is the final working code courtesy of @mickmackusa. It took the addition of $app = JFactory::getApplication( 'site' ); to fix the Failed to start application error in the command line. /** * A ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible