
I’ve posted this request on the github issues board. So your request is known by the developer

This is a problem with php.ini and the max_input_vars setting.
Check out this plugin, it can tell you when you are exceeding this number and what that number is: https://wordpress.org/plugins/wp-max-submit-protect/faq/

I don’t know this to be a fact, but I’m assuming that there is something built into ACF that does a simple “has something changes or not” test. If nothing has been changed in an ACF field then the data is just sent.
If something has been changed then the JavaScript needs to look at every field, is it a required field? If it is, does the field have conditional logic that may have it hidden and then not require.
You can also create custom filters for what is allowed input in every field and I’m pretty sure this means that checking the data requires an AJAX call so that custom filters can be run and errors returned, so the larger the number of fields the more data that needs to be sent and returned during the request.
The answer to your question is that, all of the data is updated, but that’s not what’s slowing it down. Unfortunately I think this is just a side effect of the way that the work needs to get done.
Hey @bigdropgr what I used was an onclick function on one of my tab buttons. Specifically this part of my code is what renders the map and resizes it to 100% width and height:
$(document).ready(function(){
$( ".mapclick" ).one( "click", function() {
//$('.mapclick').click(function(event) {
$('.acf-map').each(function(){
render_map( $(this) );
});
$(window).resize(function() {
$('.acf-map').height($(window).height() - 170);
});
$(window).trigger('resize');
});
//$height = $('#wrapper').height();
//$('.acf-map').height($height);
});
So on one of my tab buttons, I have the class name “mapclick”. Then in my code, I have when the button “mapclick” is clicked, render the map and resize.
Here is my tabs code:
<ul class="products-list">
<li class="active info countbutton"><a href="#info"><span class="text">Info</span></a></li>
<li class="photo countbutton"><a href="#photo" class="photoclick"><span class="text">Photos</span></a></li>
<li class="video countbutton"><a href="#video"><span class="text">Videos</span></a></li>
<li class="map countbutton"><a href="#map" class="mapclick"><span class="text">Maps</span></a></li>
<li class="hour countbutton"><a href="#hour"><span class="text">Hours</span></a></li>
</ul>
Let me know if this makes sense.
Hi,
I’m trying to put the map in to a jQuery tab, just like you did. I’m using the Twitter Bootstrap as a framework and the bootstrap.min.js is loading on every page.
On your last post you wrote this
“…I attached a click event to one of my tab links that loads the map. Now, it will only load the map when someone clicks that particular link/tab (which I’m okay with). So, on tab click, render map and resize to 100% width and height….”
Can you please provide a little more info about this?
I want to make the map show properly but instead I only get only a part of it working (the upper left corner only show I get the same error like in your attached image).
Thank you in advance for your willingness to help!
I seriously have never had such a perplexing problem before, I feel like there isn’t a single working solution for translation and ACF right now, and every incremental version for any one of the three above mentioned plugins breaks everything.
I know this is a long shot, but it would be an absolute dream if ACF just supported qtranslate-x out of the box, to eliminate one further point of failure. It’s just so incredibly hard to troubleshoot when there are three plugins involved.
Hi! Oembed works for fields on category page? For me it doesn’t.
I can show the field (I am using the code presented here ) but the link looks like a regular one (https://hereyoutubelink), doesn’t get transformed into iframe. Theme is twenty twelve.
I deactivated all plugins and the problem remains , deactivate ACF and i can then publish and edit posts …. roll back to an older version of ACF and it works , so ACF seems to be the problem. Just tried the latest version 5.2.6 ..no fix.
Uncaught TypeError: Cannot read property 'length' of undefinedm.extend.each
@ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,farbtastic,quicktags,jquery-ui-core,jq…:2(anonymous function)
@ acf-input.min.js:2r
@ acf-input.min.js:1n
@ acf-input.min.js:1acf.apply_filters
@ acf-input.min.js:1acf.validation.acf.model.extend.fetch_success
@ acf-input.min.js:2acf.validation.acf.model.extend.fetch.$.ajax.success
@ acf-input.min.js:2m.Callbacks.j
@ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,farbtastic,quicktags,jquery-ui-core,jq…:2m.Callbacks.k.fireWith
@ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,farbtastic,quicktags,jquery-ui-core,jq…:2x
@ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,farbtastic,quicktags,jquery-ui-core,jq…:4m.ajaxTransport.send.b
@ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,farbtastic,quicktags,jquery-ui-core,jq…:4
i’m getting this error , have been since 5.2.5 , cannot update or publish posts or pages , just updated to 5.2.6 … same, same .. not fixed
Uncaught TypeError: Cannot read property 'length' of undefinedm.extend.each @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,farbtastic,quicktags,jquery-ui-core,jq…:2(anonymous function)
@ acf-input.min.js:2r
@ acf-input.min.js:1n
@ acf-input.min.js:1acf.apply_filters @ acf-input.min.js:1acf.validation.acf.model.extend.fetch_success
@ acf-input.min.js:2acf.validation.acf.model.extend.fetch.$.ajax.success
@ acf-input.min.js:2m.Callbacks.j
@ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,farbtastic,quicktags,jquery-ui-core,jq…:2m.Callbacks.k.fireWith
@ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,farbtastic,quicktags,jquery-ui-core,jq…:2x
@ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,farbtastic,quicktags,jquery-ui-core,jq…:4m.ajaxTransport.send.b
@ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,farbtastic,quicktags,jquery-ui-core,jq…:4

Hi @waffl
Thanks a million for the bug report.
I’ve just quickly fixed the issue and pushed an updated file for ACF PRO 5.2.6
Please download the latest version and this will be fixed!
I’m having the same issue. I have an option on a link, a checkbox to say, “Open in new window”. When it’s checked, I use:
$new = get_field("new_window");
to return whether this is set or not. If I do:
if(in_array('set', $new))
I get an error telling me second variable in in_array must be array
If I do
if(strpos($new, 'set') !== false)
I get an error telling me first variable must be a string. PHP eh?!
For whatever reason, I can’t do:
if($new == 'set')
as this always returns false. A var_dump of the $new variable shows it is indeed an array.
Any ideas?
Edited: Actually, I should clarify, these are PHP notices, not errors. I’m not too worried, but I would like to resolve. If the answer is “Because, PHP” well then, that’s it…

Hi @fatih
Thank you for the question. Please review the recent changes you have made to your website, it could be a theme change or a new plugin that is bringing about this CSS issue.
Let me know your findings.

Hi @blogjunkie,
Thank you for raising this issue.
The slow load speed of your dashboard might not entirely be stemming from ACF and the HTTP requests. Do you think you could deactivate your theme and switch to one of the stock WP themes to test the result?
The issue might also be limited to your local environment maybe you could try it out on a staging server.

Hi guys,
Thank you for reporting this issue, I am afraid I cannot replicate the issue from my end.
@jrwdev can u please provide more information on the jQuery error? It would also help if you could do some testing to determine whether the issue is arising from a plugin conflict and deactivate all other plugins.

Hi @krishaamer and @floflo91,
Thank you for the question.
This issue is a current limitation of the WP media library popup.
It is only possible to limit the media library to ‘uploaded to a specific post’ or ‘not connected with a post’.
When you are editing a user, the images available are the ones which are not connected with posts.
It is possible for you to tell ACF to use the basic uploader (no media library popup) with this code:
acf_update_setting('uploader', 'basic');
Perhaps you guys could hook into the admin_head and check if that page is an edit user page? Then run this code?
You can also use the new ‘uploader’ setting within the acf_form function for front end uploaders
http://www.advancedcustomfields.com/blog/acf-pro-v5-2-4-update/

Hi @thememaker,
Thank you for the questions.
It is recommended to make use of the developer licence in your theme development since it is intended to be used in many domains.
You can make use of the same licence for multiple themes.
Still getting this issue with 5.2.5 on multiple sites, including the site discussed privately above – it seems to be sites with quite a large amount of ACF fields.
Have tried clearing cache but the issue still persists. Downgrading to 5.2.4 fixes the issue for me.
Good question, need that too !!
Somebody can help us please ?

Hi @jmp909
It sounds like you may have some PHP code in your functions.php or within a theme which is outputting an error or blank spaces during the AJAX request.
Can you please submit a new support ticket with as much detail about the issue as possible and also include login details for us to test?
http://support.advancedcustomfields.com/new-ticket/
Thanks
E
I have been testing with the following events and dates…
Test 1
23/05/2015 – 23/05/2015
25/05/2015 – 29/05/2015
Test 2
24/05/2015 – 24/05/2015
The trouble is that the following code is returning Test 1 and Test 2 for the date range of 24/05/2015 – 24/05/2015 when only Test 2 should be returned
<?php
// filter
function my_posts_where( $where ) {
$where = str_replace("meta_key = 'event_dates_%", "meta_key LIKE 'event_dates_%", $where);
return $where;
}
add_filter('posts_where', 'my_posts_where');
$args = array (
'post_type' => 'event',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'event_dates_%_start_date',
'compare' => '<=',
'value' => '20150524',
),
array(
'key' => 'event_dates_%_end_date',
'compare' => '>=',
'value' => '20150524',
)
),
);
$the_query = new WP_Query( $args );
?>
I am having a similar problem with the latest free version.
the problem only happens in Chrome and IE. Firefox is fine
I have 3 CF’s on a page with logic controlling each (selecting the last item in the select box on CF1, brings up CF2, selecting an item on CF2 will bring up one of a number of CF’s for CF3)
When I select anything in the drop downs, all CF’s apart from the first one disappear. again in Firefox it’s fine though, i see an ajax spinner and the fields appear
i thought it might be because I have multiple “If Post Taxonomy = [something]” logic entries where each taxonomy condition points to a different Custom Taxonomy but i reduced it to one taxonomy and the problem still existed.
I looked at the ajax response body.. in Firefox i get several back eg [121,156,150,163]
in Chrome i get some blank entries then 121 (121 is the first CF)
I do get this warning in chrome from jQuery when i first load the page. I don’t know if it is related “Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience.”
discussed here http://stackoverflow.com/questions/27736186/jquery-has-deprecated-synchronous-xmlhttprequest
any advice greatly appreciated
thanks
j
Thanks for this.
I had the very same problem.
One question though: how would I add a filter to do the exact same thing with the Media Library?

