mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 15:05:39 +00: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) {
|
||||
$extra = $list->getExtraFields();
|
||||
$key = $list->getLocalKey();
|
||||
$foreignKey = $list->getForeignKey();
|
||||
$foreignID = '= ' . (int) $list->getForeignID();
|
||||
|
||||
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…
x
Reference in New Issue
Block a user