Replies: 22 comments
-
Not sure how this one is going to work. When you add new to the related record, the 'connection' to the related record in it's bidirectional field won't be updated until you 'save' the originating record. The item has been selected and added to the parent window, but the bidirectional relationship won't be saved to the child record until you 'save/update' the parent. |
Beta Was this translation helpful? Give feedback.
-
Bi-directional only gets set when you commit to saving the current item. So any items you add within the modal can't be bi-directionally related until they commit to saving it. |
Beta Was this translation helpful? Give feedback.
-
Correct, but as a usability standard: If there's a related record in the modal for the child record, it should automatically be set to the parent record. Don't know how you could do that, however. |
Beta Was this translation helpful? Give feedback.
-
We could do that by appending the originating pod/field slug so we can reference that on saving of a field that's bi-directional. We'd have to add some stuff to the corresponding pod form to do it, which would take some effort -- however I am strongly against any bi-directional association until committing to the save from the primary save form, which would then handle the bi-directional saving on it's own. |
Beta Was this translation helpful? Give feedback.
-
My thought actually would be, we'd be setting the value for the bidirectional record (if it's detected in the child pod) the same way we would if it was a 'default value' set via parameter or Query Var, in this case the ID of the Parent Pod. We'd only set it in the 'form', we wouldn't save it until they hit save. But it would only be if the child record had a bidirectional pointing back at the parent. |
Beta Was this translation helpful? Give feedback.
-
Hi **First lets note that it can be working ONLY on EDIT form mode. (on Add new, of course no ID exist yet to refer to) **What is obviously needed is that **To make it understandable let me give a use case A project form, in EDIT mode, with multiples bugs elements as a related field list view. On add, modal window with a Bug form, and a Project single selector is there **My own guess as I feel is that *Then in the relation field code,when we display the proejct field in the bug form, we only and simply need to detected if there is a param target_relation with the same name. In case of ajax this should be set in JS after loading of course, but its not a big deal at all If you don't plan to do it,
thanks |
Beta Was this translation helpful? Give feedback.
-
By the way |
Beta Was this translation helpful? Give feedback.
-
Add New 'relationship' if you're allowed to do a multiple select will always be available, because you might be adding new 'child record'. When you're in the Child Record 'modal', the Add New is not available or that would take you into an 'inception' style interface. We only allow adding child records from the parent. Even if you are Editing the current record, you might need to Add a New Child record. |
Beta Was this translation helpful? Give feedback.
-
Hi jimtrue. Its already an issue in the current situation of your code, without changing anything.: You add a new entity Project This is a kind of usability non sens. So we should allow a setting to show this button only in case of EDIT, ***Another note about code: |
Beta Was this translation helpful? Give feedback.
-
For info I managed very quickly to add the first part I was talking about to have this url auto generated for the modal just adding this //ADDED BY REN 20170528
public function build_dfv_field_config($args)
//ADDED BY REN 20170528
Note that the 2 extra config are not yet hiding/showing in case we use or not Add New button But I think its the simple way to go |
Beta Was this translation helpful? Give feedback.
-
The build process is a moving target as we learn what is working well and discover new pain points. In depth documentation right now would likely be stale within a few weeks, a couple of months at most. (see: #4253, #4178) The process is not at a state where third party code should rely on it, and providing any public documentation runs the risk of that happening. |
Beta Was this translation helpful? Give feedback.
-
@renaudham It actually sounds in the last several comments, that you're discussing a different requirement or potential enhancement to child relationships (almost a new capability or at least control scope). Might I suggest opening a new 2.7 Enhancement request so that your discussion doesn't get lost in this issue? |
Beta Was this translation helpful? Give feedback.
-
Ok yes thanks |
Beta Was this translation helpful? Give feedback.
-
Punting to 2.8 since this looks like a bit more effort. I'll make a task list though |
Beta Was this translation helpful? Give feedback.
-
For Bi-Directional Situations
|
Beta Was this translation helpful? Give feedback.
-
Hi As I understand the version 2.8 under beta should offer a solution for this? I have done my own fix for this
but I hope the new version will allow me to have it also. -For my side the solution was very simple, in pods-dfv.min.js
Result: adding a variable in the url of the modal opened, getting automatically the current parent pod type and post id in my case then you just need to set in the child bi -directionnal field, in the child form, this and it all works quite well |
Beta Was this translation helpful? Give feedback.
-
@renaudham No, at present, we haven't provided or coded a solution to this yet. That's what we're asking you: If you have indeed modified the core code to create a solution for your situation, we're asking you to provide that code for review (as a Pull Request against our code) so we can incorporate it into Pods and credit you for the work. |
Beta Was this translation helpful? Give feedback.
-
Hi Jim Its really basic and its not yet handling the case when the post is not saved yet but I could add it easily. I wait to see for your comments. Not sure if its usable by anybody... Thanks |
Beta Was this translation helpful? Give feedback.
-
That would have to be up to @sc0ttkclark and @pglewis to decide. I'm not a developer so can't review whether your implementation makes sense or not. |
Beta Was this translation helpful? Give feedback.
-
Any ideas when this might be implemented? Or is it available already? |
Beta Was this translation helpful? Give feedback.
-
Punting to 2.8 as @sc0ttkclark mentioned before: #4249 (comment) |
Beta Was this translation helpful? Give feedback.
-
This one didn't make the 2.8 cut-off, will push this to the next available release. |
Beta Was this translation helpful? Give feedback.
-
2.7 Bidirectional Relationship field isn't updated automatically to the opening modal when adding related record submitted via Slack by jimtrue updated by Quasel
Parent
Child Modal
Beta Was this translation helpful? Give feedback.
All reactions