@davidkoh83
Thanks for reporting the bug, but I don’t seen to be able to replicate it. Could you please export your Pods by Pods component – Migrate Packages, and paste it here so I can investigate, as well as your code to get the results? I will appreciate it if you could provide screenshots as well.
Thanks.
Hi,
I don’t really want to install so many things on the server at the moment so I just made a screenshot and uploaded it to our server for your reference: https://cdn.cancerletter.online/media/2021/03/05151431/panda-scaled.jpg
To explain each part. The number below = the number on my screenshot:
1. Those are my pods
2. I made 1 ACT called contributor_detail that has a field called start_date
3. I made another ACT called contributor_institution which has article_id
4. The CPT contributors have 2 fields using your plugin to point to contributor_detail and contributor_institution. As you can see highlighted in red, I placed start_date and article_id for sorting
5. When I try to get the data using pods_field, the institution_detail that points to contributor_institution returns empty while the other is ok
6. I found out that you have a function to return the select statement so I used that to see what it was selecting. As you can see, for contributor_institution, instead of using article_id that was set, it used start_date instead from the previous value
7. In order to overcome this bug, I had to overwrite that by using your function but with extra param to state the order_by again to overwrite what was previously set
In addition to the above, if I swap the order of additional_details and institution_details inside my contributors CPT, both will show article_id in the SELECT statement as the order_by instead so it is definitely a bug
@davidkoh83
Many thanks for the detailed explanation :).
Yes, it is a bug. I’ve fixed it and will release a new version asap.
Thanks again.
@davidkoh83
If you would like to test it before the new release, you could download it from https://github.com/coding-panda/panda-pods-repeater-field/tree/develop. Let me know if it doesn’t fix the problem. Thanks.
Hi,
I have tested and it is working perfectly now. Thank you for the fix and quick response!
@davidkoh83 Hello, Version 1.4.9 has been released. Any problems, please let me know.
Hi,
I seem to be getting this sometimes now:
PHP Fatal error: Uncaught Error: Class ‘PodsField’ not found in /var/www/html/wp-content/plugins/panda-pods-repeater-field/classes/podsfield_pandarepeaterfield.php:9
Stack trace:
#0 {main}
thrown in /var/www/html/wp-content/plugins/panda-pods-repeater-field/classes/podsfield_pandarepeaterfield.php on line 9
Hi @davidkoh83
It usually happens when Pods is not available or loaded after the plugin. I don’t know how to replicate this error as it is not happening to me, but I’ve added some code to check if the PodsField class exists before loading the files. Hopefully, that can fix the problem.
You could test it with the dev version: https://github.com/coding-panda/panda-pods-repeater-field/tree/develop.
If it doesn’t work or cause new problems, please let me know.
Thanks