How can I resolve a javascript conflict with the core calendar block
Permalink Browser Info Environment
I'm trying to use the core Calendar block and having some trouble. It works fine on my home page, but on its own page, with nothing but the Calendar block on it, it won't show. Inspecting, there appears to be a javascript conflict when logged out. It works fine when logged in. Here is my site url:https://www.brandontennis.org/calendar...
Do you have any ideas for me to resolve this?
Do you have any ideas for me to resolve this?
Type: | Ticket |
---|---|
Status: | Archived |
Hi,
My apologies for not getting back to you right away.
I used inspector on the calendar page and I see 3 javascript errors all found in the calendar addon. fullcalendar.js, lang-all.js and the calendar index. Can you try using the calendar addon on a new page running on elemental to rule out theme conflicts.
Sorry again,
James
My apologies for not getting back to you right away.
I used inspector on the calendar page and I see 3 javascript errors all found in the calendar addon. fullcalendar.js, lang-all.js and the calendar index. Can you try using the calendar addon on a new page running on elemental to rule out theme conflicts.
Sorry again,
James
I changed the Calendar page to use the Elemental theme and now the Calendar works on that page. At first, I saw no difference, but I had not cleared the site cache. The Calendar appears to be working fine within the Elemental Theme environment. Does this indicate to you a conflict with your theme?
Hi
I am not sure yet. The theme is basically getting its resources from core c5. Can you do another test? Can you create another page with the framework theme and add the calendar. I hope the calendar page had some irreparable cache issue and creating a new page will fix this
James
I am not sure yet. The theme is basically getting its resources from core c5. Can you do another test? Can you create another page with the framework theme and add the calendar. I hope the calendar page had some irreparable cache issue and creating a new page will fix this
James
I did as you requested and got the same result.
But then I tried something else and I think I discovered the problem – apparently, I cannot use the same calendar more than once, even on separate pages? I have a smaller copy of the same calendar on the Home page and then a larger version on a page of its own. When I delete the one on the home page, the full page one will show. Do you know if this is a limit of the core's Calendar block?
But then I tried something else and I think I discovered the problem – apparently, I cannot use the same calendar more than once, even on separate pages? I have a smaller copy of the same calendar on the Home page and then a larger version on a page of its own. When I delete the one on the home page, the full page one will show. Do you know if this is a limit of the core's Calendar block?
Additionally, I decided to try putting the Calendar Event List on the Home page instead of the Calendar to see if that would work. After doing this, the full-page Calendar still displayed, but with no entries showing. So, I deleted the Calendar Event List from the Home page and cleared both site and browser cache. This did not restore the entries on the Calendar. I'm beginning to feel like a cat chasing his tail in circles!
Any ideas for me?
Any ideas for me?
Ah I see. Maybe the calendar is built to exist as a single instance on a page? If that is the case, there is nothing I can do on my theme to fix this since the problem is encapsulated within the calendar addon.
The only thing we can do now is reach out to the developers or community if they have a workaround.
James
The only thing we can do now is reach out to the developers or community if they have a workaround.
James
I get this error "Uncaught TypeError: element.attr(...).magnificPopup is not a function" when inspecting your site. Can you delete the pages where the addon appeared and clear cache. Maybe there are some calendar data that was corrupted and C5 was not able to remove it?
Well, I am only using it as a single instance on a page. I'm using the calendar block on two separate pages, but each block is linked to the same calendar data. When you place the Calendar block on a page, the setup requests which Calendar to display. Having only one calendar, I wish to display it in small form on the Home page, and in Full-page view on a separate Calendar page. But there appears to be some sort of javascript conflict in doing this.
I found this link relating to a similar issue:https://stackoverflow.com/questions/26252938/fullcalendar-typeerror-...
In one of the comments, they refer to the problem being that jquery is being loaded twice. Could that be the issue here?
Anyway, I think I'll set up a test site using the Elemental theme and test the Calendar block in a number of configurations and see if I can find a pattern to identify the problem. I'll post what I find. It may have nothing to do with your theme.
Again, thanks for your help
I found this link relating to a similar issue:https://stackoverflow.com/questions/26252938/fullcalendar-typeerror-...
In one of the comments, they refer to the problem being that jquery is being loaded twice. Could that be the issue here?
Anyway, I think I'll set up a test site using the Elemental theme and test the Calendar block in a number of configurations and see if I can find a pattern to identify the problem. I'll post what I find. It may have nothing to do with your theme.
Again, thanks for your help
Well, I have installed a fresh copy of Concrete5 with the Elemental theme and installed the Calendar block on two separate pages, Home and Calendar, both displaying the same calendar data consisting of two entries on 9/5 and 9/7. Everything appears to be working as it should. While not exhaustive, this test would seem to suggest a conflict with the Framework theme, would it not?
More info:
I decided, until I can find a resolution, I would eliminate the calendar block from the home page, delete the Calendar page, and recreate the Calendar page fresh, in hopes of having just one calendar that works on the site. After doing this, the calendar now displays on the Calendar page, but the entries do not show on the calendar. Log in to edit mode and you can see the entries, but not while logged out. Strange. You can look at the working example on the Elemental theme for comparison athttp://test.mainideas.net/index.php/calendar...
I decided, until I can find a resolution, I would eliminate the calendar block from the home page, delete the Calendar page, and recreate the Calendar page fresh, in hopes of having just one calendar that works on the site. After doing this, the calendar now displays on the Calendar page, but the entries do not show on the calendar. Log in to edit mode and you can see the entries, but not while logged out. Strange. You can look at the working example on the Elemental theme for comparison athttp://test.mainideas.net/index.php/calendar...
Hi!
I did a bit of testing. And the theme and the calendar block works correctly. I can also create multiple instance of the addon on any page. Can you try installing Framework on the Elemental site you gave me. So fresh install of C5 and Framework and apply the addon. Is there any other addon you installed on your site that could cause conflict with the calendar addon?
James
I did a bit of testing. And the theme and the calendar block works correctly. I can also create multiple instance of the addon on any page. Can you try installing Framework on the Elemental site you gave me. So fresh install of C5 and Framework and apply the addon. Is there any other addon you installed on your site that could cause conflict with the calendar addon?
James
Good news,
As you found, the calendar is working on a fresh install of Framework. So, I'll look elsewhere.
I only have one add-on installed on my site, Easy Image Gallery. I'll add that into the mix on the test site and see if I get sparks.
Steve
As you found, the calendar is working on a fresh install of Framework. So, I'll look elsewhere.
I only have one add-on installed on my site, Easy Image Gallery. I'll add that into the mix on the test site and see if I get sparks.
Steve
I installed the only other add-on I am using, Easy Image Gallery and still everything works as it should on the test site.
On my site athttp://brandontennis.org, if I right click on the calendar, on the calendar page, on Chrome, and choose Inspect, I get the following error list, but doing the same thing on the test site, with a new install of everything, I get no errors. I believe it is related to missing or conflicting javascript, but I can't seem to locate it. Can you see any clues in the error list below:
Uncaught TypeError: element.attr(...).magnificPopup is not a function
at Object.eventRender (VM74 calendar:197)
at Ja.M [as trigger] (fullcalendar.js:6)
at function.b.constructor.trigger (fullcalendar.js:8)
at function.b.constructor.resolveEventEl (fullcalendar.js:8)
at HTMLAnchorElement.<anonymous> (fullcalendar.js:7)
at Function.each (jquery.js:2)
at m.fn.init.each (jquery.js:2)
at function.b.constructor.renderFgSegEls (fullcalendar.js:7)
at function.b.constructor.renderFgSegs (fullcalendar.js:7)
at function.b.constructor.renderFgEvents (fullcalendar.js:7)
at function.b.constructor.renderEvents (fullcalendar.js:7)
at function.b.constructor.renderEvents (fullcalendar.js:9)
at function.b.constructor.displayEvents (fullcalendar.js:8)
at o (fullcalendar.js:6)
at s (fullcalendar.js:6)
at fullcalendar.js:6
at Object.success (fullcalendar.js:6)
at j (jquery.js:2)
at Object.fireWith [as resolveWith] (jquery.js:2)
at x (jquery.js:5)
at XMLHttpRequest.b (jquery.js:5)
On my site athttp://brandontennis.org, if I right click on the calendar, on the calendar page, on Chrome, and choose Inspect, I get the following error list, but doing the same thing on the test site, with a new install of everything, I get no errors. I believe it is related to missing or conflicting javascript, but I can't seem to locate it. Can you see any clues in the error list below:
Uncaught TypeError: element.attr(...).magnificPopup is not a function
at Object.eventRender (VM74 calendar:197)
at Ja.M [as trigger] (fullcalendar.js:6)
at function.b.constructor.trigger (fullcalendar.js:8)
at function.b.constructor.resolveEventEl (fullcalendar.js:8)
at HTMLAnchorElement.<anonymous> (fullcalendar.js:7)
at Function.each (jquery.js:2)
at m.fn.init.each (jquery.js:2)
at function.b.constructor.renderFgSegEls (fullcalendar.js:7)
at function.b.constructor.renderFgSegs (fullcalendar.js:7)
at function.b.constructor.renderFgEvents (fullcalendar.js:7)
at function.b.constructor.renderEvents (fullcalendar.js:7)
at function.b.constructor.renderEvents (fullcalendar.js:9)
at function.b.constructor.displayEvents (fullcalendar.js:8)
at o (fullcalendar.js:6)
at s (fullcalendar.js:6)
at fullcalendar.js:6
at Object.success (fullcalendar.js:6)
at j (jquery.js:2)
at Object.fireWith [as resolveWith] (jquery.js:2)
at x (jquery.js:5)
at XMLHttpRequest.b (jquery.js:5)
Hi
Yeah ive been trying to figure out whats causing that error from the beginning. The best way to understand whats causing it is to recreate the site and see where it breaks.
It also can mean the current page is corrupted. Have you tried creating another calendar page on this site and test if the error pops up?
James
Yeah ive been trying to figure out whats causing that error from the beginning. The best way to understand whats causing it is to recreate the site and see where it breaks.
It also can mean the current page is corrupted. Have you tried creating another calendar page on this site and test if the error pops up?
James
Yes, I've created a clean new page with nothing but the Calendar block on it and I get the same result.
Strange thing is, when I login, it works fine, which leads me to believe it is loading something during Edit Mode that satisfies the needs of Calendar. I guess I'll just have to rebuild the site. Probably quicker in the long run.
Thanks,
Steve
Strange thing is, when I login, it works fine, which leads me to believe it is loading something during Edit Mode that satisfies the needs of Calendar. I guess I'll just have to rebuild the site. Probably quicker in the long run.
Thanks,
Steve
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.
To re-open this issue, reply to this message.
To re-open this issue, reply to this message.
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.
To re-open this issue, reply to this message.
To re-open this issue, reply to this message.
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.
To re-open this issue, reply to this message.
To re-open this issue, reply to this message.
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.
To re-open this issue, reply to this message.
To re-open this issue, reply to this message.
Do you have any ideas about why the core calendar block would be throwing out javascript errors on this theme? Do you have any ideas for me to resolve this?