WordPress.org

Support

Support » Plugins and Hacks » [Plugin: My Page Order] Installed, but Doesn’t Drag & Drop

[Plugin: My Page Order] Installed, but Doesn’t Drag & Drop

  • I installed the plugin like I usually do (and per instructions), and when I go into the admin page for it, I see the 4 arrow icon when I hover over a page.

    I then click on it and drag but nothing happens – just starts highlighting text. None of the buttons do anything, either.

    I tried in multiple browsers and no dice – just downloaded the plugin straight from here so that shouldn’t be a problem if everyone else is getting it to work, right? Any ideas?

Viewing 15 replies - 1 through 15 (of 50 total)
  • It sounds like an AJAX file permission problem. What do other plugin users say at the author’s site?

    Sounds like the scriptaculous Javacript libraries aren’t being loaded at all. This has happened before and it usually seems to be another plugin doing something with the includes that it shouldn’t. If the plugin page is about to be viewed, I simply do the following call:

    wp_enqueue_script('scriptaculous');

    If you look at the page source while you’re on the My Page Order page, do you see any scriptaculous includes in the head?

    sitecreations

    @sitecreations

    Definitely doesn’t work with 2.6.3. Installed properly.

    gnfoster

    @gnfoster

    Ahh, but it does work in 2.6.3

    I have it installed on about 4 web pages and each of them is 2.6.3 and each of them is working. I just checked it before this post.

    Don’t give up!!

    froman118

    @froman118

    You’ve got another plugin doing something naughty with JavaScript includes. The script.aculo.us includes get queued up when the plugin page is being loaded so another plugin is screwing with the script queue.

    New JS classes in WP 2.8 do also break the plugin 🙁

    Ok, my guess was not true. It’s the new wp_enqueue_script handling in WP 2.8 (beta2) that breaks the plugin.
    I’ve fixed it as follows:

    function mypageorder_js() {
    	if ( $_GET['page'] == "mypageorder" ) {
    		echo "<script type='text/javascript' src='http://example.org/wordpress/wp-admin/load-scripts.php?c=1&load=hoverIntent,common,jquery-color,jquery-ui-core,jquery-ui-sortable&ver=68c730824fe93e0fc4dc0373bd1d3632'></script>";
    	}
    }
    
    add_action('admin_menu', 'mypageorder_menu');
    //add_action('admin_menu', 'mypageorder_js_libs');
    add_action('admin_head', 'mypageorder_js');

    I just found another way to fix the issue in WP2.8:

    function mypageorder_js_libs() {
    	if ( $_GET['page'] == "mypageorder" ) {
    		wp_enqueue_script('jquery');
    		wp_enqueue_script('jquery.ui-core', get_bloginfo('siteurl').'/wp-includes/js/jquery/ui.core.js' , array('jquery'));
        wp_enqueue_script('jquery.ui-sortable', get_bloginfo('siteurl').'/wp-includes/js/jquery/ui.sortable.js' , array('jquery') );
    	}
    }

    Mind the change of the – into a . in the script names.

    Probably also applies to the My Category Order and My Link Order plugins.

    [UPDATE] Humm… strange, haven’t changed anything since I applied the changes but all of the sudden my fix stopped working. Have now also tested jottlieb’s fix and that one keeps working 🙂

    Thanks for looking into it guys. Not sure why it would stop working since all the other parameters on wp_enqueue_script are optional. There’s also a new admin_enqueue_scripts hook I’m going to try using. Hopefully I’ll have time to get everything updated before 2.8 is released.

    Got it. The scripts are being enqueued fine, but they are being included by default in the footer on every single Admin page now. I was just sticking the .sortable() call in a script tag which worked fine when the jQuery files were included in the header, but not so much now that they’re in the footer. Just need to use ready() to wait until everything loads:

    jQuery(document).ready(function(){
    jQuery(“#order”).sortable({
    placeholder: “ui-selected”,
    revert: false,
    tolerance: “pointer”
    });
    });

    The workarounds you guys mentioned shouldn’t be used because it will lead to the jQuery files being included more than once (I think).

    I’ll make sure I have this done for the 2.8 release. I’ll fix it on my other plugins too and I want to move to the new Widget API and finally add support for multiple My Category Order and My Link Order widgets.

    Super, I’m looking forward to the new releases 😉

    Thank you for your quick answer froman!

    My script include should only start when the my-page-order page is display, but however my solution is not good (because of hard inluding the scripts) and just a workaround until final WP 2.8 is released and you will fix it in the right way 🙂

    HI, just updated to 2.8 and My Category order is no longer working. Cannot drag and drop and also the widget states there are no Categories.

    Look forward tot he new release – thanks!

    Thanks for the post. For non technical people like myself (took me a while to figure out what to do with the code) here is where to insert.

    Find: (around line 113 on mypageorder)
    <script language=”JavaScript”>
    jQuery(“#order”).sortable({
    placeholder: “ui-selected”,
    revert: false,
    tolerance: “pointer”
    });

    Replace with:
    <script language=”JavaScript”>
    jQuery(document).ready(function(){
    jQuery(“#order”).sortable({
    placeholder: “ui-selected”,
    revert: false,
    tolerance: “pointer”
    });
    });

    It still doesn’t work for me sahdow.

Viewing 15 replies - 1 through 15 (of 50 total)
  • The topic ‘[Plugin: My Page Order] Installed, but Doesn’t Drag & Drop’ is closed to new replies.
Skip to toolbar