Fix missing Device Type/Model dropdowns (Battery, Firmware, Hard Drive) - #25219
Open
aymericcucherousset wants to merge 2 commits into
Open
Conversation
cconard96
reviewed
Aug 22, 2026
| #[TestWith(['DeviceFirmwareType'])] | ||
| #[TestWith(['DeviceBatteryModel'])] | ||
| #[TestWith(['DeviceFirmwareModel'])] | ||
| public function testDeviceDropdownsArePresent(string $itemtype): void |
Member
There was a problem hiding this comment.
A more complete test would fetch the list of device types from Dropdown::getDeviceItemTypes(false), check if a type and model class exist for each (Add Type/Model to the end of the class name and check class_exists), and then check it is present in the correct groups from Dropdown::getStandardDropdownItemTypes(false).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appear
7369
s below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dropdown::getStandardDropdownItemTypes()builds Setup > Dropdowns from a hand-maintained list per optgroup. FiveDevice*Type/Device*Modelclasses were missing from it, despite being structurally identical to working siblings (sameCommonDeviceType/model base, same form routing), a pure registry omission, not a permissions or class-hierarchy bug.Typeoptgroup:DeviceHardDriveType,DeviceBatteryType,DeviceFirmwareType.Modeloptgroup:DeviceBatteryModel,DeviceFirmwareModel.Fixes #25156, #25154, #25155.
Test plan
testDeviceTypesAndModelsArePresent(tests/functional/DropdownTest.php) walks every base device class fromDropdown::getDeviceItemTypes(), and for each one whose*Type/*Modelclass exists, asserts it's registered inDropdown::getStandardDropdownItemTypes()'s Type/Model group.