Skip to content

Avoid config pollution when a plugin lookup fails on a non-existent id - #3421

Merged
Salvialf merged 2 commits into
developfrom
fix/forceDisablePlugin-config-pollution
Jul 22, 2026
Merged

Avoid config pollution when a plugin lookup fails on a non-existent id#3421
Salvialf merged 2 commits into
developfrom
fix/forceDisablePlugin-config-pollution

Conversation

@Salvialf

Copy link
Copy Markdown
Contributor

Context

Reported on the Jeedom community forum: plugin::byId() calls forceDisablePlugin() on every failed lookup, even when the id was never a real plugin (e.g. a caller using byId() combined with try/catch as an "is this plugin installed" check, which is a legitimate pattern). forceDisablePlugin() unconditionally wrote an active=0 config row for that id, a write side effect in what amounts to a read/existence check.

Fix

plugin::forceDisablePlugin() now only writes the active=0 row when the id was already marked active. This removes the write side effect for ids that were never real plugins, while still disabling a plugin that was genuinely active and became unresolvable.

@Salvialf Salvialf added the changelog-fix Use to generate release notes / changelog To be apply on PR label Jul 14, 2026
Comment thread core/class/plugin.class.php Outdated
@Salvialf
Salvialf requested a review from Mips2648 July 20, 2026 19:37
@Salvialf
Salvialf merged commit 0074905 into develop Jul 22, 2026
6 checks passed
@Salvialf
Salvialf deleted the fix/forceDisablePlugin-config-pollution branch July 22, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-fix Use to generate release notes / changelog To be apply on PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants