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

Error when saving a section that contains an oembed field (PHP 7.2) #59

Open
twiro opened this issue Jun 1, 2019 · 2 comments
Open

Comments

@twiro
Copy link
Contributor

twiro commented Jun 1, 2019

Whenever I try to save a section that contains an oembed field in a project that is running under PHP 7.2 I get the following error:

Symphony Warning: count(): Parameter must be an array or an object that implements Countable

An error occurred in …/extensions/oembed_field/fields/field.oembed.php around line 366

365 // Permit only some specific drivers
366 $settings['driver'] = empty($drivers) || count($drivers) < 0 ? null : $drivers;

The section seems to save mostly correctly though, but I can only manage one oembed driver to get saved…

@twiro
Copy link
Contributor Author

twiro commented Jun 1, 2019

I forgot – Setup is latest Symphony and latest Oembed field!

@mblabs
Copy link

mblabs commented Sep 23, 2019

Not sure, but try to replace with this:

$settings['driver'] = empty($drivers) || (($drivers instanceof Countable) && count($drivers)) < 0 ? null : $drivers;

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

2 participants