Skip to content

Commit d86bd12

Browse files
committed
back to registry
1 parent 6be0cec commit d86bd12

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

administrator/components/com_messages/src/Model/ConfigModel.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Joomla\CMS\Component\ComponentHelper;
1414
use Joomla\CMS\MVC\Model\FormModel;
1515
use Joomla\Database\ParameterType;
16+
use Joomla\Registry\Registry;
1617

1718
// phpcs:disable PSR1.Files.SideEffects
1819
\defined('_JEXEC') or die;
@@ -58,6 +59,7 @@ protected function populateState()
5859
*/
5960
public function getItem()
6061
{
62+
$item = new Registry();
6163
$userid = (int) $this->getState('user.id');
6264

6365
$db = $this->getDatabase();
@@ -82,7 +84,10 @@ public function getItem()
8284
return false;
8385
}
8486

85-
$item = (object) array_column($rows, 'cfg_value', 'cfg_name');
87+
foreach ($rows as $row) {
88+
$property = $row->cfg_name;
89+
$item->set($property, $row->cfg_value);
90+
}
8691

8792
$this->preprocessData('com_messages.config', $item);
8893

0 commit comments

Comments
 (0)