Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[bug?] Emotify plugin makes preview not working in new discussion after upgrading to vanilla 2.2

Hi,

I have just switched from Vanilla 2.1 to 2.2 and I notice the Preview does not work anymore when posting a new discussion.
The preview works fine on comments but not on new discussion.

After some research I notice this is due to the Emotify plugin.
I am using Emotify version 2.0.5

Any clue?

Comments

  • hgtonighthgtonight ∞ · New Moderator

    Are you using an editor plugin? (Advanced Editor, Button Bar, WYSIWYG, etc)

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Standard Editor and ButtonBar, No WYSIWYG and I am using BBCode with NBBC.

    I have disabled all plugins to see which one was causing the problem an it seems the problems occurs only with Emotify.

  • hgtonighthgtonight ∞ · New Moderator

    Any particular reason you are using NBBC?

    BBCode is supported in core.

    I just tested Emotify 2.0.5.1 on a fresh install of Vanilla 2.2 with the input formatter set to BBCode and the preview worked.

    What theme are you using?

    Do you have any errors in your web console (Ctrl + Shift + K in Firefox)?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Yes, I am using NBBC because I added my own tags and I didn't want to modify the core. Anyway it's not related, I re-tested without NBBC.

    With all plugins disabled and theme set to default (Baseline version 2.2) the preview works fine!

    Then I activated Emotify 2.0.5 and the preview does not work.

    I have checked with the console and there was an error in emotify.js 37:10
    TypeError: frm.find is not a function!

    the code is the following

          // Hide emotify options when previewing
          frm.bind("PreviewLoaded", function(e, frm) {
    =>         frm.find('.EmotifyDropdown').removeClass('EmotifyDropdownActive');
             frm.find('.EmotifyDropdown').hide();
             frm.find('.EmoticonContainer').hide();
          });
    

    Apparently the find function did not exist when the function was executed, frm parameter is not what it was supposed to be!

    I have changed the code and now it works

          // Hide emotify options when previewing
          frm.bind("PreviewLoaded", function(e, frm) {
       =>          var frm = $(this).parents('form');
             frm.find('.EmotifyDropdown').removeClass('EmotifyDropdownActive');
             frm.find('.EmotifyDropdown').hide();
             frm.find('.EmoticonContainer').hide();
          });
    

    I don't know if this fix is correct but it works for me.

    Where did you get version 2.0.5.1 ?
    Thanks for the help.

  • hgtonighthgtonight ∞ · New Moderator

    I see the problem now, there is a variable collision.

    This is fixed in 2.5.1 which I got from the addons repository on GitHub.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.