mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Merge branch 'ManyManyRelationOrdering' of git://github.com/dnadesign/silverstripe-gridfieldextensions
* 'ManyManyRelationOrdering' of git://github.com/dnadesign/silverstripe-gridfieldextensions: fixed many many ordering so that other many many lists with the same relation aren't affected
This commit is contained in:
commit
2f67044ea9
@ -280,9 +280,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…
Reference in New Issue
Block a user