• Resolved tmargot

    (@tmargot)


    Hi,

    First problem:
    When I create a new ACF: Font Awesome field and try select a default icon, the list is always empty and I receive a console error:

    select2.full.min.js?ver=4.0:formatted:2592 Uncaught TypeError: Cannot read property 'slice' of undefined
        at d.a.removePlaceholder (select2.full.min.js?ver=4.0:formatted:2592)
        at d.j [as removePlaceholder] (select2.full.min.js?ver=4.0:formatted:268)
        at d.a.append (select2.full.min.js?ver=4.0:formatted:2579)
        at d.j [as append] (select2.full.min.js?ver=4.0:formatted:268)
        at e.<anonymous> (select2.full.min.js?ver=4.0:formatted:517)
        at e.d.invoke (select2.full.min.js?ver=4.0:formatted:298)
        at e.d.trigger (select2.full.min.js?ver=4.0:formatted:292)
        at e.trigger (select2.full.min.js?ver=4.0:formatted:3347)
        at select2.full.min.js?ver=4.0:formatted:3273
        at Object.f.transport.d.status.0.d.status.e.trigger.message (select2.full.min.js?ver=4.0:formatted:2273)

    I initially thought it was that I already had Font Awesome loaded, but the error remained after commented out my SASS include.

    Second Problem:
    Although the dropdown list works and I can select an icon. I assume that the icon preview should update after you selected a different icon? Mine remains on fa-500px.

    Thanks,
    Tristan

    • This topic was modified 7 years, 3 months ago by tmargot.
    • This topic was modified 7 years, 3 months ago by tmargot.
