WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
[resolved] Loose functionality in pages with 3.4.1 (33 posts)

  1. Nick Powers
    Member
    Posted 1 year ago #

    I'm was using your plugin on my new recipe site: http://cookncrazy.com

    I like and use the plugin, on several of my sites, but since 3.4.1 when I try to work with pages, I cannot insert media, gravity forms, etc (or anything on that same bar).

    Also, non of the custom fields show up in pages, just post.

    I hope this is fixed so I can start using your great plugin again!

    Nick

    http://wordpress.org/extend/plugins/advanced-custom-fields/

  2. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. simco
    Member
    Posted 1 year ago #

    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!

  4. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    Hey guys,

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

    Thanks

  5. simco
    Member
    Posted 1 year ago #

    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

  6. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    Hi simco,

    What version of ACF are you using?

  7. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  8. simco
    Member
    Posted 1 year ago #

    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.

    http://www.melanieroeforthedefense.com

  9. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    Please try the code edit I mentioned above

  10. simco
    Member
    Posted 1 year ago #

    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.).

  11. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  12. simco
    Member
    Posted 1 year ago #

    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.

  13. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    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?

  14. simco
    Member
    Posted 1 year ago #

    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.

  15. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    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...

  16. simco
    Member
    Posted 1 year ago #

    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).

  17. simco
    Member
    Posted 1 year ago #

    And, FYI, I updated the theme files as well to the latest version.The problem existed before that but I thought it could possibly be a conflict. The upgrade didn't fix it.

  18. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

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

  19. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    Hi simco,

    I didn't mean update, I meant switching to a completely diff theme (maybe twenty eleven) to test if the theme itself is infecting js on to the edit screen and causing the error.

  20. simco
    Member
    Posted 1 year ago #

    Hold on a sec, seems it's only affecting the 'page' editor. I just tried posts and the media button appears to work fine. So something is conflicting only with the page element of the editor.

  21. simco
    Member
    Posted 1 year ago #

    I switched themes to twenty eleven and the problem went away. But would it be an issue with the theme and WordPress? Or an issue with the theme and the ACF plugin?

  22. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    Its a problem between your theme and ACF.

    I believe it is running JS before the document ready event. This will cause AC to fail as it requires that event to instantiate itself.

    You should fix your theme's JS to run on the document ready event

  23. simco
    Member
    Posted 1 year ago #

    Ok, so before I go back to them and tell them the problem is on their end, is what you're saying they 'should do' is standard practice for WordPress themes? Or are they going to say they are doing it right and you're doing it wrong. Hence the conflict with the plugin. Because what's going to happen here is each party is going to point at each other. They'll say that because it only conflicts with your plugin that it's the plugin, not the theme. So, in order to have them 'fix this' they first need to be made aware that it is, specifically, their issue of non-compliance. See where I am with this? So, if what you're describing is indeed an error on how they are executing their js then I have them by the balls. But, if not, then my balls are swinging in the wind. So can you clarify, please?

  24. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    Dear simco,

    There is not right or wrong way to write JS. However, there are standards.

    It is a standard to not run any JS before the document.ready event. This ensures all elements are loaded and all other JS is present.

    I can assume that your theme uses JS to change the page template select before the document.ready event.

    This is not good practice as we can see in this case, it is throwing an error as ACF is watching that element for a change action, but ACF has not been given a chance to instantiate it's data property.

    A note of warning. When chatting to web developers, please put aside the attitude. There's no need to stress or anger or this kind of language in this environment. We are all here to do what we love. Just because your pre-made theme and the ACF plugin aren't compatible doesn't mean you need to get all rambo.

    Just ask them nicely to make this edit. It's pretty basic stuff.

  25. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    P.S. don't use the work Fix. Web developers do not like this word being misused.

    In this case, this is a simple edit to allow for compatibility. It is not a bug

  26. simco
    Member
    Posted 1 year ago #

    I appreciate your candor and your honesty. AND, truly appreciate your quick responses. I think the frustration you read into my posts comes from the 15+ years of doing this where about 99% of the time the parties just point their fingers at each other instead of fixing the problem and guys like me get stuck in the middle. This, in turn, causes the clients on the designer's side to get agitated when it appears nothing is happening. The normal result is simply finding another plugin OR starting over completely with a new theme which is not what I'd really like to do.

    I've posted the issue in their support forums. It's a membership site and i've been an active member for over 2 years so hopefully they'll just say "Hey! We see that and *tweak tweak tweak* it's fixed!"

    Or, point me to where I can fix it myself. Either way works.

    So, apologies if it came off as 'rambo' but I think I was bracing myself for what is usually the inevitable. I'll keep you posted!

    Thanks again for the quick responses!

  27. simco
    Member
    Posted 1 year ago #

    Unfortunately this is not resolved as reported. Exactly what I expected to happen is happening where the theme developers are pointing at you and vice versa. So, a week has gone by and nothing has happened. Hence my previous pessimistic posts based upon many experiences of this nature.

    I see other forum posts regarding similar problems that point to the 'page_template' causing issues. Personally I feel there's a conflict in the plugin when it comes to multiple selections of page templates. That's the only connection I can see and is precisely mentioned in the error message.

    I'd really like to get this resolved and it appears that it's not only related to the themes i'm using (the other post reporting similar issues has an entirely different theme but also with various page templates to select from).

    Need your help, Elliot. Thanks

  28. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    Hi simco,

    I'm happy to help, but not sure how I can. You have a JS conflict with your theme and my ACF plugin.

    I have explained that I believe you theme is triggering a change event on the page_template select before the ACF data object is created. This causes a JS error to occur.

    Would you like to provide account details for me to have a look at your admin?

    What are the other threads relating to this issue?

    That are the other theme / plugin issues with page templates?

  29. simco
    Member
    Posted 1 year ago #

    Eliott, thanks for the response. I noticed this thread was referencing the page_template tag which is the same one my error message displays. Their theme is totally different than mine so it's less possible that the theme is the issue. Here's the thread link:

    http://wordpress.org/support/topic/plugin-advanced-custom-fields-doesnt-work-with-page-template?replies=3

    I'd appreciate some help simply because I know that the theme developers pretty much wipe their hands since it only occurs when we use this plugin. Therefore they blame the plugin. That's how it's commonly handled.

    I understand the basics of what you're explaining about how the error occurs. But trying to find the cause of it, i'm not a javascript expert. If it's something that is more common than you may have though (like in the other thread) then it's definitely something that would benefit you as well.

    If you want to provide an email I can set up an account for you to take a look.

  30. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    Hi simco,

    The page you linked to has nothing to do with the page_template select or any JS issue. It was a problem with their theme editing the WP query object.

    I can understand that you have pressure from your client, but don't make this out to be a big deal. Your theme and your theme alone has a JS issue. I am willing to take a look to prove it to you and your theme devs.

    You may need to think about hiring a web developer to make the JS fixes with your theme if your other guys wont.

    Please email to support@advancedcustomfields.com

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.