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

Cannot save G-code template changes (js error: "Error calling onSettingsBeforeSave on view model") #1

Closed
dlitz opened this issue May 2, 2020 · 3 comments
Labels
bug Something isn't working solved

Comments

@dlitz
Copy link
Contributor

dlitz commented May 2, 2020

What were you doing?

  1. Install Smart Preheat plugin via Plugin Manager
  2. Open OctoPrint Settings -> Plugin -> Smart Preheat
  3. Modify the g-code template
  4. Click "Save"
  5. Open OctoPrint Settings -> Plugin -> Smart Preheat again

What did you expect to happen?

  • Modified G-code should appear in the text area.
  • Modified G-code should appear in ~/.octoprint/scripts/gcode/snippets/doSmartPreheat

What happened instead?

  • Previous G-code appears in the text area. Changes are lost.
  • ~/.octoprint/scripts/gcode/snippets/doSmartPreheat is not modified
  • No network request was made from the browser (Firefox 75.0 on Linux/x86_64)
  • Error in JavaScript console:
Error calling onSettingsBeforeSave on view model SmartPreheatViewModel : SmartPreheatViewModel/self.onSettingsBeforeSave@https://octoprint.dlitz.net/static/webassets/packed_plugins.js?02445d5c:10054:25
callViewModelIf@https://octoprint.dlitz.net/static/webassets/packed_core.js?3514a079:16543:34
callViewModelsIf/<@https://octoprint.dlitz.net/static/webassets/packed_core.js?3514a079:16489:28
Pn@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:11208:530
ur/<@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:11229:66
callViewModelsIf@https://octoprint.dlitz.net/static/webassets/packed_core.js?3514a079:16487:7
callViewModels@https://octoprint.dlitz.net/static/webassets/packed_core.js?3514a079:16481:21
SettingsViewModel/self.onAllBound/<@https://octoprint.dlitz.net/static/webassets/packed_core.js?3514a079:5306:31
dispatch@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:5184:27
add/elemData.handle@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:4992:28
trigger@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:8250:12
trigger/<@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:8328:17
each@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:355:19
each@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:190:17
trigger@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:8327:15
SettingsViewModel/self.saveData@https://octoprint.dlitz.net/static/webassets/packed_core.js?3514a079:5731:33
click/<@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949 line 11374 > Function:3:85
init/</<@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:11395:443
dispatch@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:5184:27
add/elemData.handle@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:4992:28
packed_core.js:16553:17

Error calling onSettingsHidden on view model SmartPreheatViewModel : SmartPreheatViewModel/self.onSettingsHidden@https://octoprint.dlitz.net/static/webassets/packed_plugins.js?02445d5c:10049:21
callViewModelIf@https://octoprint.dlitz.net/static/webassets/packed_core.js?3514a079:16543:34
callViewModelsIf/<@https://octoprint.dlitz.net/static/webassets/packed_core.js?3514a079:16489:28
Pn@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:11208:530
ur/<@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:11229:66
callViewModelsIf@https://octoprint.dlitz.net/static/webassets/packed_core.js?3514a079:16487:7
callViewModels@https://octoprint.dlitz.net/static/webassets/packed_core.js?3514a079:16481:21
SettingsViewModel/self.onAllBound/<@https://octoprint.dlitz.net/static/webassets/packed_core.js?3514a079:5302:35
dispatch@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:5184:27
add/elemData.handle@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:4992:28
trigger@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:8250:12
trigger/<@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:8328:17
each@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:355:19
each@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:190:17
trigger@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:8327:15
hideModal@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:14740:6
hideWithTransition/<@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:14724:10
fn@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:4933:18
dispatch@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:5184:27
add/elemData.handle@https://octoprint.dlitz.net/static/webassets/packed_libs.js?3339d949:4992:28
packed_core.js:16553:17

Version of OctoPrint-SmartPreheat

0.0.1

Operating System running OctoPrint

OctoPi 0.15.1

Printer model & used firmware incl. version

Link to octoprint.log with octoprnt.plugins.smartpreheat set to DEBUG

@kantlivelong kantlivelong added the bug Something isn't working label May 2, 2020
kantlivelong added a commit that referenced this issue May 2, 2020
self.settings.plugins.smartpreheat won't exist without at least one setting defined. Present a dummy setting for now.
@kantlivelong
Copy link
Owner

Guess I broke it when cleaning up the code before submission. Would you mind installing this patched version and let me know if it works for you?

@dlitz
Copy link
Contributor Author

dlitz commented May 3, 2020

Works great!

@kantlivelong
Copy link
Owner

Pushed the release. Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working solved
Projects
None yet
Development

No branches or pull requests

2 participants