MyBB Community Forums

Full Version: 1.8.6 modal close issues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
After upgrading to 1.8.6 I noticed that the modal which is displayed after adding reputation (template: reputation_added) sometimes does not close properly. What happens after clicking the close button is that the modal stays and the close button disappears (see screenshot). It is not easy to reproduce this, but it occasionally happens. However, if I add below code to the reputation_added template, this is reproduced all the times:

<script type="text/javascript">setTimeout($.modal.close(), 1000);</script>

I didn't have this issue in 1.8.5 (even with the above JS in the template). Is there any change made to the modals in 1.8.6?
bump thread
Alright, I was finally able to reproduce the problem consistently. If you give two reputations to two posts on one page (without navigating to a different page or refreshing the page), the second time the confirmation modal after adding the reputation remains on the screen.
I went back and compared the modal plugin in 1.8.5 and 1.8.6 and noticed that the following lines are removed from the modal.close function:
- // Deletes the element (multi-modal feature: e.g. when you click on multiple report buttons, you will want to see different content for each)
- if (!this.options.keepelement)
- this.$elm.remove();

These lines are necessary or the problem mentioned in this thread happens. I added them back to jquery.plugins.min.js and the problem is fixed.
Can confirm the issue.

(Moved to 1.8 Bugs and Issues)

EDIT: Issue already on GitHub: https://github.com/mybb/mybb/issues/2199
(2015-09-17, 10:23 PM)Starpaul20 Wrote: [ -> ]Can confirm the issue.

(Moved to 1.8 Bugs and Issues)

EDIT: Issue already on GitHub: https://github.com/mybb/mybb/issues/2199

Yes, I posted in on GitHub myself.
i need to fix this please show step by step how you fixed it
(2015-10-09, 03:20 AM)luciferakasatan Wrote: [ -> ]i need to fix this please show step by step how you fixed it

There's a PR on github. You can apply the code to the affected file general.js file and bump its ver parameter in files/templates.