Skip to content

Commit

Permalink
fix: ignore history data form name via portal for delete, some deprec…
Browse files Browse the repository at this point in the history
…ation fixes (#6318)

* fix: ignore history data form name for delete, unrelated deprecation fixes

* styling
  • Loading branch information
stephenwaite committed Mar 30, 2023
1 parent e4f5cd5 commit 912ffc4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions interface/forms/LBF/new.php
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ function warehouse_changed(sel) {
array($formname, $formid)
);
$form_issue_id = empty($firow['issue_id']) ? 0 : intval($firow['issue_id']);
$default = empty($firow['provider_id']) ? $_SESSION['authUserID'] : intval($firow['provider_id']);
$default = empty($firow['provider_id']) ? ($_SESSION['authUserID'] ?? null) : intval($firow['provider_id']);

if (!$patient_portal) {
// Provider selector.
Expand Down Expand Up @@ -1834,7 +1834,7 @@ function warehouse_changed(sel) {

<?php if (!$from_trend_form) { // end row and container divs ?>
<p style='text-align:center' class='small'>
<?php echo text(xl('Rev.') . ' ' . substr($grp_last_update, 0, 10)); ?>
<?php echo text(xl('Rev.') . ' ' . substr($grp_last_update ?? '', 0, 10)); ?>
</p>

<?php } ?>
Expand Down
2 changes: 2 additions & 0 deletions interface/patient_file/deleter.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ function form_delete($formdir, $formid, $patient_id, $encounter_id)
}
row_delete("form_eye_mag_impplan", "form_id = '" . add_escape_custom($formid) . "'");
row_delete("form_eye_mag_wearing", "FORM_ID = '" . add_escape_custom($formid) . "'");
} elseif ($formdir == 'form_HIS') {
// when history form is entered in portal, just ignore...
} else {
row_delete("form_$formdir", "id = '" . add_escape_custom($formid) . "'");
}
Expand Down
2 changes: 1 addition & 1 deletion portal/patient/fwk/libs/verysimple/Phreeze/Phreezable.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ private function _DoBaseValidation()
if ($left > $limitLeft || $right > $limitRight) {
$this->AddValidationError($prop, "$prop exceeds the maximum length of " . $fm->FieldSize . "");
}
} elseif (is_numeric($fm->FieldSize) && ($lenfunction($this->$prop) - 1 > $fm->FieldSize)) {
} elseif (is_numeric($fm->FieldSize) && ($lenfunction($this->$prop ?? '') - 1 > $fm->FieldSize)) {
$this->AddValidationError($prop, "$prop exceeds the maximum length of " . $fm->FieldSize . "");
}

Expand Down
2 changes: 1 addition & 1 deletion portal/patient/fwk/libs/verysimple/Phreeze/Phreezer.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ public function Save($obj, $force_insert = false)
$table = $fms [$pk]->TableName;
$pkcol = $fms [$pk]->ColumnName;
$returnval = "";
$pk_is_auto_insert = strlen($id) == 0;
$pk_is_auto_insert = strlen($id ?? '') == 0;
// if there is no value for the primary key, this is an insert
$is_insert = $force_insert || $pk_is_auto_insert;
// fire the OnSave event in case the object needs to prepare itself
Expand Down

0 comments on commit 912ffc4

Please sign in to comment.