Update scenarioExpression.class.php#2034
Merged
zoic21 merged 1 commit intojeedom:betafrom Jul 9, 2022
Phpvarious:patch-13
Merged
Update scenarioExpression.class.php#2034zoic21 merged 1 commit intojeedom:betafrom Phpvarious:patch-13
zoic21 merged 1 commit intojeedom:betafrom
Phpvarious:patch-13
Conversation
Lors de l'utilisation de genericType, celui-ci extrait toutes les cmd même celles qui sont dans des équipements désactivés, pour ensuite faire un "$cmd->execCmd" sur cette cmd. Se qui a pour effet de bloquer la suite du foreach car le scénario tombe dans un "throw new Exception" (cmd.class.php#L1099). Ce PR est simpliste mais il fonctionne, le mieux serai, il me semble, de traiter directement dans la fonction : byGenericTypeObjectId($_generic_type, $_object_id = null, $_type = null) en rajoutant par exemple une variable $_onlyEnable = false, mais il faut ensuite conditionner la requête sql, et c'est là que s'arrête mes compétences ;-)
Contributor
|
Bonjour |
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.
Lors de l'utilisation de genericType, celui-ci extrait toutes les cmd même celles qui sont dans des équipements désactivés, pour ensuite faire un "$cmd->execCmd" sur cette cmd. Se qui a pour effet de bloquer la suite du foreach car le scénario tombe dans un "throw new Exception" (cmd.class.php#L1099).
Ce PR est simpliste mais il fonctionne, le mieux serai, il me semble, de traiter directement dans la fonction :
byGenericTypeObjectId($_generic_type, $_object_id = null, $_type = null) en rajoutant par exemple une variable $_onlyEnable = false, mais il faut ensuite conditionner la requête sql, et c'est là que s'arrête mes compétences ;-)
https://community.jeedom.com/t/probleme-de-recursivite-dans-les-scenarios-avec-les-generictype/86925
Proposed change
Type of change
Test check
Documentation
beta-testing
contribute
community
plugins