Skip to content

Commit

Permalink
Fix installer hint "/** CAN FAIL **/" for update SQL scripts not work…
Browse files Browse the repository at this point in the history
…ing with MySQLi driver (joomla#39391)

* Catch also RuntimeException when update SQL fails

* Fix missing backslash for global name space

* Catch only \RuntimeException

Co-authored-by: SharkyKZ <sharkykz@gmail.com>

* Remove obsolete use statement

Co-authored-by: SharkyKZ <sharkykz@gmail.com>
  • Loading branch information
richard67 and SharkyKZ authored Jan 7, 2023
1 parent f89797d commit de7380f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libraries/src/Installer/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use Joomla\Database\DatabaseDriver;
use Joomla\Database\DatabaseInterface;
use Joomla\Database\Exception\ExecutionFailureException;
use Joomla\Database\Exception\PrepareStatementFailureException;
use Joomla\Database\ParameterType;
use Joomla\DI\ContainerAwareInterface;

Expand Down Expand Up @@ -1278,7 +1277,7 @@ public function parseSchemaUpdates(\SimpleXMLElement $schema, $eid)

try {
$db->setQuery($query)->execute();
} catch (ExecutionFailureException | PrepareStatementFailureException $e) {
} catch (\RuntimeException $e) {
if (!$canFail) {
$errorMessage = Text::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', $e->getMessage());

Expand Down

0 comments on commit de7380f

Please sign in to comment.