Skip to content
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

Throw exceptions on SQL errors #18151

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ The present file will list all changes made to the project; according to the
- Usage of `DBmysql::query()`, `DBmysql::queryOrDie()` method are prohibited to ensure that legacy unsafe DB are no more executed.
Building and executing raw queries using `DBmysql::request()`, `DBmysqlIterator::buildQuery()` and `DBmysqlIterator::execute()` methods is also prohibited.
To execute DB queries, either `DBmysql::request()` can be used to craft query using the GLPI query builder,
either `DBmysql::doQuery()`/`DBmysql::doQueryOrDie()` can be used for safe queries to execute DB query using a self-crafted a SQL string.
either `DBmysql::doQuery()` can be used for safe queries to execute DB query using a self-crafted a SQL string.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
either `DBmysql::doQuery()` can be used for safe queries to execute DB query using a self-crafted a SQL string.
`DBmysql::doQuery()` can be used for safe queries to execute DB query using a self-crafted a SQL string.

- `js/fuzzysearch.js` replaced with `FuzzySearch/Modal` Vue component.
- `Html::fuzzySearch()` replaced with `Html::getMenuFuzzySearchList()` function.
- `NotificationEvent::raiseEvent()` signature cahnged. A new `$trigger` parameter has been added at 4th position, and `$label` is now the 5th parameter.
Expand Down Expand Up @@ -241,8 +241,12 @@ The present file will list all changes made to the project; according to the
- `ComputerVirtualMachine` has been deprecated and replaced by `ItemVirtualMachine`
- `Config::validatePassword()`
- `Contract::getExpiredCriteria()` renamed to `Contract::getNotExpiredCriteria()` to match the actual behavior.
- `DBmysql::deleteOrDie()`. Use `DBmysql::delete()` instead.
- `DBmysql::doQueryOrDie()`. Use `DBmysql::doQuery()` instead.
- `DBmysql::insertOrDie()`. Use `DBmysql::insert()` instead.
- `DBmysql::truncate()`
- `DBmysql::truncateOrDie()`
- `DBmysql::updateOrDie()`. Use `DBmysql::update()` instead.
- `Document::getImage()`
- `Glpi\Application\View\Extension\DataHelpersExtension::getVerbatimValue()`
- `Glpi\Application\View\Extension\PluginExtension::getPluginWebDir()`
Expand Down Expand Up @@ -370,6 +374,7 @@ The present file will list all changes made to the project; according to the
- `GLPI::getLogLevel()`
- `Glpi\Api\API::showDebug()`
- `Glpi\Api\API::returnSanitizedContent()`
- `Glpi\Application\ErrorHandler::handleSqlError()`
- `Glpi\Dashboard\Filter::dates()`
- `Glpi\Dashboard\Filter::dates_mod()`
- `Glpi\Dashboard\Filter::itilcategory()`
Expand Down
2 changes: 1 addition & 1 deletion install/migrations/update_0.90.1_to_0.90.5.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function update0901to0905()

// fix https://github.com/glpi-project/glpi/issues/820
// remove empty suppliers in tickets
$DB->deleteOrDie("glpi_suppliers_tickets", [
$DB->delete("glpi_suppliers_tickets", [
'suppliers_id' => 0,
'alternative_email' => ""
]);
Expand Down
Loading
Loading