Skip to content

Replace trigger_error, which is deprecated in PHP 8.4. #4755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/Varien/Db/Adapter/Interface.php
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ interface Varien_Db_Adapter_Interface
* Error message for DDL query in transactions
*/
public const ERROR_DDL_MESSAGE = 'DDL statements are not allowed in transactions';
public const ERROR_TRANSACTION_NOT_COMMITTED = 'Some transactions have not been committed or rolled back';

/**
* Begin new DB transaction for connection
4 changes: 2 additions & 2 deletions lib/Varien/Db/Adapter/Pdo/Mysql.php
Original file line number Diff line number Diff line change
@@ -464,7 +464,7 @@ protected function _checkDdlTransaction($sql)
if (in_array($startSql, $this->_ddlRoutines)
&& (preg_match($this->_tempRoutines, $sql) !== 1)
) {
trigger_error(Varien_Db_Adapter_Interface::ERROR_DDL_MESSAGE, E_USER_ERROR);
throw new Varien_Db_Exception(Varien_Db_Adapter_Interface::ERROR_DDL_MESSAGE);
}
}
}
@@ -4094,7 +4094,7 @@ public function createTableFromSelect($tableName, Zend_Db_Select $select, $tempo
public function __destruct()
{
if ($this->_transactionLevel > 0) {
trigger_error('Some transactions have not been committed or rolled back', E_USER_ERROR);
throw new RuntimeException(Varien_Db_Adapter_Interface::ERROR_TRANSACTION_NOT_COMMITTED);
}
}
}
Loading