Support » Plugin: Simple Taxonomy Ordering » Conflict with ACF Pro

  • Resolved squarecandy

    (@squarecandy)


    Hi –

    I know you probably don’t officially support conflicts with other plugins, but Advanced Custom Fields is very widely used. I’m seeing an admin CSS conflict using ACF Pro 5.7.9 and this plugin.

    It seems to crunch td.column-name and td.column-description to 0 or close to 0 width when you drag and drop.

    I’m having trouble doing any normal CSS troubleshooting because I’m not sure how to simulate the drag state and use the inspector at the same time.

    Any help much appreciated.

    Here’s a screenshot:
    https://www.dropbox.com/s/t8wnnox2kso94la/Screenshot%202018-12-17%2017.45.20.png?dl=0

    Just to be clear – your code works perfectly with just wordpress core and Simple Taxonomy Ordering activated. I did this test with only Simple Taxonomy Ordering and ACF 5.7.9 activated to make sure this was the thing that was causing the issue.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @squarecandy,

    I don’t think I have a copy of ACF pro. Do you know if this happens with the regular version? If it does, I can take a look in order to understand the scope of the problem/fix.

    Let me know.

    Thanks for reporting this.

    All the best,
    Kevin.

    squarecandy

    (@squarecandy)

    Hi Kevin –

    Thanks for the reply.

    Yes, I went ahead and tested it w/ the free version of ACF and I’m seeing the same result.

    I ran a diff of the default post categories page with and without ACF turned on:
    https://gist.github.com/squarecandy/5c06b4e574abfc637d67d04e01086c78

    Looks like it’s probably a conflict with how jquery ui sortable is handled/loaded… but I’m not sure.

    Let me know what you find out and if I can be helpful in any way.

    Thanks,
    Peter

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Thanks for the information, Peter.

    I will look into this.

    All the best,
    Kevin.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Okay. I’ve had time to investigate this. The issue is with line 13207 of ACF’s acf-input.js file.

    This is the line: $placeholder.html('<td style="padding:0;" colspan="100"></td>');

    If you remove this line, nothing breaks.

    So it seems that ACF is trying to add some custom (and aggressive!) styles when sorting <tr>‘s, even when they’re not the ones initializing the sorting.

    I’m not sure there’s anything we can do on our end so I submitted a ticket to ACF with the technical details.

    All the best,
    Kevin.

    squarecandy

    (@squarecandy)

    Thanks so much for looking into this, Kevin.
    Is the ticket w/ ACF on the public support forum? If so, could you link to it here?

    I can also open a private support ticket with my ACF pro account which might get faster attention.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    I opened it on their website via the free support. I would send you my full support request but I never got an email or anything with it copied and it was kind of long so I don’t want to re-create it. Feel free to create a ticket via ACF Pro support and reference this ticket.

    As I told them in my original ticket, I am willing to change this plugin to work with theirs (rather than them needing to update their plugin) but I don’t know if it’s possible to subvert their current logic.

    squarecandy

    (@squarecandy)

    Cool – yes I just submitted a ticket that said pretty much that exact thing and points them to this thread.

    yano23

    (@yano23)

    I have the same issue, have anyone prepared a fix or snippet to suppress the added ACF style?

    thank you

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @yano23,

    I’ve exchanged a few emails with members of the ACF team but nothing has happened yet.

    I’ll let you know if that changes.

    All the best,
    Kevin.

    squarecandy

    (@squarecandy)

    Here is my heavy-handed temporary solution to match the heavy-handedness of ACF’s colspan=100. This is fine to apply to any taxonomy for which you don’t have any ACF usage on the taxonomy edit screen. My custom taxonomy is called series. You should replace your taxonomy ID as needed below.

    function squarecandy_yikes_acf_taxonomy_sort_hotfix($post_id) {
    	$screen = get_current_screen();
    	if ( 'edit-series' == $screen->id && 'series' == $screen->taxonomy ) {
    		wp_deregister_script('acf-input');
    	}
    }
    add_action('current_screen', 'squarecandy_yikes_acf_taxonomy_sort_hotfix', 99);

    This is still not really a good final resolution, but will allow you to use the YIKES reordering plugin and ACF successfully at the same time for now.

    squarecandy

    (@squarecandy)

    Or if you want to disable the ACF javascript on ALL taxonomy pages:

    function squarecandy_yikes_acf_taxonomy_sort_hotfix($post_id) {
    	$screen = get_current_screen();
    	if ( 'edit-tags' == $screen->base ) {
    		wp_deregister_script('acf-input');
    	}
    }
    add_action('current_screen', 'squarecandy_yikes_acf_taxonomy_sort_hotfix', 99);
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Conflict with ACF Pro’ is closed to new replies.