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

Warning: Illegal string offset 'url' in ...... 1443 php 7.1 #135

Open
ghost opened this issue Apr 11, 2017 · 10 comments
Open

Warning: Illegal string offset 'url' in ...... 1443 php 7.1 #135

ghost opened this issue Apr 11, 2017 · 10 comments

Comments

@ghost
Copy link

ghost commented Apr 11, 2017

Warning: Illegal string offset 'url' in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 709

Warning: Cannot assign an empty string to a string offset in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 709

Warning: Illegal string offset 'id' in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 711

Warning: Cannot assign an empty string to a string offset in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 711

Warning: Illegal string offset 'url' in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 712

Warning: Illegal string offset 'url' in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 712

Warning: Cannot assign an empty string to a string offset in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 712

Warning: Illegal string offset 'url' in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 721

Warning: Illegal string offset 'id' in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 722

Warning: Illegal string offset 'url' in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 723

@mehrshaddarzi
Copy link

mehrshaddarzi commented Sep 15, 2017

i have this problem.
please change tax_meta_class.php in line 704-706 to

$std = array('id' => '', 'url' => '');
if(is_array($field) and isset($field['std'])) {
unset($std);
$std = $field['std'];
}
$name = esc_attr( $field['id'] );
if(!isset($_GET['tag_ID'])) {
$value = array('id' => '', 'url' => '');
} else {
if(is_array($field) and isset($meta['id'])) {
unset($value);
$value = $meta;
}
}

@IdolR
Copy link

IdolR commented Nov 13, 2017

Fantastic @mehrshaddarzi this helped me! Thanks!

@niamrox
Copy link

niamrox commented Nov 14, 2017

Solution works fine when creating new Taxonomy but not working in Edit mood. Image or Media upload button have no respond.
Thanks

@IdolR
Copy link

IdolR commented Nov 14, 2017

The solution works for me, always. I see that @Biswash-Developer is using a Thimpress theme as me!
I wonder if this code is still supported since get_term_meta was introduced, maybe @bainternet can comment?

@bainternet
Copy link
Owner

@RixNox The Code uses "get_term_meta".

As for anyone with this issue,
please paste here to code you used to register the field for me to have a look.

@danielbarenkamp
Copy link

Better is to change line 704 from this:
$std = isset($field['std'])? $field['std'] : array('id' => '', 'url' => '');
to this:
$std = (isset($field['std']) && !empty($field['std'])) ? $field['std'] : array('id' => '', 'url' => '');

@IdolR
Copy link

IdolR commented Mar 9, 2018

@db-dzine (Daniel) could you explain your changes?

@danielbarenkamp
Copy link

@RixNox If you set an empty string to $std then the old function does not check this. Thats what i fixed.

@IdolR
Copy link

IdolR commented Mar 9, 2018

Thanks. I have applied changes to code following @mehrshaddarzi suggestions. Should I apply your changes to his code or to the original code?

@danielbarenkamp
Copy link

Replace original

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

5 participants