Skip to content

Commit

Permalink
Merge pull request #1617 from tripal/tv4g0-issue1520-php8.2-deprecations
Browse files Browse the repository at this point in the history
Tripal 4 php8.2 deprecations (part 4)
  • Loading branch information
dsenalik committed Sep 12, 2023
2 parents e30f780 + d5ca8af commit 68822d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions tripal_chado/src/ChadoCustomTables/ChadoMview.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ public function __construct($table_name, string $chado_schema = NULL) {

parent::__construct($table_name, $chado_schema);

$this->custom_table = NULL;
$this->mview_id = NULL;


if (!$table_name) {
throw new \Exception('Please provide a value for the $table_name argument');
}
Expand Down
8 changes: 4 additions & 4 deletions tripal_chado/src/api/tripal_chado.query.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ function chado_insert_record($table, $values, $options = [], $chado_schema_name
$ivalues = []; // Contains the values of the fields.
foreach ($insert_values as $field => $value) {
$ifields[] = $field;
if (strcmp($value, '__NULL__') == 0) {
if (is_string($value) and (strcmp($value, '__NULL__') == 0)) {
$itypes[] = "NULL";
}
else {
Expand Down Expand Up @@ -917,7 +917,7 @@ function chado_update_record($table, $match, $values, $options = NULL, $chado_sc
$sql = 'UPDATE {' . $table . '} SET ';
$args = []; // Arguments passed to chado_query.
foreach ($update_values as $field => $value) {
if (strcmp($value, '__NULL__') == 0) {
if (is_string($value) and (strcmp($value, '__NULL__') == 0)) {
$sql .= " $field = NULL, ";
}
else {
Expand All @@ -929,7 +929,7 @@ function chado_update_record($table, $match, $values, $options = NULL, $chado_sc

$sql .= " WHERE ";
foreach ($update_matches as $field => $value) {
if (strcmp($value, '__NULL__') == 0) {
if (is_string($value) and (strcmp($value, '__NULL__') == 0)) {
$sql .= " $field = NULL AND ";
}
else {
Expand Down Expand Up @@ -1115,7 +1115,7 @@ function chado_delete_record($table, $match, $options = NULL, $chado_schema_name
$sql .= ") AND ";
}
else {
if (strcmp($value, '__NULL__') == 0) {
if (is_string($value) and (strcmp($value, '__NULL__') == 0)) {
$sql .= " $field = NULL AND ";
}
else {
Expand Down

0 comments on commit 68822d8

Please sign in to comment.