JoomlaPolska / jezyk-J4

Język polski dla Joomla 4
GNU General Public License v2.0
3 stars 5 forks source link

in updates XML always resulted in an error #203

Closed joomlapl-bot closed 2 years ago

joomlapl-bot commented 2 years ago

PR w związku ze zmianą oryginału https://github.com/joomla/joomla-cms/pull/38121 Poniżej zmiany w oryginale:

Click to expand the diff! ```diff diff --git a/administrator/language/en-GB/lib_joomla.ini b/administrator/language/en-GB/lib_joomla.ini index 178145886bce..e424927663bd 100644 --- a/administrator/language/en-GB/lib_joomla.ini +++ b/administrator/language/en-GB/lib_joomla.ini @@ -758,3 +758,11 @@ JLIB_SIZE_PB="PiB" JLIB_SIZE_EB="EiB" JLIB_SIZE_ZB="ZiB" JLIB_SIZE_YB="YiB" + +; Database server technology types in human readable terms. Used in the Updater package. +JLIB_DB_SERVER_TYPE_MARIADB="MariaDB" +JLIB_DB_SERVER_TYPE_MSSQL="Microsoft SQL Server" +JLIB_DB_SERVER_TYPE_MYSQL="MySQL" +JLIB_DB_SERVER_TYPE_ORACLE="Oracle" +JLIB_DB_SERVER_TYPE_POSTGRESQL="PostgreSQL" +JLIB_DB_SERVER_TYPE_SQLITE="SQLite" diff --git a/libraries/src/Updater/Adapter/ExtensionAdapter.php b/libraries/src/Updater/Adapter/ExtensionAdapter.php index 59740ab424bc..f84302bdafff 100644 --- a/libraries/src/Updater/Adapter/ExtensionAdapter.php +++ b/libraries/src/Updater/Adapter/ExtensionAdapter.php @@ -155,10 +155,13 @@ protected function _endElement($parser, $name) } } + // $supportedDbs has uppercase keys because they are XML attribute names + $dbTypeUcase = strtoupper($dbType); + // Do we have an entry for the database? - if (\array_key_exists($dbType, $supportedDbs)) + if (\array_key_exists($dbTypeUcase, $supportedDbs)) { - $minimumVersion = $supportedDbs[$dbType]; + $minimumVersion = $supportedDbs[$dbTypeUcase]; $dbMatch = version_compare($dbVersion, $minimumVersion, '>='); if (!$dbMatch) @@ -168,7 +171,7 @@ protected function _endElement($parser, $name) 'JLIB_INSTALLER_AVAILABLE_UPDATE_DB_MINIMUM', $this->currentUpdate->name, $this->currentUpdate->version, - Text::_($db->name), + Text::_('JLIB_DB_SERVER_TYPE_' . $dbTypeUcase), $dbVersion, $minimumVersion ); @@ -183,7 +186,7 @@ protected function _endElement($parser, $name) 'JLIB_INSTALLER_AVAILABLE_UPDATE_DB_TYPE', $this->currentUpdate->name, $this->currentUpdate->version, - Text::_($db->name) + Text::_('JLIB_DB_SERVER_TYPE_' . $dbTypeUcase) ); Factory::getApplication()->enqueueMessage($dbMsg, 'warning'); ```