get_post_meta() returning data inconsistently #6647
Replies: 9 comments
-
For now, to get consistent return values, I need to
|
Beta Was this translation helpful? Give feedback.
-
any special reason you use get_post_meta() with $single set to TRUE ? just using the default might fix your issue. Still it should return the same in your case! Any other code in File 1 or 2 that interferes with pods? as something must be different as code not randomly creates two different outputs - we need just to find out what's different
pods itself uses https://pods.io/docs/database-reference/database-storage-relationship-fields/ to query that information! (we take care of that even if you use |
Beta Was this translation helpful? Give feedback.
-
So the function returns a singular value instead of an array. pci_project_client is a singular value.
What does that mean? |
Beta Was this translation helpful? Give feedback.
-
What does |
Beta Was this translation helpful? Give feedback.
-
FYI for reference, our get_post_meta integration runs through here: https://github.com/pods-framework/pods/blob/2.x/classes/PodsMeta.php#L3009 |
Beta Was this translation helpful? Give feedback.
-
At first glance, it's possible calling get_post_meta() the first time, primes the cache incorrectly. We'll want to check that out and see if we can confirm that. |
Beta Was this translation helpful? Give feedback.
-
It's just a wrapper for
That method looks intense! If I find the time, I might try to take a closer look at it.
Thanks a lot. |
Beta Was this translation helpful? Give feedback.
-
Any finding's? as it seems to work in a quick test - but maybe you used a different configuration? can you share your config? any caching active? Or it's multisite related just realized I tested it in a single install |
Beta Was this translation helpful? Give feedback.
-
Related: #3614 |
Beta Was this translation helpful? Give feedback.
-
Issue Overview
Code in file 1 (
p()
is my debug function):Output:
Code in file 2:
Output:
Expected Behavior
get_post_meta()
should only ever query the provided key.Current Behavior
Once, get_post_meta() returns the correct value of the provided key (pci_project_client), another time it returns the value of
_pods_pci_project_client
Steps to Reproduce (for bugs)
?
Possible Solution
?
WordPress Environment
PHP Version: 7.2.9-1+ubuntu16.04.1+deb.sury.org+1
MySQL Version: 5.7.23
Server Software: Apache/2.4.34 (Ubuntu)
Your User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0
Session Save Path: /var/lib/php/sessions
Session Save Path Exists: Yes
Session Save Path Writeable: Yes
Session Max Lifetime: 1440
Opcode Cache:
Object Cache:
WPDB Prefix: nx24_2_
WP Multisite Mode: Yes
WP Memory Limit: 64M
Pods Network-Wide Activated: Yes
Pods Install Location: /media/Entwicklung/Entwicklung.xxx/www/v2/wp-content/plugins/pods/
Pods Tableless Mode Activated: No
Pods Light Mode Activated: No
Currently Active Theme: xxx Interface Theme
Currently Active Plugins:
Copy and Paste the JSON Export from Pods Admin, Migrate: Packages, Export in WordPress admin here
Beta Was this translation helpful? Give feedback.
All reactions