Support

Account

Home Forums General Issues Can No Longer Drag to Change Field Order

Solved

Can No Longer Drag to Change Field Order

  • Updated to 4.2.2 today & noticed I can no longer drag the custom fields to change the order.

  • Hi @kisabelle

    Can you please do 2 things:

    1. Perform a hard refresh
    2. Open your console log and look for any JS errors on page load

    Thanks
    E

  • Hi @elliot
    yes I’ve performed lots of hard refreshes..

    Console log reveals the following error:

    Uncaught TypeError: Object [object Object] has no method ‘sortable’

  • Hi @kisabelle

    Can you please paste in the full JS error including line number and file?

    Thanks
    E

  • Hi @elliot, sorry I should’ve thought to include that. Unfortunately the line number won’t help as it’s a minified file.. any ideas?

    Uncaught TypeError: Object [object Object] has no method ‘sortable’ field-group.min.js?ver=4.2.2:1

  • Hi @elliot,

    I just wanted to let you know that I’ve discovered that, in creating a new Field Group today the drag and drop re-order is working. It’s just on the one that was created before the update that it doesn’t work!

    It’s also not really a huge issue for me anymore – I’ve got things in the order that I need them to be. But I will keep working with you to help find a solution to this error if you would like.

  • Hi @kisabelle
    Would you mind editing the acf.php file and searching for ‘.min’ and replace with ”

    This will cause ACF to use the un-minified code and you can then report a line number

  • Hi @elliot

    So it’s throwing the error at line 628 of field-group.js

    Uncaught TypeError: Object [object Object] has no method ‘sortable’
    field-group.js?ver=4.2.2:628

    fields.addClass(‘sortable’).sortable({
    update: function(event, ui){
    update_order_numbers();
    },
    handle: ‘td.field_order’
    });
    });

  • How bizarre…

    The error is caused by the fields variable not being found…

    But the logic to find the .fields is pretty rock solid.

    I don’t understand why this error is happening on your field group, but I’ll keep it in mind into the future.

    Thanks
    E

  • I have the exact same issue. For me, there was no issue with the fields variable, but rather with the existence of the “sortable” method on the jQuery object at the point the mouseover is first called. I used the following workaround to overcome it:

    
        if('sortable' in $.fn) // The workaround
        {
          fields.addClass('sortable').sortable({
            update: function(event, ui){
              update_order_numbers();
            },
            handle: 'td.field_order'
          });
        }
    

    I think it’s a race condition with the jQuery UI sortable script

  • I had the same problem as described here. A hard refreshed solved my issues. Thanks.

  • Hard refresh did the job here too – nice simple fix!

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

The topic ‘Can No Longer Drag to Change Field Order’ is closed to new replies.