I’ve got a custom-built time tracker I use to log all of my work. It’s built using
acf_form() to display fields for a CPT on a front-end page. Recently a couple of weird things have started happening with it, and I’m wondering if anyone knows about changes to that function or the plugin in general that may be the culprit, and if there’s anything I can do to fix it shy of opening a support ticket and getting the ACF team to fix it.
Specifically I am noticing two issues:
1. I have a couple of Date Time Picker fields, and for the first one, because of its position near the top of the page, the picker pops up in a way that completely blocks the actual text input field. Sometimes I like to use the picker but sometimes I just like to type in the time directly, and it’s impossible to do that now.
2. I have a Post Object field, for inserting the name of the client. It works fine when there’s only one instance of the form on the page. But if there are multiple instances of the form — which happens often, like when I’m already ‘clocked in’ with a client but need to clock in for another if I’m working on two tasks simultaneously — the first instance on the page becomes just a standard HTML select menu, containing no options.
Problem #1 is mostly just a nuisance, but problem #2 is a show stopper.
I don’t know of any specific changes that would cause this and I probably wouldn’t be able to figure out what the cause is.
The positioning of the popup could have been altered.
As far as the relationship field goes, it is probably based in the field ID. With multiples of the same form you would have duplicate id values for fields. I’d be more confused about why it was working before than why it is no longer working.
Thanks… the specific issue with the date picker is that previously it would always be positioned entirely above or below the input; now if that would cause it to run off the screen, it shifts enough so that it doesn’t run off the screen at all… but that results in it covering the input. I was able to work around it by just modifying the page layout so the form starts a bit lower on the page. (This is something I’m only using for personal use right now so the design is not critical.)
As for the second issue… I agree that it’s odd that it ever worked. But it did, and now it doesn’t, so I’m trying to figure out what happened.
So, I just ran into a big issue with a front end form. Client kept complaining that it did not look right. I only viewed it when logged in and it looked fine.
Logged out of the site is was a disaster. I had to revert to version 5.8.14 to get it fixed. I am guessing that not all of the JS and/or CSS is being loaded on the front of the site when not logged in.
That’s interesting, to pursue what might have changed recently. I’ve never used this on the front end without requiring login, so I haven’t had this extent of trouble, but it’s possible that a “lesser” version of the same issue is affecting my logged-in form display too.
Update, this appears to have happened for me in version 5.9.6. In version 5.9.5 everything is fine.
I don’t know if this is the same issue or not, but it seems there is something that changed between these 2 versions that has affected acf_form(). I have reported my issue to the developers because I haven’t got a clue.
I’m focusing mainly on the issue of the autocomplete dropdowns not working when there are multiple instances of the form on the page right now.
I was able to determine that it did work to have multiple instances with version 5.9.9, but it stopped working with 5.10(.0).
I’m doing a diff between these versions and not surprisingly there are a ton of changes. It could be difficult to nail it down, and is probably not worth me investing the time in right now.
I took a look at the changelog for 5.10 and I think this is the item that is most likely to be connected to whatever is causing the problem for me:
Fix – Fixed issue where Select2 search input wouldn’t have focus in WordPress 5.8+
I’m guessing that they fixed this focus issue by making a change to a jQuery selector — something that probably was not using a
id selector) before, but should have been, now is, and I had previously been exploiting a bug without realizing it.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We are undergoing server maintenance and will be back up soon ^IP— Advanced Custom Fields (@wp_acf) October 14, 2021
© 2021 Advanced Custom Fields. Subscribe