WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Advanced Custom Fields] Loose functionality in pages with 3.4.1

[Resolved] [Plugin: Advanced Custom Fields] Loose functionality in pages with 3.4.1

Viewing 15 replies - 1 through 15 (of 32 total)
  • Plugin Author elliotcondon
    Member

    @elliotcondon

    Hi Nick,

    ACF is only up to v 3.3.9

    If you can’t see your custom fields, maybe you have a JS error which is stopping them from being shown.

    Try opening your console log and looking for any errors on page load.

    Having the same problem in the admin. The media upload popup won’t work when this plugin is activated. The plugin itself in regards to the custom fields works fine and i’m able to get the fields and values to display. The problem is there’s a conflict between the plugin and the admin. Doesn’t do me any good if I can’t upload images.Please advise!

    Plugin Author elliotcondon
    Member

    @elliotcondon

    Hey guys,

    Can you open up your console log and report any JS errors on page load / when you launch the media thickbox?

    Thanks

    Uncaught TypeError: Cannot set property ‘page_template’ of undefined input-ajax.js:157
    (anonymous function) input-ajax.js:157
    f.event.dispatch load-scripts.php:3
    f.event.add.h.handle.i load-scripts.php:3
    f.event.trigger load-scripts.php:3
    f.fn.extend.trigger load-scripts.php:3
    e.extend.each load-scripts.php:2
    e.fn.e.each load-scripts.php:2
    f.fn.extend.trigger load-scripts.php:3
    (anonymous function) et-ptemplates.js:36
    f.Callbacks.o load-scripts.php:2
    f.Callbacks.p.fireWith load-scripts.php:2
    e.extend.ready load-scripts.php:2
    c.addEventListener.B

    Plugin Author elliotcondon
    Member

    @elliotcondon

    Hi simco,

    What version of ACF are you using?

    Plugin Author elliotcondon
    Member

    @elliotcondon

    Hmmm, so your WP is throwing an error because the acf.data property does not exist at that moment…

    Strange, becuase the error is comming from an event triggered by a change of the page template select.
    Is a plugin or theme changing this select value before the $(document).ready?

    I wonder if this will work:
    1. Cut lines 34 – 46 (acf.data object) and paste them on line 24

    Let me know if that helps.

    Using 3.3.9 version.

    No idea why it would throw a template error as the page was originally created with the default template. It’s just a standard page with no particular parameters to it. I has an image, 2 paragraphs and 3 hyperlinks in a list format.

    This page is also being summoned into a special div on the home page as part of the theme’s functionality. There’s typically 3 ‘boxes’ that can be populated by whichever pages I select in the theme’s control panel. However, i’ve removed the 2nd and 3rd boxes just to populate this single larger box. Have a look so you see what I mean. The main content area where she’s standing, the text to her right, and the 3 hyperlinks are *a page* whose content is displayed in that home page slot.

    Welcome

    Plugin Author elliotcondon
    Member

    @elliotcondon

    Please try the code edit I mentioned above

    I moved that block of code and now the media button works. But, something else is a bit weird. It doesn’t provide the drag-and-drop method. Just the regular method of upload (browse button, etc.).

    Plugin Author elliotcondon
    Member

    @elliotcondon

    Hi simco,

    I believe you have some JS conflicts / issue with your website.
    This can be caused by plugins or your theme.

    I would try uninstalling all plugins and re-installing them one by one until you find the one causing the issues.

    So I should move that code block back?

    I’ve tried deactivating them then reactivating. The break occurs when I reactivate the ACF plugin. But, I have not actually uninstalled any.

    Plugin Author elliotcondon
    Member

    @elliotcondon

    Hi simco,

    Yes, you can move the code block back.

    Please elaborate more on “I’ve tried deactivating them then reactivating”. Have you deactivated every plugin except ACF to see if that fixes the issue?

    Have you tried temporarily using a different theme to see if that fixes the issue?

    I removed each one from the plugins folder to test. I saved yours for last. None of them fixed the error after removal except yours. The conflict is the ACF plugin.

    Plugin Author elliotcondon
    Member

    @elliotcondon

    Hi simco,

    I understand that the error is coming from ACF, but I can guarantee you that this is a specific error to your WP.

    If you install a fresh WP + ACF, you will not have this JS error. Therefore there is something on your WP that is triggering a page template change before the document ready has completed.

    Have you tried switching themes? Maybe it is your theme js triggering the error…

    And, yes, previously I merely deactivated them (not remove them like this time) and tested the problem after each deactivation. The problem only occurs when the ACF plugin is activated.

    But, that’s the only problem. Otherwise I have it working fine in the display aspect. We just can’t upload any media files in any mode (post, page, add media .. none work).

Viewing 15 replies - 1 through 15 (of 32 total)
  • The topic ‘[Resolved] [Plugin: Advanced Custom Fields] Loose functionality in pages with 3.4.1’ is closed to new replies.