The relationship fields don't work correctly with Polylang.
Currently I have some fixes for the pick.php field but it doesn't work in all cases.
https://github.com/JoryHogeveen/pods/blob/patch-3/classes/fields/pick.php
The problem use case:
You would expect to see the relationship objects for the language "nl" since this post is in that language, but alas..
This returns no results because the global language filter is set to "en" and this filteres the results list for the relationships before we can check for translated relationship objects.
For these fields we'll need to disable the Polylang functions that filter the query results based on a language because we don't want the results from the global language filter but the results of the currently-being-edited-post language.
@Chouby , maybe you have any ideas?
Hi!
The code to filter the posts on admin side is here: https://github.com/polylang/polylang/blob/master/admin/admin-filters-post.php#L100:L128
You will see that the admin language filter is specifically de-activated to correctly filter media and links when editing a post. If I well understood, this is something similar that you want to do.
I am trying to figure out what is the best way to post an issue.
There is also a bbPress forum topic here: Pods.io Forum topic
There I posted:
I can confirm this also.
I am using WooCommerce and Polylang and when I try to pull a relationship from a product attribute to show on an enhanced user profile returns nothing.
WP 4.5.1
WooCommerce 2.5.5
Pods 2.6.5.2
Polylang 1.9
Polylang Theme Strings 3.0
Hi @davidoster ,
Could you test my version of pick.php? (make sure you have a backup of the original file)
https://github.com/JoryHogeveen/pods/blob/patch-3/classes/fields/pick.php
Let me know if this solves your issue!
As I mentioned on the forum...
I am afraid this version patch 3 of pick.php doesn鈥檛 work for me.
I forgot to mention one more plugin that I am using that is related to WooCommerce & Polylang
Hyyan WooCommerce Polylang Integration 0.25, so the complete list of plugins is,
WP 4.5.1
WooCommerce 2.5.5
Pods 2.6.5.2
Polylang 1.9
Polylang Theme Strings 3.0
Hyyan WooCommerce Polylang Integration 0.25
Quite a bit of discussion on this problem has been directed over at the forum, and we really need to keep it focused here for resolution:
http://pods.io/forums/topic/bi-directional-relationship-not-working-anymore-problem-with-polylang/
I've directed the participants in this forum post to send their discussion to this issue.
Sorry, I opened the thread on the forum because it seemed a different issue (the problem occurred with everything being set to en, the main language) and it probably needed more investigation/feedback.
The fix proposed by @JoryHogeveen seems to work in my case, but I have to check with different language combinations for filter - post - related pods
Well in my case I have this Hyyan WooCommerce Polylang Integration 0.25 and even when I installed the updated version of @JoryHogeveen nothing happened till the point that I realized that this plugin has an option for product attributes (enable/disable) and I disabled it (http://prntscr.com/b1mizi).
Of course this helped me resolve the issue just for now.
It is apparent that there is an issue with Pods and Polylang and in my case with WooCommerce also.
Just for reference I am using,
WP 4.5.2
WooCommerce 2.5.5
Pods 2.6.5.2
Polylang 1.9
Polylang Theme Strings 3.0
Hyyan WooCommerce Polylang Integration 0.25
@davidoster ,
Your problem is indeed a different problem than what my version fixed.
I also think the bug you're experiencing was there even in older versions of Pods.
I'll do a test a.s.a.p. (very busy at the moment!).
@jimtrue , Maybe it is better if we create a new issue here because it's not related to this topic.
@stefanomanfredini ,
Great to hear this fix worked for you aswell. There is still a minor bug as explaned above. This is something I think the pick.php file can't fix on it's own.
I will have to get some help of the Pods developers to look into this.
@davidoster your issue is definitely another issue. We can't troubleshoot polylang and woocommerce issues here as this is Pods. I would suggest your plugin for variations is conflicting with the other issue. If you still feel this is a Pods issue, please open another bug report.
@jimtrue
Any change of tackling this before the next release?
I think with someone from Pods who realy knows how pods get's all it's metadata this could be fixed quite easally.
Let me know!
@joryhogeveen that's not a decision I can make unfortunately. It's about coding resources. I'm #support I just manage the traffic flow ;)
I can consult on this, just need to know that someone can test it can verify everything is working 100% here
@sc0ttkclark I am your man here. I can even make a test site and provide the use and test case (along with login credentials).
Will this be sufficient?
I like where this is going :+1:
I'd like to help with creating and testing various use-cases offcourse.
There is a problem with bi-directional relationships between single-language (not set as "translatable" in polylang's settings- i.e. a gallery without textual descriptions) and multi-languages pods, it seems.
Everything set to main language (en).
While editing a multi language pod it's all ok, while in the opposite direction the options of relationships towards multi language pods are always empty.
Setting the relationship values from the multi languages pods still results in empty values when querying from the single language pod.
(Pods 2.6.5.2 with Jory's patch, polylang 1.9.1)
I think it's related, so i'm posting this here.
Should I open a new issue instead?
Yes this is definitely related.
I'm busy with some more fixes for this at the moment and I think this issue can be closed soon.
Tomorrow me and Scott will discuss/test this and come up with a solution.
In addition to this.
If people can provide use-cases of Pods and Polylang that I can test, please let me know.
I can imagine that people use these plugins in very different ways!
I can imagine that people use these plugins in very different ways!
Your imagination is definitely correct! ;)
@JoryHogeveen In my case it's a legacy project with a signed NDA, so I can't share the code - but I suppose I could PM you just the Pods Object structure export (plus polylang settings related to these objects), if you confirm it would be useful
@essemme Sure! You can find me on the Pods Slack (podswp.slack.com >> username keraweb)
@essemme @davidoster
Can you test the latest patch?
https://github.com/pods-framework/pods/pull/3574
Sure, i'll try it ASAP.
(P.S. Did you get my email?)
Thanks! And yes (forgot to reply, sorry)
I believe we've fixed your issue (relationships with non-translateable objects).
Yes, at first glance relationships form single-language to multi-languages pods seem to work as expected (gets the values set form the other pod in a bidirectional relationship, allows choosing options from different languages, and so on).
Other issues seem resolved as well - i had some problems while inserting new pods, sometimes the values for the relations were empty (updating was fine). I still didn't track down the conditions causing this (cache maybe), but it seems resolved yet.
I'll check further.
Thank you!
Could be that this was cache.
Current translation logic is this:
Default
Admin
_This part is not made for WPML (yet)_
After setting the correct current language to get Pods verifies every relationship type if it is translateable.
Fixed in 2.6.6!
https://github.com/pods-framework/pods/pull/3574