Problem with ACF PRO and customizer after migration

hey there i have been using acf pro and recently i migrated my site to a new server using all-in-one wp migration. everything went well except now the customizer will not update or save changes. i disabled all plugins and only get this problem when acf pro is activated. everything is updated and X is validated. (except acf pro, which comes bundled with X) I got this problem again on a fresh install with only X and ACF PRO active. maybe this is a license validation thing? Please help

Hi there,

First of all thank you for providing the 2 versions so we can compare them, that made our work much easier. I double checked both websites and found out the problem was originated from the permalink structure which you had on the test site which was not working correctly. So I changed it from Custom:

/index.php/%year%/%monthnum%/%day%/%postname%/

to the post name, and went to X > launch > Options and been able to save thing around.

Thank you.

Thanks for the reply! indeed, X > launch > Options works but Appearance > Customize still does not. any ideas?

Hi,

I checked both sites and the customizer is working fine.

bangmedia site

testing site

Try to clear your browser cache and check again

Thanks

the customizer on the testing site will not show changes or save? please make sure you can save changes

Hi there,

It’s not saving due to internal server error, unfortunately, there is no details of the error so let’s do this.

  1. Edit your site’s wp-config.php and replace this line

define('WP_DEBUG', false);

with these new lines

define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true);
  1. Load your customizer and test its saving functionality (it should trigger the error)

  2. Download the file debug.log from folder /wp-content/ through FTP, then provide its content in the secure note

  3. For the meantime, if you can check debug.log content and noticed that the error is related to exhausted memory, then simply add this line before WP_DEBUG

define( 'WP_MEMORY_LIMIT', '512M' );

Then test the saving functionality again.

You can also use X > launch > Options, all settings should be set and change there instead in customizer.

Thanks!

thanks for the help. debug log below:

Hi there,

Thanks, I checked and I don’t see any issues with those code in mentioned lines. Upon research, this was a bug which dated back in 2004-2010, I’m not sure if it’s still the same today or perhaps the data that is processed are really string instead of the array.

This is the code responsible for that,

	
	function customize_save( $customizer ) {
		
		// get customizer settings (widgets)
		$settings = $customizer->settings();
		
		
		// bail ealry if no settings
		if( empty($settings) ) return;
		
		
		// append values
		foreach( $settings as $setting ) {
			
			// get $_POST value
			$value = $setting->post_value();
			
			
			// bail early if no acf
			if( !isset($value['acf']) ) continue;
			
			
			// save acf data
			acf_save_post( $value['acf']['post_id'], $value['acf']['values'] );
			
			
			// remove [acf] data from saved widget array
			$id_data = $setting->id_data();
			add_filter('pre_update_option_' . $id_data['base'], array($this, 'pre_update_option'), 10, 3);
			
		}
		
	}
	

I don’t know why ACF is trying to save the settings in customizer when it’s not even used there. Could you try making sure that all options have default values in X > launch > Options? It will really work there since ACF has no connection with it (eg. customize_save). If the values are false then make sure it’s not, the value depends on what type of options, example, if a title field has false value, then it’s string, you can simply remove it and leave it empty. If the options are radio buttons, then make sure one option is selected. This make sure that the settings has array values instead of empty or string. Then load your customizer again and test it.

May I know why you wish to use customizer this time?

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.