Fix autoload always loading a plugin's main class file instead of a dedicated one - #3444
Open
Salvialf wants to merge 3 commits into
Open
Fix autoload always loading a plugin's main class file instead of a dedicated one#3444Salvialf wants to merge 3 commits into
Salvialf wants to merge 3 commits into
Conversation
Mips2648
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears 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.
jeedomAutoloadtruncates an unresolved plugin class name (e.g.xxx_yyy) down to its plugin prefix (xxx) to check if the plugin is active, then reuses that truncated name as both the plugin folder and the file to load. This means it always loads the plugin's main class file, even when a dedicated file matching the exact class name exists in the plugin'score/classfolder.The fix checks for a file matching the exact class name first, and only falls back to the plugin's main class file if it doesn't exist. Fully backward compatible: plugins that never split a secondary class out keep the exact same behavior.
This also applies to the
Cmd/Realsuffix stripping done earlier in the function, so a plugin'sxxxCmdclass can now be extracted into its own dedicated file too, not just underscore-suffixed classes.Also added type hints to
jeedomAutoloadand simplified it slightly (inlined single-use path variables) while working on it.