mChat rooms and Milkv2 theme

Chat rooms for mChat with optional password protection and 1-on-1 chats
Large
Donor
Posts: 5
Joined: 06 Jul 2017, 22:13

mChat rooms and Milkv2 theme

#1

Post by Large » 19 Jan 2018, 22:36

Hello,

I was using successfully mChat rooms extension under the Prosilver and Absolution themes. However, when using Milkv2 (inherits from prosilver) the rooms appear on the right, but clicking "new room" does not show a popup, and clicking the room also does not switch to the room in question. I cleared the board cache and cookies to no avail. If I switch back to prosilver or Absolution, those functionalities resume working.

How can I troubleshoot/debug this?

thanks

User avatar
kasimi
mChat developer
Posts: 967
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: mChat rooms and Milkv2 theme

#2

Post by kasimi » 19 Jan 2018, 22:44

Hi,

it sounds very much like a JavaScript problem. Open your browser's console (Ctrl+Shift+K) and see if there's anything suspicious.

User avatar
FranckTH
Distinguished Donor
Posts: 24
Joined: 19 Nov 2016, 12:59
Location: Champagne (France)
Contact:

Re: mChat rooms and Milkv2 theme

#3

Post by FranckTH » 19 Jan 2018, 22:46

http://www.planetstyles.net/

It's not a free style, similar as Rocket Theme ... they are no support from us ? :)
Flash & HTML5 Games for the Best Arcade

Large
Donor
Posts: 5
Joined: 06 Jul 2017, 22:13

Re: mChat rooms and Milkv2 theme

#4

Post by Large » 19 Jan 2018, 22:55

yes its a planetstyle paid theme. does this mean I need to contact them? as for javascript, the developer tools show the same link in either the Absolution theme or the Milk theme

<a href="#" title="New room" data-mchatrooms-action="create">New room</a>

not sure what to look for in javascript. :(


perhaps this?

mchat:1109 Uncaught ReferenceError: jQuery is not defined
at mchat:1109
(anonymous) @ mchat:1109

User avatar
kasimi
mChat developer
Posts: 967
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: mChat rooms and Milkv2 theme

#5

Post by kasimi » 19 Jan 2018, 22:59

Large wrote:
19 Jan 2018, 22:55
yes its a planetstyle paid theme. does this mean I need to contact them?
Depends on how much effort it is to find and fix the problem. ;)

Large wrote:
19 Jan 2018, 22:55
perhaps this?

mchat:1109 Uncaught ReferenceError: jQuery is not defined
at mchat:1109
(anonymous) @ mchat:1109
Yes, that's the issue. The error sounds like it isn't just the Rooms add-on but mChat isn't working at all. Is that the case?

Anyway, find out if that style comes with jQuery. It's a requirement for mChat to work.

Large
Donor
Posts: 5
Joined: 06 Jul 2017, 22:13

Re: mChat rooms and Milkv2 theme

#6

Post by Large » 19 Jan 2018, 23:01

mchat itself does work yes. I will check with the author then unless you have any other tips, thanks in advance

Added in 1 minute 14 seconds:
the jQuery error does not appear in the developer console unless I enable the mChat rooms extension. with it disabled and mChat enabled and working, I see no error (?)

User avatar
kasimi
mChat developer
Posts: 967
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: mChat rooms and Milkv2 theme

#7

Post by kasimi » 19 Jan 2018, 23:18

As mChat works fine it does sound like an issue with Rooms. Without having a look at the code it's impossible to localize it though.

Send me a PM with a link to your board and an account with access to mChat and I'll have a look. Alternatively, send me the style's template files.

Large
Donor
Posts: 5
Joined: 06 Jul 2017, 22:13

Re: mChat rooms and Milkv2 theme

#8

Post by Large » 19 Jan 2018, 23:38

will do thank you very much

User avatar
kasimi
mChat developer
Posts: 967
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: mChat rooms and Milkv2 theme

#9

Post by kasimi » 20 Jan 2018, 09:18

I got your mail.

The Rooms extension uses the template event overall_footer_after to define some JS variables. By the time it is triggered, two things are assumed:
  • jQuery has already been included
  • extensions' script files included via INCLUDEJS have not been included via {$SCRIPTS} yet
Looking at Milk's overall_footer.html, I see the overall_footer_after event exists twice, and each of them violate one of the above requirements.

Update #1: meanwhile it looks like they have fixed the event being triggered twice. However, the event is in the wrong location, it still violates the second requirement.

mChat itself doesn't use this specific template event, which is why it works fine without the Rooms extension.

To conclude, this needs to be fixed in Milk's template files. First, it shouldn't inherit from prosilver if it doesn't follow prosilver's event structure. Second, I don't see any reason to trigger a template event twice. I'm surprised the style is shipped with these issues in them, as I imagine this causes all kinds of problems with extensions.
Last edited by kasimi on 06 Sep 2019, 20:50, edited 1 time in total.
Reason: Update #1

Large
Donor
Posts: 5
Joined: 06 Jul 2017, 22:13

Re: mChat rooms and Milkv2 theme

#10

Post by Large » 20 Jan 2018, 14:28

thank you for your help, I will forward these comments to the theme developer for review. much appreciated!

Locked

Who is online

Users browsing this forum: No registered users and 1 guest