Skip to content

Commit

Permalink
Fix #73 Needed another try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoboHub authored and nitriques committed Nov 17, 2016
1 parent ad8b3f4 commit 85d8bec
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fields/field.order_entries.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,16 @@ private function updateFilterTable(){
try {
Symphony::Database()->query("ALTER TABLE `tbl_entries_data_{$orderFieldId}` DROP INDEX `unique`;");
} catch (Exception $ex) {
// ignore. This can fail is not index exists.
// ignore. This can fail if no index exists.
// See #73
}
if (!empty($fields)) {
Symphony::Database()->query("ALTER TABLE `tbl_entries_data_{$orderFieldId}` ADD UNIQUE `unique`(`entry_id` {$fields});");
try {
Symphony::Database()->query("ALTER TABLE `tbl_entries_data_{$orderFieldId}` ADD UNIQUE `unique`(`entry_id` {$fields});");
} catch (Exception $ex) {
// ignore. This can fail if no index exists.
// See #73 (Fix error when deselect a field for filtering and saving the section)
}
}
}
}
Expand Down

0 comments on commit 85d8bec

Please sign in to comment.