1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Troubleshooting and Problems' started by TrevC, Jan 29, 2013.

  1. TrevC

    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:
    TypeError: this.$form.parents(".xenOverlay").data("overlay") is undefined
    That's from Firebug, Chrome's console shows:
    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
  2. Chris D

    Chris D XenForo Developer Staff Member

    Is this the only javascript thing that isn't working?

    I've seen random JS errors caused by including a newer or older version of jQuery than the one provided.

    The other thing could be you've included some other javascript (either external or inline) that is broken, but it is actually causing Xenforo code to be broken.

    If you create a new style with no parent, does the problem still exist? That definitely proves it's more style/template related.

    Also do a File Health Check in Admin CP > Tools > File Healthcheck this will make sure the js files have the expected contents.
  3. TrevC

    TrevC Well-Known Member

    It's most likely style/template related. Using a different child style adjacent to the broken one works fine.

    I've reverted many of the templates in the affected style to find the culprit. It's extremely tedious/time-consuming... no luck so far. What is Xenforo expecting to find after that watch/un-watch dialog is confirmed?

    I must have overlooked/missed something, or it's something more obscure and higher level (unlikely).
  4. TrevC

    TrevC Well-Known Member

    - jQuery is the stock version, 1.5.2 or whatever.
    - File health just shows the /install dir missing, plus a few core files that have minor mods (mostly image/attachment related).

    Neither of these will be it, since switching the style resolves the JS console errors/bugs. If the JS errors were more informative, I'd have a better idea where to look.
  5. TrevC

    TrevC Well-Known Member

    The full output from chrome console:
    OverlayLoader for threads/speedy-x33-floating-in-space.3236/watch-confirm xenforo.js:13
    [div.xenOverlay __XenForoActivator, constructor: function, init: function, selector: "", jquery: "1.5.2", size: function…]
    ) xenforo.js:12
    Abort pending field validation... xenforo.js:14
    Event: AutoValidationDataReceived xenforo.js:13
    : Okay xenforo.js:14
    Event: AutoValidationComplete xenforo.js:13
    [div.xenOverlay, selector: "", context: undefined, constructor: function, init: function, selector: ""…]
    Uncaught TypeError: Cannot call method 'getTrigger' of undefined xenforo.js:13
    XenForo.AutoValidator.ajaxSaveResponse xenforo.js:13
    (anonymous function) xenforo.js:12
    h xenforo.js:12
    f.resolveWith jquery.min.js:16
    v jquery.min.js:16
    c jquery.min.js:16
  6. Chris D

    Chris D XenForo Developer Staff Member

    Actually, you do have bigger javascript problems than you think...

    I'm just registering at your site via Facebook.

    There's two tabs. One to create a new account, one to associate an existing.

    Both the tabs content is displayed. javascript would normally hide the unselected tabs content until the tab is clicked.

  7. TrevC

    TrevC Well-Known Member

    That's actually the old site theme. The newer version makes more drastic changes to the templates. A few changes/bugs might have trickled back to the old version.

    Let me know your username and I'll put you on the even more broken v2.0 :)
  8. Chris D

    Chris D XenForo Developer Staff Member

    Same as here :)
  9. TrevC

    TrevC Well-Known Member

    Ok. Welcome to the party/chaos :)
  10. Chris D

    Chris D XenForo Developer Staff Member

    Ok, all... I'm stuck!

    This is not a javascript error. The same javascript files work fine on other styles. Only on the new style that TrevC is creating do we see this error with Thread Watch / UnWatch.

    I asked Trev to enable debug mode and enable full/xenforo.js and this is the error:

    Trev has reverted a number of templates and the issue persists and we as a precaution we overwrote the JS files with stock files from the xf package and problems persist.
    Anyone else with ideas? Would be greatly appreciated :)
  11. jmurrayhead

    jmurrayhead Well-Known Member

    Is it possible that the data-overlay attribute on the xenOverlay is missing or null? Does the overlay display at all? Look at it's markup.
  12. TrevC

    TrevC Well-Known Member

    Any idea which template stores the overlay?

    I was thinking something along those lines, but couldn't figure out where the overlay markup etc is generated from. Thanks for your input.
  13. TrevC

    TrevC Well-Known Member

    Just to follow up:

    The overlay to confirm or cancel does show up, and is properly closed. I assume there's also supposed to be something like a .xenOverlay .timedMessage style overlay after an option is chosen? This is never created.
  14. TrevC

    TrevC Well-Known Member

    Yep. This is created on the stock Xenforo style, but not mine. Must be related to the error. Where is this overlay created from?

    I'm running entirely stock JS files at this point, and have tried reverting many templates back to originals with no success.
  15. cclaerhout

    cclaerhout Well-Known Member

    When your recompiled the xenforo.js file did you include the external scripts such as jquery tools, easing, etc ?
    About the error message try to see if the missing function is or is not in the js file. Don't only stop to the error. Correct me if I'm wrong but if you revert all your templates mods is it working (export your style first to make a backup of your modifications)
    Try to turn off TMS to avoid any unwanted modification during the debugging
  16. TrevC

    TrevC Well-Known Member

    At the moment I'm running purely stock JS directory from 1.1.1, with the addition of TinyMCE Fix (which i'm very confident is not the issue here). Not running TMS. I've also tried disabling all add-ons (they're not the issue anyhow).

    Right not I'm going through and reverting templates one by one, no matter how unrelated they seem. Still haven't hit the lucky one.

    You'd think thread_view or the usual suspects for that page could be it, but they don't appear to be.
  17. Chris D

    Chris D XenForo Developer Staff Member

    It actually doesn't matter about the xenforo.js file. The same xenforo.js file works fine on another style.

    So frustrating this issue is :(
    cclaerhout likes this.
  18. TrevC

    TrevC Well-Known Member

    Yeah, my hacked up JS didn't appear to be the culprit, at least not directly.

    I still wanted to eliminate all possibilites, so I'll keep the 1.1.1 stock stuff running locally.
  19. cclaerhout

    cclaerhout Well-Known Member

    Sorry my ipod ran out of battery. Don't hesitate to disable the FixTiny addon. In fact disable all addons is better.

    To avoid to revert all your templates you can try to create a stupid template listener (after rendered) to display the templates name (use a simple echo, var_dump, etc.) which are loading on the page with the watch/unwatch function. As we've learnt with Chris the templates which use the xen tag "include" won't be displayed but you should still have most of them. Then check if among the displayed template names one has been modified.
  20. TrevC

    TrevC Well-Known Member

    Thanks for the suggestions.

    For now I have a new problem. I deleted a style property group within my style, but it appears to have deleted the MASTER property group for overlays. Awesome.


    So, now i need to restore that missing property group without disrupting an active forum. If I copy over the install folder and run the "Rebuild Master Data" option, will that create further problems on a live site?

Share This Page