Replies: 7 comments
-
I tried adressing this by adding where ’relationhip_field.ID is NULL to the field but that did not turn out to be practical. The problem is that, after you select a value, even that own selected value is now excluded (because id is not null). If you ever go back to that post to edit something and save, the field will save as blank again. For example: I select an image (in a post), save, everything is fine. Go back to that post, edit text, save, image is now gone. (blank value is saved) |
Beta Was this translation helpful? Give feedback.
-
What you are describing can’t be a use case for Bidirectional relationships because you want many to one, which is not how bidirectional data works. If you want to make the relationship work as bidirectional, your best bet is to set the single select as a multi select. Might I suggest our fabulous List view as the option you choose for multi select type :) |
Beta Was this translation helpful? Give feedback.
-
I think the problem @or1g1na1 is describing is actually referring to is valid: Once an item has been selected in a 1-M side of the relationship, what they're wanting to do is make the items that are selected (or connected) to no longer be available to the pick list until someone either goes in and removes the from the original relationship or someone clears the connection from the other side (in the case above, from the 'image'). Right now, if someone were to select an item from the list of possible related items, they could clear the single select connection from the currently existing records. Bidirectionality only enforces the connection and makes sure it's set at both sides of the connection (updated on one side, updated on other side). This is about forcing exclusive selection: Once an item is selected, it can't be available to the pick list. Make sense? Question came across #support today that was looking for the identical configuration. |
Beta Was this translation helpful? Give feedback.
-
agree with @jimtrue on the interpretation and I see the issue at least there should be a warning that if you select it that you do a "reassignment" because it's already connected to another CPT e.g a book that can only have on author and you try to assign it from a different author ;) |
Beta Was this translation helpful? Give feedback.
-
Similar issue, would love a feature where this was somehow possible. Am building an Invoice System. It has two CPT - Invoice and Tasks, and I want 1 task to be available to one invoice only. So for example, Invoice 1234 has multiple tasks. if I create Invoice 4567, I don't want the user to be able to chose the tasks defined in Invoice 1234. Would greatly appreciate a solution. Thanks. |
Beta Was this translation helpful? Give feedback.
-
I see now, that makes sense now. Yeah this is valid |
Beta Was this translation helpful? Give feedback.
-
This would be a great feature enhancement as it would prevent user from accidentally assigning/removing ralationship between pods. It would be good if the UI could show which pod it is related to so that user can disconnect the relationship before assigning it to the new one. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, in a one to one or one to many (one side) relationship, when making a selection the item is able to be selected again (on a different post instance.
For example: Custum field 'external_image' in extended post type 'post' linked to custom post type 'ImageExternal" with field 'url'.
Selecting a 'external_image" in a 'post' Post A works as expected and an only able to select one.
But if I make a new 'post' - Post B, I am able to select the same "external_image" that was selected in Post A. Post a image is then cleared.
Would be great if items belonging to a 'post' were no longer selectable in future 'post', or at least if they were marked differently from the rest to discourage accidental deletion of "external_image'.
Beta Was this translation helpful? Give feedback.
All reactions