Javascript error for DC Megamenu?

Permalink Browser Info Environment
I am trying to release my website today, but as soon as I enabled the cache on my site I started receiving JSerrors on DCMegaMenu. I've since cleared cache multiple times in C5 and in all my browsers but I am getting odd menu behavior. The second layer of menu is displaying all the time.

Here is the error I am receiving:
Uncaught TypeError: $(...).dcMegaMenu is not a function
at VM173:1325
at dispatch (jquery.js:4)
at r.handle (jquery.js:4)

Here is the VM content:

$(window).load(function() {
$('#mega-menuh-594').fadeIn('fast');
$('#mega-menuh-594').dcMegaMenu({
rowItems: '4',
speed: 200,
effect: 'fade',
event: Modernizr.touch ? 'click' : 'hover',
navigateOnCollapse: Modernizr.touch ? true : '1',
direction: 'down',
fullWidth: false
});
$('#mega-menuh-594 .sub-container').hide();
});

Additionaly is the error in Safari's debugger:
$('#mega-menuh-594').dcMegaMenu is not a function. (In '$('#mega-menuh-594').dcMegaMenu', '$('#mega-menuh-594').dcMegaMenu' is undefined)


Attaches is a screenshot of whats happening. You can see it at
http://dev.bayleaf.org


Disabling site cache corrects the issue.
Any pointers would be appreciated. I really need to release today.
thanks

1 Attachment

Type: Ticket
Status: Archived
bayleafmedia
View Replies:
bayleafmedia replied on at Permalink Reply
bayleafmedia
I've narrowed it down to the block cache (first caching option in C5). with it disabled the menu works. when enabled it does not.

thanks
jb1 replied on at Permalink Reply
jb1
Apologies for the delay in getting back to you, and thanks for your patience.

It sounds like the required Javascript file for the Mega Menu isn't being loaded. This is unlikely to be anything to do on the Mega Menu end as it complies with the best practices for C5. My guess is something in the C5 database has gone pear-shaped. If using a server level caching system (like Varnish or APC) it could help to try clearing those.

Sometimes C5 doesn't do a great job in sorting the loading order of JS files, so that could also be a cause.

Hope this helps.

JB
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.2.1
Version Installed - 8.2.1
Database Version - 20170802000000

# concrete5 Packages
Customize Editing Interface (1.0.1), Easy Social Feed (1.0.1), Fundamental (4.0.4), Image with Focuspoint (1.02), Magic Tabs (7.1.2), Mega Menu (1.6.2.2), Responsive Embed (1.0.1), Script Output (1.0), SVG Social Media Icons (0.9.9), Vimeo Video (1.0.2)

# concrete5 Overrides
None

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - On - If blocks on the particular page allow it.
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
7.0.18

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imap, intl, ionCube Loader, json, libxml, mbstring, mcrypt, mysqli, odbc, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, pspell, Reflection, session, SimpleXML, soap, sockets, SPL, sqlite3, standard, tidy, tokenizer, wddx, 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 - 1000
memory_limit - 256M
post_max_size - 64M
sql.safe_mode - Off
upload_max_filesize - 64M
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
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.11; rv:54.0) Gecko/20100101 Firefox/54.0

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.