Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Fix scripted module template observer warning #6720

Merged

Conversation

Sunderlandkyl
Copy link
Member

Whenever the user leaves the template module, the parameter node observers are removed. If the module is entering after that, setParameterNode() will attempt to remove the observer again, and throw a warning message.

Fixed by checking if the observer exists before removing in setParameterNode().

See: https://discourse.slicer.org/t/warning-of-observer-from-scripted-module-in-slicer-5-0-3/

Whenever the user leaves the template module, the parameter node observers are removed.
If the module is entering after that, setParameterNode() will attempt to remove the observer again, and throw a warning message.

Fixed by checking if the observer exists before removing in setParameterNode().

See: https://discourse.slicer.org/t/warning-of-observer-from-scripted-module-in-slicer-5-0-3/
Copy link
Contributor

@lassoan lassoan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@lassoan lassoan merged commit 8d1ff64 into Slicer:main Dec 8, 2022
@Sunderlandkyl Sunderlandkyl deleted the scripted_template_observer_warning_fix branch December 8, 2022 16:17
@jcfr jcfr added this to the Slicer 5.2.2 milestone Mar 13, 2023
NicerNewerCar added a commit to NicerNewerCar/SlicerAutoscoperM that referenced this pull request Jul 6, 2023
* Bug was initally fixed in the scripted module template in [PR
  #6720](Slicer/Slicer#6720) from Slicer core.
* This module was created in 2021 while the above PR was integrated in
  late 2022
NicerNewerCar added a commit to NicerNewerCar/SlicerAutoscoperM that referenced this pull request Jul 6, 2023
* Bug was initially fixed in the scripted module template in [PR
  #6720](Slicer/Slicer#6720) from Slicer core.
* This module was created in 2021 while the above PR was integrated in
  late 2022
jcfr pushed a commit to BrownBiomechanics/SlicerAutoscoperM that referenced this pull request Jul 28, 2023
* Bug was initially fixed in the scripted module template in [PR
  #6720](Slicer/Slicer#6720) from Slicer core.
* This module was created in 2021 while the above PR was integrated in
  late 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants