bug: BackupModel/ProfileModel loadFormData() returns array when object declared — TypeError #80

Closed
opened 2026-06-21 23:01:44 +00:00 by jmiller · 0 comments
Owner

Severity: MEDIUM

loadFormData() declares return type object but getUserState() can return an array. On PHP 8.x this throws a TypeError, crashing the edit views when Joomla restores form state after validation failure.

Fix

return is_array($data) ? (object) $data : $data;

Files

  • src/Model/BackupModel.php:32-39
  • src/Model/ProfileModel.php (same pattern)
## Severity: MEDIUM `loadFormData()` declares return type `object` but `getUserState()` can return an array. On PHP 8.x this throws a `TypeError`, crashing the edit views when Joomla restores form state after validation failure. ## Fix ```php return is_array($data) ? (object) $data : $data; ``` ## Files - `src/Model/BackupModel.php:32-39` - `src/Model/ProfileModel.php` (same pattern)
jmiller added the component: admin label 2026-06-21 23:01:44 +00:00
Sign in to join this conversation.
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteBackup#80