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] Quest Preview TinyMCE editor not saved properly under FVTT 0.7.3+ #97

Open
aaclayton opened this issue Oct 4, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@aaclayton
Copy link

aaclayton commented Oct 4, 2020

The TinyMCE editor in the QuestPreview app doesn't save properly anymore because of some changes to the FormApplication class in FVTT version 0.7.3+

You currently do this:

  /**
   * When editor is saved, we want to update and save quest.
   *
   * @param target
   * @param element
   * @param content
   * @returns {Promise<void>}
   * @private
   */
  async _onEditorSave(target, element, content) {
    this.quest[target] = content;
    this.saveQuest();
  }

Ths _onEditorSave() method no longer exists in the core FVTT code. You need to do something like this:

/** @override */
saveEditor(name) {
  const editor = this.editors[name];
  this.quest[name] = editor.mce.getContent();
  super.saveEditor(name);
  this.saveQuest();
}
@alcobeard
Copy link

alcobeard commented Nov 18, 2020

didn't work fvtt 0.7.7

The TinyMCE editor in the QuestPreview app doesn't save properly anymore because of some changes to the FormApplication class in FVTT version 0.7.3+

You currently do this:

  /**
   * When editor is saved, we want to update and save quest.
   *
   * @param target
   * @param element
   * @param content
   * @returns {Promise<void>}
   * @private
   */
  async _onEditorSave(target, element, content) {
    this.quest[target] = content;
    this.saveQuest();
  }

Ths _onEditorSave() method no longer exists in the core FVTT code. You need to do something like this:

/** @override */
saveEditor(name) {
  const editor = this.editors[name];
  this.quest[name] = editor.mce.getContent();
  super.saveEditor(name);
  this.saveQuest();
}

@dmkuda
Copy link

dmkuda commented Nov 18, 2020

didn't work fvtt 0.7.7

The TinyMCE editor in the QuestPreview app doesn't save properly anymore because of some changes to the FormApplication class in FVTT version 0.7.3+
You currently do this:

  /**
   * When editor is saved, we want to update and save quest.
   *
   * @param target
   * @param element
   * @param content
   * @returns {Promise<void>}
   * @private
   */
  async _onEditorSave(target, element, content) {
    this.quest[target] = content;
    this.saveQuest();
  }

Ths _onEditorSave() method no longer exists in the core FVTT code. You need to do something like this:

/** @override */
saveEditor(name) {
  const editor = this.editors[name];
  this.quest[name] = editor.mce.getContent();
  super.saveEditor(name);
  this.saveQuest();
}

Make sure async_onEditorSave is replaced. Replace that whole section with this, and it will work:

 /**
   * When editor is saved, we want to update and save quest.
   *
   * @param target
   * @param element
   * @param content
   * @returns {Promise<void>}
   * @private
   */
  
   saveEditor(name) {
  	const editor = this.editors[name];
  	this.quest[name] = editor.mce.getContent();
  	super.saveEditor(name);
  	this.saveQuest();  
  }

@eclarke12 eclarke12 mentioned this issue Nov 19, 2020
@alcobeard
Copy link

my damn eyes.......it was night already yesterday in Moscow when I tried to fix it, so I was trying to change these lines in quest-form app, not in QuestPreview. Thanks a lot!

didn't work fvtt 0.7.7

The TinyMCE editor in the QuestPreview app doesn't save properly anymore because of some changes to the FormApplication class in FVTT version 0.7.3+
You currently do this:

  /**
   * When editor is saved, we want to update and save quest.
   *
   * @param target
   * @param element
   * @param content
   * @returns {Promise<void>}
   * @private
   */
  async _onEditorSave(target, element, content) {
    this.quest[target] = content;
    this.saveQuest();
  }

Ths _onEditorSave() method no longer exists in the core FVTT code. You need to do something like this:

/** @override */
saveEditor(name) {
  const editor = this.editors[name];
  this.quest[name] = editor.mce.getContent();
  super.saveEditor(name);
  this.saveQuest();
}

Make sure async_onEditorSave is replaced. Replace that whole section with this, and it will work:

 /**
   * When editor is saved, we want to update and save quest.
   *
   * @param target
   * @param element
   * @param content
   * @returns {Promise<void>}
   * @private
   */
  
   saveEditor(name) {
  	const editor = this.editors[name];
  	this.quest[name] = editor.mce.getContent();
  	super.saveEditor(name);
  	this.saveQuest();  
  }

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

Successfully merging a pull request may close this issue.

3 participants