Support

Account

Home Forums Backend Issues (wp-admin) ReferenceError: wp is not defined in input.min.js

Solved

ReferenceError: wp is not defined in input.min.js

  • Hello,
    I’m working on a new website for a client, today I found out that ACF completely breaks editor functionality if I insert a relationship field, I tried with link to page and post object fields (even though I just need link to page)

    It may be related to a timeout issue with JS? This site has 1200+ articles.

    Any hint?

    Sorry for my bad english

  • Hi @hedgehog

    Can you download the latest ACF via github?
    https://github.com/elliotcondon/acf/

    This version should fix the issue
    Please let me know how you go

    Thanks
    E

  • Hi and thanks for your support!
    I tried the master version you linked on a test installation, it seems to work! I’ve tested with WP 3.6.1 and 3.7, even inside a repeater field.
    I only had a minor issue regarding php memory size, solved with php.ini, I don’t think it’s related to the plugin though.

    I have another question now: will the master version get updates? I’m asking since I need to use it on a live installation.

    Thank you again for your kind support!

  • Hi @hedgehog

    When the real 4.3 gets released via wordpress.org, your website will not notify you of the update as the versions will be the same.

    What you can do to work around this, is edit the main acf.php file and on line 6, change 4.3.0 to 4.2.9

    Then, when the real 4.3 gets released you will be notified of the update!

    Thanks
    E

  • Great!!
    Thanks for your support sir!
    Keep on the amazing work on ACF! I personally can’t live without it!

  • Well, I talked too soon apparently 😀
    I moved the master version to the live installation (which was already upgraded to WP 3.7, not sure if matters) and I’m getting that error again… I’ll keep looking into it

  • This issue is not solved..

    Elliot,

    the problem happened after we cloned the site to another server.

    1. first it was existent only for some users -my admin user was working. This explains why, in other threads on the topic, there was a note that the developers could not recreate the problem.

    2. now, after I have cleared my browser cache – my user also have this – wp is not defined javascript error

    3. error from firebug console is:

    ReferenceError: wp is not defined
    http://alwaysfootball.dk/wp-content/plugins/advanced-custom-fields/js/input.min.js?ver=4.3.0
    Line 13

    4. Disabling plugins showed that the only plugin on the site that generated this error was Advanced Custom Fields: Repeater Field.

    However, we rely very much on this plugin so disabling it is not an option..

    5. We have updated to the ACF master described in this post – and the error is still there..

    We really hope that you can put high priority on this issue as this product is no longer working.

    Best Regards,
    BK

  • Hi @jaidev

    Okydokey, thanks for the info.

    Step 1, can you edit the acf.php file on line 473 (of the github master version) and remove the .min from the JS file.

    Now refresh the page which shows the error. Can you now get an exact line number from which the error occurs?

    Thanks
    E

  • Here you go!

    ReferenceError: wp is not defined
    http://***/wp-content/plugins/acf-master/js/input.js?ver=4.3.0
    Line 339
  • Elliot,

    Thanks for getting on this 🙂

    Same line as hedgehog:

    ReferenceError: reference to undefined property this._frameWidth
    http://***/wp-content/plugins/advanced-custom-fields/js/input.js?ver=4.3.0
    Line 339

  • THanks guys

    Just to clarify, the issue only happens when using the current repeater field add-on?

    Is there any other pattern you can think of that could cause this issue?
    Perhaps the post_Type capabilities, user settings for WYSIWYG…

  • To me, it happens even if I use a post object or post link field outside a repeater field, my tinyMCE is vanilla, I’ve tried with posts and custom posts types. I’ll keep digging into it to see if I can find some other infos.

    Thanks Elliot!

  • We are using default settings for WYSIWYG

    We have not set any custom caps, however we are using Woocommerce – which does, i think.

    If you have problems recreating the issue – this was my case also. Other admin users of the site reported the problem, but my user did not have any issues – so I did not believe them … until I created a new admin user and logged in as that guy – then I saw that they where telling the truth..

    Now after using CCleaner to clear everything – my user is also gets the error.

    1. we have a repeater field that has a post obj field as a sub field.
    2. we have tested it with Woocommerce’s ‘products’ as post object.
    3. we have tested it with a personal created CTP called Deals as post object.
    4. Happened on the woo single product
    5. happened on another single CTP as well (when testing if this was woo related)
    6. Problem does not occur when repeater field is disabled..

    Possible workaround is to use relationship field instead of repeater field.

  • Hello,
    Any update on this?

  • Hi guys

    Can you please update to the latest ACF 4.3.0 and repeater field 1.1.0?
    Does this help?

    Also, it would be great if I could log into your site and see the issue first hand.

    Thanks
    E

  • HI Elliot,

    I’m having exactly the same problem.
    My problem appears on the option page where I have repeater fields.
    One for images, one for taxonomies and one for post objects.

    I am using:
    Advanced Custom Fields Version 4.3.0
    Advanced Custom Fields: Options Page Version 1.2.0
    Advanced Custom Fields: Repeater Field Version 1.1.0
    TinyMCE Advanced Version 3.5.9
    WPML CMS Nav Version 1.4
    WPML Multilingual CMS Version 2.9.3
    WPML String Translation Version 1.9

    Strangely I don’t have this problem if I am running the site on my local server but now that I have migrated to my online server, my options page completely crashes.

    The problematic line:
    var t = wp.media.view.AttachmentCompat.prototype;
    (wp is not defined)

    Thanks in advance for your help.
    Jorge Braz

  • Thanks guys.

    Seems like the issue is with a live server load time. Perhaps this wp script is running before the wp JS object is ready?

    Thanks
    E

  • It seems something like that Elliot.

    How do you propose to solve this?
    Create an event listener for wp and only after wp has been loaded execute this command?

    I havent dig deep enough in your plugin so I am not really sure how it is working and when this input.min.js is called, so any help you can provide would be great.

    Jorge

  • Hi, reporting news
    I updated repeater field to latest version and now my site is not showing the repeaters.
    With wp_debug:
    Notice: Undefined index: row in /home/****/wp-content/plugins/acf-master/core/api.php on line 629

    EDIT: Solved reverting to official ACF plugin.

  • Hi @hedgehog

    Sorry, what do you mean by Solved reverting to official ACF plugin?

    Thanks
    E

  • @elliot I was still using master version, I uninstalled and reinstalled from wp, problem solved!
    I’ll do some testing tomorrow about the original issue with relationship\post object fields

  • Wordpress 3.7.1 ACF 4.3.0 and repeater field 1.1.0
    Still getting the error on live server, works on test server, the sites are perfect copy of each other.. 😐

    ReferenceError: wp is not defined
    
    http://***/wp-content/plugins/acf-master/js/input.js?ver=4.3.0
    
    Line 13
  • Same thing here…
    Same versions and same problem.
    On my local server everything is fine but when I upload nothing works.

  • Hi guys

    I’m not able to reproduce this JS error on my testing site (on a server). Can someone please email me or post here some login details to see the erro myself?

    I believe there is a outside variable which is triggering this error, which is not part of my instal.

    Thanks
    E

  • I can’t really tinker with my live installation because well, it’s live (and my client is angry enough…)
    At the same time I’m not able to reproduce the issue on my test installation (on a server as well).
    Can I help you in some other way?

Viewing 25 posts - 1 through 25 (of 67 total)

The topic ‘ReferenceError: wp is not defined in input.min.js’ is closed to new replies.