diff --git a/app/Models/ReportTemplate.php b/app/Models/ReportTemplate.php index b92a346932..6c8aa622fa 100644 --- a/app/Models/ReportTemplate.php +++ b/app/Models/ReportTemplate.php @@ -48,13 +48,13 @@ class ReportTemplate extends Model return $this->belongsTo(User::class); } - public function checkmarkValue(string $fieldName): string + public function checkmarkValue(string $fieldName, string $fallbackValue = '1'): string { // Assuming we're using the null object pattern, and an empty model // was passed to the view when showing the default report page, - // return 1 so that checkboxes are checked by default. + // return the fallback value so that checkboxes are checked by default. if (is_null($this->id)) { - return '1'; + return $fallbackValue; } // Return the field's value if it exists and return 0 diff --git a/resources/views/reports/custom.blade.php b/resources/views/reports/custom.blade.php index afa13ceaff..6159f520b3 100644 --- a/resources/views/reports/custom.blade.php +++ b/resources/views/reports/custom.blade.php @@ -407,13 +407,13 @@