Skip to content

Conversation

turtlepod
Copy link

I encountered a fatal error in one environment, but I am still investigating the root cause. It may be due to incorrect hooks like pre_get_posts or queries bleeding.

This solution should prevent any future fatal errors related to this issue.

@szepeviktor
Copy link
Contributor

Isn't is better to have a fatal error? It points out that there is an incorrect hook.

@turtlepod
Copy link
Author

In local or staging, maybe.
In production, I’d prefer to avoid any fatal errors.

@szepeviktor
Copy link
Contributor

How about not being blinded?

$this->data->errors[] = 'Rows are not an array!';
return;

@johnbillion
Copy link
Owner

Thanks for the PR @turtlepod. Were you able to investigate this any further? I am reluctant to add type coercion without understanding where the underlying problem is coming from.

@turtlepod
Copy link
Author

@johnbillion Sorry for the late reply. I haven’t been able to investigate this further yet.

The fix I submitted is more of a safeguard—a good practice to prevent errors (especially since the rows data isn’t set as an array by default ?).

That said, the issue might actually be related to Gravity Forms (possibly an add-on or some configuration). The error disappears when I deactivate GF, so it seems connected.

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

Successfully merging this pull request may close these issues.

3 participants