Closed justaguy84 closed 5 years ago
After debugging a little more, I can see the pods function is causing this:
Note for @pglewis: https://github.com/pods-framework/pods/blob/2.x/classes/PodsData.php#L3243
We just need to replace that line with:
$traverse = apply_filters( 'pods_data_traverse', $traverse, $traverse_recurse, $this );
@sc0ttkclark @pglewis - another place:
PR started: #5301
Still need to look at the second spot in Pods->field()
Another place where compact() generates notices is in the pods\classes\PodsAPI.php
file.
Notice: compact(): Undefined variable: custom_fields in {file_name} on line 3553
Also on lines
The solution appears simple. Change (starting from line 3404)
// Find the active fields (loop through $params->data to retain order)
if ( ! empty( $params->data ) && is_array( $params->data ) ) {
$custom_fields = array();
//...
to
// Find the active fields (loop through $params->data to retain order)
$custom_fields = array();
if ( ! empty( $params->data ) && is_array( $params->data ) ) {
//...
and the notices goes away. (At least in my current case.)
Issue Overview
A notice error is being seen after updating php to version 7.3
Expected Behavior
I'm using pods and fetch functions on the layout and there is a new notice about an undefined variable.
Current Behavior
It's not a bug as it's just a notice, but I think this should be resolved as more and more are using php 7.3
Steps to Reproduce (for bugs)
WordPress Environment
Pods Package Export (helpful!)
Workaround or Alternate Solution Until Bug is Addressed
Related Issues and/or PRs