User tests: Successful: Unsuccessful:
This pull request improves the stability of the view by preventing potential null reference errors when accessing properties of $this->item.
In several locations, properties such as id, checked_out, and created_by were accessed directly from $this->item. In cases where $this->item is not initialized or unexpectedly null, this could trigger PHP warnings or runtime errors.
To address this, the code now uses PHP's null-safe operator (?->) and appropriate fallback values where necessary.
The following updates were applied:
| Line | Method | Change |
|---|---|---|
| 107 | display() | $this->item->id → $this->item?->id ?? 0 |
| 160 | addToolbar() | $this->item->id → $this->item?->id ?? 0 |
| 161 | addToolbar() | $this->item->checked_out → $this->item?->checked_out |
| 193 | addToolbar() | $this->item->created_by → $this->item?->created_by |
| 270 | addModalToolbar() | $this->item->id → $this->item?->id ?? 0 |
| 271 | addModalToolbar() | $this->item->checked_out → $this->item?->checked_out |
| 283 | addModalToolbar() | $this->item->created_by → $this->item?->created_by |
Total modifications:
These changes ensure safer property access and prevent potential errors when $this->item is null or not fully initialized.
Using the null-safe operator improves code robustness without altering existing functionality.
This change does not modify any business logic or introduce behavioral differences. It only improves defensive coding practices and error safety.
$this->item is not set.The view behaves exactly as before but is now protected against null access errors.
| Status | New | ⇒ | Pending |
| Status | Pending | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-03-05 21:38:44 |
| Closed_By | ⇒ | richard67 |
Please allow me to merge this
For sure not. Only maintainers of this repository and release managers can merge here, like in every other repository.
Besides this, your PR does not show any changed files on GitHub.
Please stop wasting our time.
Please allow me to merge this