mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-09-29 20:59:26 +02:00
fixed many many ordering so that other many many lists with the same relation aren't affected
This commit is contained in:
parent
45eb7954a6
commit
d983768165
@ -278,9 +278,11 @@ 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 = '= ' . (int) $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" %s', $key, $value, $foreignKey, $foreignID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user