I’m trying to get bidirectional fields to update properly.
We have CPT [professors] and [courses]. I’ve added a [relationship] field for both, each pointing to one another from both sides.
Now when adding Prof to a Course, the Prof seems to be updated correctly. However, when I save a Prof with course X, the course X only shows that professor after a refresh, instead of any/all previously selected Profs.
So then it’s possible for a professor to be assigned to Course X, but not actually showing up inside the course.
I’ve already tried renaming the bidirectional fields, running code below (saving all pages empty, then adding any relations), but nothing seems to solve this.
// always update values of all bidirectional fields
add_filter('acfe/bidirectional/force_update', '__return_true');
// or target a specific field only
add_filter('acfe/bidirectional/force_update/name=my_field', '__return_true');
Any idea what’s going on here?
Best,
Dave
I believe I ran into a bit of an edge case with bidirectional relationship.
To summarize, when previewing a post that has a relationship
type field set to be bidirectional with a post object
type field, the post object
field’s value gets replaced with a revision id of the post I just previewed (probably the revision that wordpress generates to show the preview). The revision then automatically gets deleted and my post object
field ends up with an id that doesn’t exist.
Here are the steps to reproduce this behaviour :
I believe what might be happening here is WordPress generates a revision for previewing, which triggers the bidirectional saving in said revision and overrides the value in the post object field of the ingredient with the id of that revision. Could be something else entirely but I thought it seemed like a logical explanation.
I’ve been able to reproduce this issue with the latest WP version (6.1.1), the latest ACF Pro (6.0.7) and the latest ACFE (0.8.9) using the Twenty Twenty-Three theme on a fresh WP install.
I hope it’s not too confusing as it’s a bit hard to explain this. Don’t hesitate to ask for more details if needed.
Best regards,
]]>I have the following situation:
Xpl — relations field —> Ypl
I am using WPML, so I immediately have the relation:
Xeng — relations field —-> Yeng (“copy” setting in WPML)
I installed ACFE to achieve bidirectional relation.
Bidirectional works for primary language:
Xpl <— relations field — Ypl
But relationships in a different language version are not synchronized:
Xeng <— relations field —- Yeng
Anyone have an idea why this might be happening?`
]]>I don’t know how to solve this bidirectional fields data in Pods template.
I publish posts in 2 categories:
I have created Pod for posts with bidirectional relationship field
Workings for
In which I choose from the Works list. This means that current Working post is related to chosen Work post.
Then I created Pods template for posts.
I added {@workings_for.post_title}
And for Working posts it displays post title of which Work post it is related to.
But I dont know how to solve 2 things:
I hope it can be done in Pods template?
]]>But I have a problem: Many had this before, but I didn’t find a solution yet.
I have different post types called for example “Instruments”, “Audio”, “Video”, etc…
In the backend of the different CPT’s I have tabs and groups for better optics. One of the group is called “Relations” with different Relationship Thingies. Those are set to “Bidirectional”. And this works. When I select a post, it becomes Bidirectional related.
BUT: In every post type I do have also other groups and some of the information of the object I choose as a related object goes missing. Informations from Repeaters. When they are top level, they just vanish in the backend.
When they are nested in a group, they don’t vanish in the backend but aren’t there in the front-end, as long as I don’t go into the post edit and update the post again. But this happens not only to repeaters nested in groups, but for example to chosen values of Radio Buttons as well. I can see the correct choice in the backend, but before I Update the post again (even without any changes done), they behave, as I would have chosen the first value.
How can I avoid this behaviour?
Best
Martin
but i have to ask!
is it possible to have a relationship inside a repeater to update another relationship?
a bit more in detail:
– CPT “Movie” has a repeater field with a relationship field “Actor”
– CPT-“Actor” has a (top-level) relationship field “related movies”
– adding an “Actor” on a “Movie” should update the “related movies for an “Actor”
what i don’t need:
i don’t want to manually change the “related movies” on CPT-“Actor” and further this should not update the relationship field on CPT-“Movie”. it’s just one way
i think i once had it setup the way i want it but on my long development journey it got lost and i need it back
Is this possible to accomplish? I have several other relationships set up without a problem.
]]>I need to test it again.
————————————————————————–
Old review
This plugin looks that is helpfull and actually extends the ACF , but its not except probably in some easy solutions even without this plugin.
It says that has Bidirectional , but that thing is not working with fields that are grouped or in a repeater.. Such a waste of time.
If i am missing something i would be more glad to change the review , but i have wasted 2 hours with it and i see that it will not work unfortunately.
]]>I’m struggling to get the bidirectional feature to work. My setup:
– I have 2 relationship fields in the same field group to which I want to create a bidirectional relationship
– I’ve created each relationship field and saved
– Then I turn on bidirectional for each field but when I click select (in either of the fields) it just says: ‘The results could not be loaded.’
I’ve followed through the example given in the FAQs too, trying to set up the relationship between field groups as per that example but I get the same result.
I was thinking perhaps that I may have to turn this feature on in the settings somewhere but the install instructions suggest all the features work out of the box.
I can’t find a similar problem in this forum so I hope it is something you can help with. I would greatly appreciate it!
Many thanks,
Richard
PS I meant to say:
I’m running ACF Pro 5.8.12 on a local dev server using MAMP Pro, using php version 7.3.9
]]>I’m new to pods and would like to imitate the following law site, in simpler:
legifrance: block with 1 article,
legifrance : block with 2 articles.
At this stage, ignore the sidebar (versioning and rolling table of content). You will note a path (“chemin”, in French) at the top, and hyperlinks to children pages below the article(s). Moreover, if you click on “Code des assurances” (after “chemin”), the legal text name (in this case “code of insurance”), you get a table of contents of the text: table of contents. At the bottom, you have 2 links: “<< Bloc précédent – Bloc suivant >>”, meaning “previous block (of articles)” and “next block”. So blocks may have their own articles, as well as children blocks. I created advanced custom content types for articles, for blocks and for legal texts, with bi-directional relationship fields between a legal text and its blocks, between a block and its articles, between a block and the next block. I will also need a bidirectional relationship between a block and its children blocks. My problem is how to manage the order? For instance, for a block, I want to list its children IN THE RIGHT ORDER (i.e. the order they have in the legal text itself). Unlike legifrance, I don’t intend to enter full legal texts inside my database, but only extracts, plus the titles of big parts, and I don’t want to renumber manually the blocks or articles each time I insert a new one between 2 ones which are already in the database. Ideally, I would like the articles and blocks to get ordered automatically according to their official legal number. For instance, L300-1 is before L364-2 but after L127-2-1. Would you have any advice for the data structure?
Thank you in advance.
]]>