You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed today that a CMS user probably can't tell the difference between a has_many and many_many Gridfield (using GridFieldConfig_RelationEditor) and thus likely wouldn't realise that the 'Link existing' function behaves differently depending on the type of relationship. I was caught off guard today thinking I was saving myself time by reusing content in a many_many relationship, but then realised it was a has_many when I saw that most of the 'holders' I was working on were empty.
A possible solution could be that if you select an item which is already linked to something else in a has_many relationship you could get a modal confirmation message like:
"That {Thing} is already linked to {Title of object}. Linking it to this {Thing} will unlink it from {Title of object}."
This came up on a project today and I implemented a little hack to just remove the 'link existing' field from GridFieldConfig_RelationEditor on has many lists, since I don't think it should be there. I customised GridFieldAddExistingAutocompleter::getHTMLFragments() with:
if ($gridField->list instanceof HasManyList) {
return"";
}
Affected Version
4.6.0
Description
I noticed today that a CMS user probably can't tell the difference between a
has_many
andmany_many
Gridfield (using GridFieldConfig_RelationEditor) and thus likely wouldn't realise that the 'Link existing' function behaves differently depending on the type of relationship. I was caught off guard today thinking I was saving myself time by reusing content in amany_many
relationship, but then realised it was ahas_many
when I saw that most of the 'holders' I was working on were empty.A possible solution could be that if you select an item which is already linked to something else in a
has_many
relationship you could get a modal confirmation message like:Related: WPP-Public/akqa-nz-silverstripe-menumanager#41
Steps to Reproduce
Use GridFieldConfig_RelationEditor on a has_many relation.
The text was updated successfully, but these errors were encountered: