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?

Type: Ticket
Status: Archived
Pixelfixer
View Replies:
Pixelfixer replied on at Permalink Reply
Pixelfixer
C5Box,
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?
c5box replied on at Permalink Reply
c5box
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
Pixelfixer replied on at Permalink Reply
Pixelfixer
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?
c5box replied on at Permalink Reply
c5box
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
Pixelfixer replied on at Permalink Reply
Pixelfixer
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?
Pixelfixer replied on at Permalink Reply
Pixelfixer
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?
c5box replied on at Permalink Reply
c5box
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
c5box replied on at Permalink Reply
c5box
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?
Pixelfixer replied on at Permalink Reply
Pixelfixer
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
Pixelfixer replied on at Permalink Reply
Pixelfixer
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?
Pixelfixer replied on at Permalink Reply
Pixelfixer
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...
c5box replied on at Permalink Reply
c5box
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
Pixelfixer replied on at Permalink Reply
Pixelfixer
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
Pixelfixer replied on at Permalink Reply
Pixelfixer
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)
c5box replied on at Permalink Reply
c5box
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
Pixelfixer replied on at Permalink Reply
Pixelfixer
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
ConcreteCMS replied on at Permalink Reply
ConcreteCMS
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.
ConcreteCMS replied on at Permalink Reply
ConcreteCMS
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.
ConcreteCMS replied on at Permalink Reply
ConcreteCMS
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.
ConcreteCMS replied on at Permalink Reply
ConcreteCMS
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.

concrete5 Environment Information

# concrete5 Version
Core Version - 8.3.2
Version Installed - 8.3.2
Database Version - 20180122213656

# concrete5 Packages
Easy Image Gallery (1.4.2), Framework Theme (1.7.6)

# concrete5 Overrides
None

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
7.0.31

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, intl, ionCube Loader, json, libxml, mbstring, mcrypt, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, Reflection, session, SimpleXML, soap, sockets, SPL, sqlite3, standard, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 4000
memory_limit - 512M
post_max_size - 128M
sql.safe_mode - Off
upload_max_filesize - 128M
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.