Viewing 15 replies - 1 through 15 (of 21 total)
  • Thread Starter tmargot

    (@tmargot)

    Hi,

    I did a little investigation on the edit_input.js file from the Page edit screen; Seems that the jQuery events are not firing. I changed the event trigger from select2:selecting to select2:select and it fired, but the event object data is empty.

    $( 'select.fa-select2-field').on( 'select2:select', function( object ) {
    			console.dir(object);	
    			update_preview( this, object.val );
    		});

    Output:

    n.Event
    currentTarget:select#acf-field_59842ca487c10.fa-select2-field.select2-hidden-accessible
    data:undefined
    delegateTarget:select#acf-field_59842ca487c10.fa-select2-field.select2-hidden-accessible
    handleObj:Object
    isTrigger:3
    jQuery112406977119826624185:true
    namespace:""
    params:Object
    result:undefined
    rnamespace:null
    target:select#acf-field_59842ca487c10.fa-select2-field.select2-hidden-accessible
    timeStamp:1501842805781
    type:"select2:select"
    __proto__:Object

    Cheers,
    Tris

    Plugin Author Matt Keys

    (@mattkeys)

    Thanks for the heads up Tris, I am seeing this issue too and will take a look.

    Plugin Author Matt Keys

    (@mattkeys)

    Tris,

    Can you download and test out the ‘development version’ from the bottom of this page? https://www.ads-software.com/plugins/advanced-custom-fields-font-awesome/advanced/

    If you can test this out and let me know if it resolves your problems I would appreciate it.

    Thread Starter tmargot

    (@tmargot)

    Hi Matt,

    I gave it a test first thing this morning but unfortunately it seems to it be doing exactly the same thing but with no console error anymore. I definitely downloaded the ‘development version’ as instructed and installed it. I even tried a second time where I uninstalled it and physically deleted the folder on my dev server, downloaded the dev version again and installed it. After testing, I updated Advanced Custom Fields Pro to the new version they seemed to have released over the weekend. Select2 was mentioned as an update log, but no difference to our problem.

    Cheers,
    Tris

    Plugin Author Matt Keys

    (@mattkeys)

    Very odd, that version solves the problem on my test installation. It looks like from you earlier error, ACF is loading Select2 v4, which matches my install. And I also tested on the latest version of ACF pro. I am using latest Chrome browser, and latest WordPress.

    I wonder if the remaining issues have something to do with another plugin you have installed. Are you able to trial/error de-activating other plugins to see if any of them are involved?

    Thread Starter tmargot

    (@tmargot)

    Hi Matt,

    I have disabled all plugins, I only had Duplicate Post plugin installed anyway. I
    then downloaded the plugin again from the bottom of the page with Development Version selected from the dropdown and still the same. Could it be the download? I know this may sound ridiculous but have you tried downloading it from the site and installing it?

    I am also using the latest WordPress and the latest ACF as of today!

    I also updated Chrome this morning and for some reason my Console was filtered?? So have now noticed that I am still getting the javascript error.

    Uncaught TypeError: Cannot read property 'slice' of undefined
        at d.a.removePlaceholder (select2.full.min.js?ver=4.0:2)
        at d.j [as removePlaceholder] (select2.full.min.js?ver=4.0:1)
        at d.a.append (select2.full.min.js?ver=4.0:2)
        at d.j [as append] (select2.full.min.js?ver=4.0:1)
        at e.<anonymous> (select2.full.min.js?ver=4.0:1)
        at e.d.invoke (select2.full.min.js?ver=4.0:1)
        at e.d.trigger (select2.full.min.js?ver=4.0:1)
        at e.trigger (select2.full.min.js?ver=4.0:2)
        at select2.full.min.js?ver=4.0:2
        at Object.f.transport.d.status.0.d.status.e.trigger.message (select2.full.min.js?ver=4.0:2)

    Cheers,
    Tris

    Plugin Author Matt Keys

    (@mattkeys)

    I know this may sound ridiculous but have you tried downloading it from the site and installing it?

    Not that ridiculous apparently… The development version I asked you to download actually downloads 1.7.3, and I am trying to have you test 1.7.4

    There is an option on that same page to directly download 1.7.4, can you test that version?

    Thanks and sorry for the confusion.

    Thread Starter tmargot

    (@tmargot)

    Hi Matt,

    No problem. Just got home from work and gave it a test, all working now. Thanks very much. Take care.

    Cheers,
    Tris

    Plugin Author Matt Keys

    (@mattkeys)

    Tris,

    I’ve done a lot more work in this area on v2.0.0 of the plugin. I wonder if you’d be willing to be a beta tester of this new version?

    It can be downloaded here (same place as before): https://www.ads-software.com/plugins/advanced-custom-fields-font-awesome/advanced/

    Download v2.0.0 Beta

    • This reply was modified 7 years, 3 months ago by Matt Keys.
    Thread Starter tmargot

    (@tmargot)

    Hi Matt,

    Sorry I did not mean to be rude, but I was pulled away from WordPress for a couple days. I have only now managed to actually give it a decent test and report back. Good news, all seems to be working perfectly.

    I will be working with it over the next couple weeks on my project and will report back any problems I may encounter, but as it stands it seems solid. Thank you very much for this and reaching out. If there is anything else, just let me know.

    Take care,
    Tris

    Thread Starter tmargot

    (@tmargot)

    Hi Matt,

    I think I have discovered a bug which prevents me adding Clone fields. If I try add a clone field and attempt to select an existing field to clone, the list has font-awesome icons listed (missing the icons as it is in the admin default font). When I deactivate version 2 of the plugin the problem disappears. I have quadruple checked my findings. I have temporarily gone back to Version 1.7.4 for now as it works.

    Cheers,
    Tris

    Plugin Author Matt Keys

    (@mattkeys)

    Thanks for the additional testing. Good call with the clone fields, I had not thought to test those yet. I will check those out and see if I can reproduce what you are seeing.

    Plugin Author Matt Keys

    (@mattkeys)

    Tris,

    Thanks again for beta testing and for finding this bug with the clone field. This should be addressed in v2.0.1

    If you are able to test that version out I would appreciate it. I will probably be launching this new version sometime in the following week.

    https://www.ads-software.com/plugins/advanced-custom-fields-font-awesome/advanced/

    Thanks,

    Matt

    Thread Starter tmargot

    (@tmargot)

    Hi Matt,

    No worries, only a pleasure. Thanks for all your efforts. Initial install and test, all seems great. I will keep you posted as I am working on this project for the next week or so.

    Cheers,
    Tris

    Thread Starter tmargot

    (@tmargot)

    Matt,

    May I ask you how you got started creating an Advanced Custom Field plugin? I have looked all over for some documentation and come up with nothing ??

    Cheers,
    Tris

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Error trying to select an icon’ is closed to new replies.