Add safer checks for \ variable
Add isset() and is_array() checks before using \ to prevent PHP warnings/errors if variable is not set or not an array. This ensures cleaner JavaScript output even if the variable is undefined.
This commit is contained in:
parent
d3e50174b5
commit
1a592eda7c
|
|
@ -1668,7 +1668,7 @@ $allergyStatusNoKnown = in_array($allergyStatusNormalized, ['no known drug aller
|
|||
|
||||
function initDischargeComplaintsTable() {
|
||||
// Load existing complaints from PHP (if any)
|
||||
<?php if (!empty($complaint_rows)): ?>
|
||||
<?php if (isset($complaint_rows) && is_array($complaint_rows) && !empty($complaint_rows)): ?>
|
||||
selectedDischargeComplaints = [
|
||||
<?php
|
||||
$itemCount = count($complaint_rows);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user