Home › Forums › General Issues › Repeater field in template breaks in PHP 8 › Reply To: Repeater field in template breaks in PHP 8
@mww I honestly don’t have a clue. There is too much going on with that line for me to figure out what part of it is causing the error or why it would cause an error in PHP 8. (I’m not an ACF dev).
You might want to contact the devs on it.
If it was me I would open that file and make changes and see if I could figure it out because it is the type of thing I would do. But I don’t have any sites running php PHP 8 yet.
Since I now that it is causing an error I would use the error log
this is the line of code causing the error
$value[ $i ][ $sub_field['_name'] ] = $sub_value;
and this is what I would do to start
ob_start();
echo '$i = ';
var_dump($i);
echo "\r\n".'$sub_field[_name] = ';
var_dump($sub_field['_name']);
echo "\r\n".'$sub_value = ';
var_dump($sub_value);
error_log(ob_get_clean());
$value[ $i ][ $sub_field['_name'] ] = $sub_value;
You now the last line is going to cause a fatal error, so you just need to find it in the log and then see what is in the log before that point. Figure out what part is causing the error and then go from there.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.