Javascript error when no featured image is set on hover preview

Home Forums Calendar Products Events Calendar PRO Javascript error when no featured image is set on hover preview

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1006799
    MIKE
    Participant

    I’ve discovered a javascript error due to not having a featured image set on my events. This occurs on the hover previews of the calendar view.

    Uncaught TemplateError: 
    TypeError: Cannot read property 'length' of null (on tribe_tmpl_tooltip line 8)(anonymous function) 
    @ tribe_tmpl_tooltip:19(anonymous function) 
    @ tribe-events.min.js:1a 
    @ tribe-events.min.js:1(anonymous function) 
    @ tribe-events.min.js:1m.event.special.(anonymous function).handle 
    @ jquery.js:4m.event.dispatch 
    @ jquery.js:4r.handle @ jquery.js:4
    6tribe_tmpl_tooltip:19 Uncaught TemplateError: 
    TypeError: Cannot read property 'length' of null (on tribe_tmpl_tooltip line 8)

    The value of imageTooltipSrc is null when no featured image is set for the event.
    Obviously setting the featured images on my events will solve this, but thought you should know to account for this in your code.
    Nulls, I know, right?

    • This topic was modified 10 years, 7 months ago by MIKE.
    #1006802
    MIKE
    Participant

    Actually, perhaps now that I’m editing my events, it seems that the Featured Image is set, but to an image that no longer exists. Either the attachment meta is gone, or the image is gone. Maybe both, but the event meta still retains the association. Hope that helps further.

    #1007075
    Barry
    Member

    Hi Mike,

    Thanks for the report!

    I don’t actually see the same problem, even if I manually delete the actual image file to try and create the same conditions (of a featured image being set, but without an accessible file).

    Is it possible you have some customizations in place (custom templates perhaps) that might be impacting, or is there anything else you can think of to help us replicate (or could you even link to a live example of the problem)? I tried visiting the URL you provided but was unable to locate the main events page.

    Thanks!

    #1007085
    MIKE
    Participant

    I’ve since made the corrections to the featured images. This site had been copied to a new directory, which is probably why the post still thought it had a featured image, but the references to that image were gone. Not an issue now, more of an alert for you guys that the value of imageTooltipSrc can be null in obscure situations and that will cause the tooltip to not show. I know from reading other posts that people had issues with this and the fix was different. Thanks guys!

    #1007122
    Barry
    Member

    Fantastic – and thanks again for highlighting this 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Javascript error when no featured image is set on hover preview’ is closed to new replies.