Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACF Pro 5.2.9 (Fatal error) #5

Open
reinkrijgsman opened this issue Aug 19, 2015 · 7 comments
Open

ACF Pro 5.2.9 (Fatal error) #5

reinkrijgsman opened this issue Aug 19, 2015 · 7 comments

Comments

@reinkrijgsman
Copy link

Hey, I get an error in ACF Pro 5.2.9:

Fatal error: Call to undefined function acf_force_type_array() in /home/xxxx/public_html/xxxx/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 367

The error appears while loading the field in the option page (not the edit option/group page).
It did work in ACF Pro 5.2.2, didn't test it in 5.2.3, 5.2.4, 5.2.6, 5.2.7 and 5.2.8

@reinkrijgsman reinkrijgsman changed the title ACF Pro 5.2.9 ACF Pro 5.2.9 (Fatal error) Aug 19, 2015
@vblinden
Copy link

I also get this error 😭, when I copy the acf_force_type_array() function inside the acf-typography-v5.php file, it works, but the font weights aren't correctly displayed.

Please help us. ❤️

@davidmcnee
Copy link

Just commenting out line 367 works for me

@reinkrijgsman
Copy link
Author

Could you please copy the code you commented? That doesn't work for me...

@davidmcnee
Copy link

i've extended the plugin a fair bit so my file won't match up but just search in acf-typography-v5.php for

$field['value'] = acf_force_type_array($field['value']);

and comment it out. It's working fine for me now with the latest version of ACF Pro

Cheers

@rensbakker
Copy link

I've commented out line 367, and get the following errors:

Notice: Undefined index: font-family in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 411

Notice: Undefined index: font-family in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 423

Notice: Undefined index: font-weight in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 432

Notice: Undefined index: font_size in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 491

Notice: Undefined index: line_height in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 505

Notice: Undefined index: text-color in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 533

Notice: Array to string conversion in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 582

Notice: Array to string conversion in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 582

It's Wordpress version 4.3 & ACF version 5.3.0

@KeviinCosmos
Copy link

I've commented out line 367, and get the following errors:

Notice: Undefined index: font-family in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 411

Notice: Undefined index: font-family in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 423

Notice: Undefined index: font-weight in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 432

Notice: Undefined index: font_size in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 491

Notice: Undefined index: line_height in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 505

Notice: Undefined index: text-color in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 533

Notice: Array to string conversion in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 582

Notice: Array to string conversion in /home/example/public_html/example/wp-content/plugins/acf-typography-master/acf-typography-v5.php on line 582

It's Wordpress version 4.3 & ACF version 5.3.0

Same here in newest version..

@DACbyJS
Copy link

DACbyJS commented Feb 20, 2019

This function was deprecated and removed from ACF, but I found the original code. Copying this function inside the main acf-typography-v5.php where the function call can get to it works best.

		function acf_force_type_array($var)	
		{
		 
			// is array?
			if (is_array($var)) {
				return $var;
			}
	
			// bail early if empty
			if (empty($var) && !is_numeric($var)) {
				return array();
			}
			 
			 
			// string
			if (is_string($var)) {
				return explode(', ', $var);
			}
			 
			 
			// place in array
			return array( $var );
		}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants