pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.07k stars 265 forks source link

Caching Bug from GF related to self::$related_objects in pick.php #5012

Open jimtrue opened 6 years ago

jimtrue commented 6 years ago

Describe the bug For full details, read the commentary at Pods GF Add-on at: https://github.com/pods-framework/pods-gravity-forms/issues/97#issuecomment-395730023

it seems self::$related_objects is not setup yet when the first field replacement is fired.

https://github.com/pods-framework/pods/blob/2.x/classes/fields/pick.php#L1977

adding $this->setup_related_objects( true ) to the conditional statement https://github.com/pods-framework/pods/blob/2.x/classes/fields/pick.php#L1977 fixes it, I don't have the time to work out why.... please let me know if you can shed some light on this. Otherwise I will circle back if I have time later.

GaryJones commented 6 years ago

@jimtrue Line 1977 in the 2.x branch is now empty. Please use the full URL to that the correct line number in that commit (press Y or select Copy Permalink from the option to the left of the line number), so that the reference persists.

jimtrue commented 6 years ago

Yeah unfortunately I didn't create this bug initially and this is not my area of expertise (referencing a bit of code that has been moved around specifically, can't quite tell if this is intended to be off of 1986 now or not. https://github.com/pods-framework/pods/blob/2.x/classes/fields/pick.php#L1986

jimtrue commented 6 years ago

@GaryJones See notes in initial bug report linked above. https://github.com/pods-framework/pods-gravity-forms/issues/97#issuecomment-395730023

quasel commented 6 years ago

@mgratch is the original reporter maybe he has some new insights!

mgratch commented 6 years ago

Here is the original code I was referring to when I came across the bug.

Here is the current version

I will try to make time to supply test data. If I remember correctly the project requirements changed and we didn't have to deal with the bug allowing for safe updates.