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

Bug Php 8.0:Uncaught TypeError: strlen() #5

Open
bonakor opened this issue Oct 18, 2023 · 0 comments
Open

Bug Php 8.0:Uncaught TypeError: strlen() #5

bonakor opened this issue Oct 18, 2023 · 0 comments

Comments

@bonakor
Copy link

bonakor commented Oct 18, 2023

Hello,

On vient de passer à php 8.0 et on a cette erreur critique. Une erreur de type E_ERROR a été causée dans la ligne 54 du fichier /plugins/acf-extensions/fields/class-acf-field-dynamic_select.php. Message d’erreur : Uncaught TypeError: strlen(): Argument #1 ($str) must be of type string, array given in plugins/acf-extensions/fields/class-acf-field-dynamic_select.php:54

J'ai du pousser un hotfix sur ma prod, j'ai fait ça :
Ligne 54 et 55, j'ai remplacé par
if (is_string($choice)) {
$choices[sanitize_title($choice)] = $choice;
} elseif (is_array($choice)) {
foreach ($choice as $item) {
if (is_string($item)) {
$choices[sanitize_title($item)] = $item;
} else {
error_log("Invalid choice found: " . print_r($item, true));
}
}
} else {
error_log("Invalid choice data type: " . gettype($choice));
}

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

1 participant