carlonicora/obsidian-rpg-manager

[Bug]: Chapter Wizard not working

FStriewski opened this issue · 2 comments

Check for existing bug reports before submitting.

  • I searched for existing Bug Reports and found no similar reports.

Expected Behavior

  • Clicking "Create" should create a new chapter of the campaign
  • Clicking "Cancel" should close the wizard

Current behaviour

  • Clicking "Create" is throwing error "cannot read properties of undefined (reading: campaignPath)", does not create chapter.
  • Clicking "Close" is throwing error "close is not a function" (closing is only possible with the X button, top right corner), does not close the wizzard

Capture1

Reproduction

  • Create new campaign via Create New.. sidepanel
  • Create adventure and link via side panel
  • Create chapter for adventure with chapter wizard via side panel, fill out necessary fields
  • Try to use said buttons

Which Operating Systems are you using?

  • Android
  • iPhone/iPad
  • Linux
  • macOS
  • Windows

Obsidian Version Check

1.15.12

Plugin Version

4.1.14

Confirmation

  • I have disabled all other plugins and the issue still persists.

Possible solution

No response

Issue with closing the dialog:

Seems like you create the ChapterWizardComponent from CreationComponent (and not from WizardController) and pass undefined to the close function:
https://github.com/carlonicora/obsidian-rpg-manager/blob/master/src/components/creation/CreationComponent.tsx#L117

In WizardController the close function is defined.

Issue with create:

You can just use campaignPath here, as element is undefined.
https://github.com/carlonicora/obsidian-rpg-manager/blob/master/src/components/wizards/chapters/ChapterWizardComponent.tsx#L241

However then there is still an issue with the FileCreationService... I think this needs proper debugging