Skip to content

Conversation

vietlx426
Copy link

Hi @srobotta Currently after selecting text in TinyMCE and applying a language through the Language button, the multilang content is not properly saved to the server, causing a disconnect between what's displayed in the editor and what's actually stored.

Steps to reproduce:

  1. Navigate to any activity
  2. On activity settings page -> TinyMCE box -> Type any word-> select the word
  3. Click on Language button
  4. Choose any language from the list
  5. Save the changes and check the activity page
image

Result :
image

Root Cause: The root cause of this issue is when we save a form that contains multilang content, the multilang2 plugin listens to the submit event and calls removeVisualStyling(). This function processes the editor content by converting TinyMCE's visual placeholder tags.
The problem is that after removeVisualStyling() modifies the editor content, the plugin doesn't sync these changes back to the underlying form field. So while the editor display shows the processed content, the form still submits the original unprocessed content to the server.

Solution: Add editor.save() call after removeVisualStyling() to force TinyMCE to sync the modified editor content back to the actual form field that gets submitted to the server.
Could you please review my PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant