Skip to content

Commit

Permalink
[NDB_BVL_Instrument] Only update instrument table if $values not emp…
Browse files Browse the repository at this point in the history
…ty (#7124)

This fixes the _save() method to call db update only if $values is not empty. This case pops up when you have a subtest with only static score elements. No error should be thrown so that $this->score() can eventually be called within the save() method.
  • Loading branch information
zaliqarosli authored Jan 18, 2021
1 parent afbc9d1 commit 137b536
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion php/libraries/NDB_BVL_Instrument.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ abstract class NDB_BVL_Instrument extends NDB_Page
$values = Utility::nullifyEmpty($values, $key);
}

if ($this->jsonData !== true) {
if ($this->jsonData !== true && !empty($values)) {
// If the instrument is saving as JSON into the Data column, the
// table may not exist, so don't try and update it.
$db->update(
Expand Down

0 comments on commit 137b536

Please # to comment.