0

I'm running Drupal 7.54 and for some strange reason my admin menu on top disappears. This happens sporadically, no telling what's going to happen next. I've done some searching and found

$conf['admin_menu_cache_client'] = FALSE;

I added this line of code to the settings.php file and that didn't help.

I was wondering if anyone else had experienced the same problem and tried any solutions.

below is the javascript error

GET https://www.nokidhungry.org/modules/comment/comment.css?otg3j2 
smiah:18 Uncaught TypeError: Cannot read property 'prototype' of undefined
    at HTMLDocument.<anonymous> (js_lfuW81Xw_ijrPfg5E_XWjUDemAzqGwWRZunpwj_BL20.js:1032)
    at c (jquery.min.js:4)
    at Object.fireWith [as resolveWith] (jquery.min.js:4)
    at Function.ready (jquery.min.js:4)
    at HTMLDocument.q (jquery.min.js:4)
    at HTMLDocument.nrWrapper (smiah:18)
(anonymous) @ js_lfuW81Xw_ijrPfg5E_XWjUDemAzqGwWRZunpwj_BL20.js:1032
c @ jquery.min.js:4
fireWith @ jquery.min.js:4
ready @ jquery.min.js:4
q @ jquery.min.js:4
nrWrapper @ smiah:18

I think the error below is causing the issue and I don't know how to get rid of it.

enter image description here

12
  • 2
    It's very possibly a JavaScript error on your page when it disappears. Next time it happens, open a console and look for an error.
    – Jaypan
    Commented Jul 21, 2017 at 14:59
  • I have a X Failed to load resource: the server responded with a status code of 403 comment.css
    – unixmiah
    Commented Jul 21, 2017 at 15:02
  • CSS won't cause that issue. JS issues are the only thing that would cause it.
    – Jaypan
    Commented Jul 21, 2017 at 15:02
  • Uncaught TypeError: Cannot read property 'prototype' of undefined ?
    – unixmiah
    Commented Jul 21, 2017 at 15:04
  • Yep, that's it. Can't really debug it easily from here though. Maybe post the line of code that it refers to, and the previous few lines to that.
    – Jaypan
    Commented Jul 21, 2017 at 15:05

1 Answer 1

1

Here's a checklist of things to look at:

  • Drupal simply concatenates files during aggregation. Malformed scripts may cause the entire thing to blow up. Disable aggregation first to see the code in plain so it's easier to debug.

  • Aggregation can also lead to some weird issues together with caching. Ensure that you've refreshed the cache for both Drupal, browser and any external file systems (i.e. S3) to ensure that you're working with updated code and content.

  • Malformed CSS, believe it or not, can also cause aggregation to blow up. Chrome does not show any error of this happening. However, Firefox prints a warning if it does. Debug in Firefox to see some errors not shown by Chrome.

  • If you're using S3 for storage, ensure that all of your resources are present. Sometimes, the file may not be accessible from S3, fail to upload to S3, or just be missing (i.e. deleted accidentally).

  • You already mentioned disabling admin menu caching. That has solved this problem for me in two projects.

  • Clear all caches (drush cc all). Always worked. :D

1
  • This keeps happening. I do drush cc all, it goes work but sometimes it doesn't -- ts very random. I want to get rid of the javascript error which I think is causing the issue.
    – unixmiah
    Commented Jul 21, 2017 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.