Settings Not Available

  • Author
    Posts
  • #26857
    Alan Kellogg

    Oh, the settings page opens, but the specific drop downs don’t open

    #27243
    Paul

    I have reproduced this error:

    Env:
    WP 4.0 (clean install on linux)
    Nirvana 0.9.5.1 (taken from SVN a few hours after checkin!)

    Reproduce:
    In any browser (IE11 or Chrome 39.0.2159.4 canary (64-bit) or normal Chrome release)
    Open WP admin
    Install Nirvana and activate style
    Go to Appearance/Nirvana Settings
    The settings page is shown but the accordion will not work (nothing expands)

    Diagnosis:
    [A similar issue has been raised on Parabola http://www.cryoutcreations.eu/forums/t/a-problem-with-your-wordpress-jquery-library that has very similar code to Nirvana]

    In this case there is an error on the admin.js script (I think caused by something not loading correctly) where wp is defined but wp.media is not – so you are reading through a null reference.

    _orig_send_attachment = wp.media.editor.send.attachment

    Hack:
    I have proven this to be the issue because I took this whole function out of the jQuery.ready function and now the settings accordion works and I can actually set things!

    This is NOT the correct fix but I offer it as the only way I can get it working. Over to you guys to correct properly as only you can!

    Many thanks for a great theme!

    jQuery(document).ready(function() {

    var uploadparent = 0;
    function media_upload( button_class) {
    // var _custom_media = true,
    // _orig_send_attachment = wp.media.editor.send.attachment;
    // jQuery(‘body’).on(‘click’,button_class, function(e) {
    // uploadparent = jQuery(this).closest(‘div’);
    // var button_id =’#’+jQuery(this).attr(‘id’);
    // /* console.log(button_id); */
    // var self = jQuery(button_id);
    // var send_attachment_bkp = wp.media.editor.send.attachment;
    // var button = jQuery(button_id);
    // var id = button.attr(‘id’).replace(‘_button’, ”);
    // _custom_media = true;
    // wp.media.editor.send.attachment = function(props, attachment){
    // if ( _custom_media ) {
    // jQuery(‘.custom_media_id’).val(attachment.id);
    // uploadparent.find(‘.slideimages’).val(attachment.url);
    // uploadparent.find(‘.imagebox’).attr(‘src’,attachment.url);
    // jQuery(‘.custom_media_image’).attr(‘src’,attachment.url).css(‘display’,’block’);
    // } else {
    // return _orig_send_attachment.apply( button_id, [props, attachment] );
    // }
    // }
    // wp.media.editor.open(button);
    // return false;
    // });
    }

    #27598
    Paul

    FYI – All – a big thank you to the dev team for sorting this with a patch in v0.9.6 of Nirvana!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Settings Not Available’ is closed to new replies.