Skip to content

Commit 4085cac

Browse files
authored
[5.4] Fix InstallerScript using 'id' instead of 'extension_id' for #__extension (joomla#46195)
* Fix InstallerScript using 'id' instead of 'extension_id' for #__extensions table
1 parent 25a28b3 commit 4085cac

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

libraries/src/Installer/InstallerScript.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ public function getParam($name, $id = 0)
211211
return false;
212212
}
213213

214-
$params = $this->getItemArray('params', $this->paramTable, 'id', $id);
214+
$column = ($this->paramTable === '#__extensions') ? 'extension_id' : 'id';
215+
216+
$params = $this->getItemArray('params', $this->paramTable, $column, $id);
215217

216218
return $params[$name];
217219
}
@@ -236,7 +238,9 @@ public function setParams($paramArray = null, $type = 'edit', $id = 0)
236238
return false;
237239
}
238240

239-
$params = $this->getItemArray('params', $this->paramTable, 'id', $id);
241+
$column = ($this->paramTable === '#__extensions') ? 'extension_id' : 'id';
242+
243+
$params = $this->getItemArray('params', $this->paramTable, $column, $id);
240244

241245
if ($paramArray) {
242246
foreach ($paramArray as $name => $value) {
@@ -262,7 +266,7 @@ public function setParams($paramArray = null, $type = 'edit', $id = 0)
262266
$query = $db->getQuery(true)
263267
->update($db->quoteName($this->paramTable))
264268
->set('params = :params')
265-
->where('id = :id')
269+
->where($column . ' = :id')
266270
->bind(':params', $paramsString)
267271
->bind(':id', $id, ParameterType::INTEGER);
268272

0 commit comments

Comments
 (0)