Hi @arb4host
Thanks for the topic, but please remember that this is a community forum, not a support ticket. If you wish to receive 1 on 1 support, please open a ticket.
Querying and sorting sub fields is quite difficult, but possible. Please read over these articles to get a better idea on how this is possible:
http://www.advancedcustomfields.com/resources/querying-the-database-for-repeater-sub-field-values/
http://www.advancedcustomfields.com/resources/query-posts-custom-fields/
Thanks
E
Hi,
I don’t know if we are sharing the same issue (and for me, the issue stretches further back than 5.2.5) but I’ve figured out mine.
The Context:
The project I’m currently working on uses Polylang for translations. Custom fields aren’t set to be translated, their data is synced manually.
I have a post object setup to retrieve posts from two custom post types: partner and sponsor. These post types aren’t configured to be multilingual.
The Issue:
In acf_field_post_object::render_field(), if there’s a saved value, ACF will retrieve all posts matching the saved value (in order to pre-populate the rendered field).
$posts = acf_get_posts(array(
'post__in' => $field['value']
));
Unfortunately, this returns an empty array because acf_get_posts() will default to loading from all available post types. In my case, acf_get_post_types() returns: post, page, attachment, partner, and sponsor.
And this is the key problem: post and page are configured to be multilingual. This triggers Polylang to add a condition to fetch posts in the current language which the non-multilingual post types can’t fulfill.
First Solution:
Require ACF to pass along the filtered list of post types:
$posts = acf_get_posts(array(
'post__in' => $field['value'],
'post_type' => $field['post_type']
));
The one downside of this is if the list of filtered post types changes (e.g., a post type is removed), it will affect any currently saved value assigned to that now-removed post type.
Second Solution:
Intercept Polylang before it adds that language condition to the WP_query. I accomplish this using a backtrace to figure out if the WP_query was called by acf_get_posts() by way of acf_field->render_field().
**Updated 2015-05-21T17:22-05:00**
add_action( 'pre_get_posts', function ( &$wp_query ) {
$is_acf_get_posts = (
( $e = new Exception )
&& ( $trace = $e->getTraceAsString() )
&& false !== strpos( $trace, 'acf_get_posts(Array)' )
&& (
( is_admin() && false !== strpos( $trace, '->render_field(Array)' ) )
|| ( ! is_admin() && false !== strpos( $trace, '->format_value(' ) )
)
);
if ( $is_acf_get_posts && pll_is_not_translated_post_type( $wp_query->get('post_type') ) ) {
pll_remove_language_query_var( $wp_query );
}
}, 9 );
function pll_is_not_translated_post_type( $post_type ) {
global $polylang;
if ( isset( $polylang ) ) {
$pll_post_types = $polylang->model->get_translated_post_types( false );
return ( is_array( $post_type ) && array_diff( $post_type, $pll_post_types ) || in_array( $post_type, $pll_post_types ) );
}
return false;
}
function pll_remove_language_query_var( &$query ) {
$qv = &$query->query_vars;
unset( $qv['lang'] );
if ( ! empty( $qv['tax_query'] ) ) {
foreach ( $qv['tax_query'] as $i => $tax_query ) {
if ( isset( $tax_query['taxonomy'] ) && 'language' === $tax_query['taxonomy'] ) {
unset( $qv['tax_query'][ $i ] );
}
}
}
}
I made this filter very verbose just to make sure the idea is understand. I’m using a much more compact version in my project. This function can also be easily translated to your multilingual-plugin flavour (e.g., WPML).
Cheers,
I know it’s a bit old topic, but I have an idea. Not sure if it’s doable in the ACF but I did something similar in the past (not in wordpress). In order to fetch all images I created field media[] that was simply an array of all images/files used in the page. So when a user added an image I also added new field that stored the id to it:
<input name="media[]" value="image_id">
I then stored this field in database – which hold all the media connected to this particular page, and then just query images with the IN() in the frontend. This way I had only one query and not 20-30 depending on the amount of images/files connected to that page.
In the backend I also used http://php.net/manual/en/function.array-unique.php to remove all duplicates in media array.
I am not sure is this possible in ACF as I’m not very familiar with the ACF source code, but it could be a really good solution. Let me know your thoughts about it.
I use this tool https://wordpress.org/plugins/query-monitor/ to see where I can have performance problems, and I have now 158 queries where 98 are ACF. And by looking what is it, it’s mostly images, as I have repeater for “partners”. Because there needs to be added URL I can’t use gallery for that.
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 use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.