Watch/un-watch thread JS error. Completely stumped.

TrevC

Well-known member
I'm hoping someone here who's more knowledgeable with Xenforo JS can point me in the right direction. I can't figure out what's causing this error after trying to watch or un-watch a thread:
Code:
TypeError: this.$form.parents(".xenOverlay").data("overlay") is undefined
That's from Firebug, Chrome's console shows:
Code:
Uncaught TypeError: Cannot call method 'getTrigger' of undefined

The ajax indicator then remains visible, and the watch/unwatch button text does not toggle.

I can reproduce this any time I do "Watch thread" then confirm within the dialog overlay. Un-watching a thread triggers the same error.

I'm afraid I've removed something from the templates which the Xenforo JS is referencing, but I have no idea what it could be. I've reverted many of the custom templates to originals for troubleshooting and had no luck.

What could I be missing here? What is that JS looking for and not finding?

Reverting to the completely stock Xenforo theme sorts it out, it works fine. I've gone as far as reverting all my custom templates right down to the page_container and still hit the same error.

Any pointers would be much appreciated. Thanks
 

TrevC

Well-known member
I managed to delete a style properties group (the one for overlays), not a template.

Given what the Xenforo UI presented, I was under the impression "deleting" a style properties group would only affect the currently selected style, not the masters.
 

jmurrayhead

Well-known member
From what I can see, the error is saying that it can't find the overlay that opens up when you click "watch thread" or "unwatch thread". This is coming from the XenForo.AutoValidator function. The XenForo JavaScript wires up it's events mostly by class names (e.g. xenOverlay) and data attributes (e.g. data-overlay). They are case sensitive. Look for your style's thread_watch template and compare it to the default. Ensure that the form has these classes set:
Code:
class="xenForm formOverlay AutoValidator"
 

cclaerhout

Well-known member
I managed to delete a style properties group (the one for overlays), not a template.

Given what the Xenforo UI presented, I was under the impression "deleting" a style properties group would only affect the currently selected style, not the masters.
I've never tried this ^^ I can't confirm. In this case I guess the simplest would be to rebuild your templates/styles. But again save your modifications first.
 

TrevC

Well-known member
Also, keep in mind absolutely none of our master styles were modded, so this could've very well been a xenforo glitch that we've fixed for now.

Unfortunately I've lost my custom control panel and I assume the custom email templates. Can't have everything huh? I wish email templates in Xen didn't suck so badly.

Is there any straight forward way to bring back those templates + admin panel style? Is it obvious in the DB? we have tons of backups.
 

cclaerhout

Well-known member
Also, keep in mind absolutely none of our master styles were modded, so this could've very well been a xenforo glitch that we've fixed for now.

Unfortunately I've lost my custom control panel and I assume the custom email templates. Can't have everything huh? I wish email templates in Xen didn't suck so badly.

Is there any straight forward way to bring back those templates + admin panel style? Is it obvious in the DB? we have tons of backups.
What about the backup xml (export) I adviced you two times to do? :rolleyes:;)
I don't think you can get it back from db but I'm not a specialist.
 

TrevC

Well-known member
I think we're talking about different things here. I do keep .xml backups of any styles I'm working on. AFAIK, they don't even contain the Xenforo email templates or admin CP templates.
 

cclaerhout

Well-known member
I think we're talking about different things here. I do keep .xml backups of any styles I'm working on. AFAIK, they don't even contain the Xenforo email templates or admin CP templates.
I've just discovered email templates are not stored with public templates... the button is still very big. My mistake sorry. And you're pointing something interesting: isn't there anyway to export admin templates?
Edit... I think there is... create an addon and set the master template to this addon. It should work.
 

Chris D

XenForo developer
Staff member
They were in the DB. Rebuilding Master Data probably overwrote them.

I see no reason why the e-mail and admin templates shouldn't be treated the same as public templates in a future version.
 

TrevC

Well-known member
I see no reason why the e-mail and admin templates shouldn't be treated the same as public templates in a future version.

You'd assume they were clever enough to think of and realise this. I'm guessing it was just time constraints and admin styles were low-priority ;)

We have plenty of DB backups, daily off-site and on-site. Just need to find where the email templates are.
 

cclaerhout

Well-known member
You'd assume they were clever enough to think of and realise this. I'm guessing it was just time constraints and admin styles were low-priority ;)

We have plenty of DB backups, daily off-site and on-site. Just need to find where the email templates are.
Which solutions do you have to perform those backups?
 

TrevC

Well-known member
Unsure, it's not my department. I leave that to a guy who is qualified enough to have a unix-beard. ;)

It's RAID SSD's, current-gen Xeons... so, backups don't take too long. They don't affect the forum at all. We can take snapshops whenever required, or if I'm about to try something weird.
 

cclaerhout

Well-known member
Unsure, it's not my department. I leave that to a guy who is qualified enough to have a unix-beard. ;)

It's RAID SSD's, current-gen Xeons... so, backups don't take too long. They don't affect the forum at all. We can take snapshops whenever required, or if I'm about to try something weird.
Oh you're really developing for a major website. I go back to my shared hosting and its low memory ;)
 
Top