New answers tagged

6 votes
Accepted

Change database password?

The correct method is to update database password first, either via your hosting control panel or the command line. Then manually update the password in configuration.php either through the File ...
  • 146
1 vote

Migrating custom module to Joomla 4

$input = $app->input; is deprecated too. You should use in Joomla 4 $input = $app->getInput(); instead. Also you can load database form DI container by this code: use Joomla\Database\...
3 votes

Migrating custom module to Joomla 4

Lodder's answer is fully valid, however he did not want to waste time to reformulate the query part of this old script in the question. As a morning drill during my coffee time I corrected that part ...
  • 2,616
3 votes

Migrating custom module to Joomla 4

JRequest was deprecated in Joomla 2.5 (I think), so you can now use JInput, like so: use Joomla\CMS\Factory; $db = Factory::getDbo(); $input = Factory::getApplication()->input; $id = $input->...
  • 26.7k
2 votes

loadObjectList() returns array indexed by empty string

We can improve queries with prepared statements. As example: $query = $db ->getQuery(true) ->select('*') ->from($db->qn('#__mail_templates')) ->where($db->qn('...
  • 79
1 vote
Accepted

loadObjectList() returns array indexed by empty string

Meh. Buggy line should be $rows = $db->setQuery($query)->loadObjectList(); A warning would have been nice...

Top 50 recent answers are included