mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Merge pull request #54 from jyrkij/fix-48
Update only current record for many_many relations
This commit is contained in:
commit
1a521a3ce0
@ -278,9 +278,17 @@ class GridFieldOrderableRows extends RequestHandler implements
|
|||||||
if($list instanceof ManyManyList) {
|
if($list instanceof ManyManyList) {
|
||||||
$extra = $list->getExtraFields();
|
$extra = $list->getExtraFields();
|
||||||
$key = $list->getLocalKey();
|
$key = $list->getLocalKey();
|
||||||
|
$foreignKey = $list->getForeignKey();
|
||||||
|
$foreignID = $list->getForeignID();
|
||||||
|
|
||||||
if(array_key_exists($this->getSortField(), $extra)) {
|
if(array_key_exists($this->getSortField(), $extra)) {
|
||||||
return sprintf('"%s" %s', $key, $value);
|
return sprintf(
|
||||||
|
'"%s" %s AND "%s" = %d',
|
||||||
|
$key,
|
||||||
|
$value,
|
||||||
|
$foreignKey,
|
||||||
|
$foreignID
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user