Support » Theme: Canape » Javascript error in admin panel/editor

  • Hello,

    I have an error in my admin panel. The problem comes from the Theme Canape, Version: 1.0.5 :

    Uncaught TypeError: b(…).not(…).filter(…).mediaelementplayer is not a function
    at HTMLDocument.a (load-scripts.php:463)
    at j (jquery-latest.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-latest.min.js:2)
    at Function.ready (jquery-latest.min.js:2)
    at HTMLDocument.J (jquery-latest.min.js:2)

    “add media” buttons doesn’t work with this… I’ve disabled my plugin,
    replace all the folders (wp-admin, wp-include, etc…).

    (By replacing the theme with “Twenty Seventeen”, I no longer have the problem, I can add photos again.)

    An idea ?

    Thank’s

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Which browser is this occurring in? I’ve loaded Canape 1.0.5 with WordPress 4.9.2 on my test site and tried in Safari, Firefox, Firefox Developer Edition and Chrome and am not able to reproduce this issue issue. Have you tried in different browsers?

    Chrome (last version, linux). My client tried on mozilla, same.
    (If you want, I can send my credential)

    • This reply was modified 1 year, 5 months ago by  severinen.
    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Given that I cannot reproduce this in Canape or a child theme of Canape, and neither can two of our developers, I have a few suggestions/questions.

    1. It appears there may be some double enquequeing of js and jQuery going on. Have you added any enquequeing to the child theme functions.php file, or possibly did you directly insert it into the a header.php and footer.php files in the child theme?
    2. Are you on the latest version of WordPress, 4.9.2? If not, can you please update?
    3. Can you try disabling all plugins and see if the issue still occurs?
    4. Can you switch back to Canape parent instead of the child and see if the issue still occurs? (Try it with all plugins off also).
    5. Go to Users > Your Profile and set the language back to English if you have it set to a different language and see if that fixes the issue.

    Hello,

    1.no, this site was developed last summer, since the code has not been changed.
    2. WordPress 4.9.2–fr_FR. I did it again manually after the discovery of the problem.
    3. Same, I did it
    4. Yes, the problem maybe come to childtheme (I investigate…)

    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Let me know what happens when you go away from the Child Theme. Since I’ve not been able to reproduce this issue even with a child theme, I think the issue may be in the Child. Not sure why it is coming up now and did not come up earlier unless there has been some sort of change in the WordPress core software that has now brought this to light.

    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Also try #5. There was a bug a while ago that did this sort of error, but supposedly it was fixed.

    Hello,

    #5 solves nothing (French to English). I saw that it came from a function in the functions.php by the last developer, I send it to you in case :

    function custom_admin_js() {
     $url = get_bloginfo('template_directory') . '..\..\..\themes\villa_bellamy\script_admin.js';
     echo '"<script src="http://code.jquery.com/jquery-latest.min.js"
     type="text/javascript"></script><script type="text/javascript" src="'. $url . '"></script>"';
    }
    add_action('admin_footer', 'custom_admin_js');
    

    Thanks for your help 🙂

    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Did you try switching away from the child theme and back to Canape? I can’t reproduce this on my test site and I’ve tried a number of things.

    Yes, I tried.

    This must come from the file that is called in the functions.php .

    But the file is empty … Anyway, it works since I commented this function

    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    If you commented out this

    function custom_admin_js() {
     $url = get_bloginfo('template_directory') . '..\..\..\themes\villa_bellamy\script_admin.js';
     echo '"<script src="http://code.jquery.com/jquery-latest.min.js"
     type="text/javascript"></script><script type="text/javascript" src="'. $url . '"></script>"';
    }
    add_action('admin_footer', 'custom_admin_js');

    Then the issue is with that particular javascript that is being loaded. This leads me to believe that #1 I mentioned above on the double enqueue is what is causing the issue. It could be that something changed with WordPress in a recent release that caused this issue to all of a sudden pop up. If that Javascript function is needed, then the original javascript called by the original theme would first need to be deenqueued before this one was called.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Javascript error in admin panel/editor’ is closed to new replies.