mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
More silly logic errors
This commit is contained in:
parent
2460e54028
commit
fe3f0bd34e
@ -496,7 +496,7 @@ class RelationController extends ControllerBehavior
|
||||
*/
|
||||
$existingIds = $this->findExistingRelationIds($checkedIds);
|
||||
$checkedIds = array_diff($checkedIds, $existingIds);
|
||||
$foreignKeyName = $this->relationModel->getKey();
|
||||
$foreignKeyName = $this->relationModel->getKeyName();
|
||||
|
||||
$models = $this->relationModel->whereIn($foreignKeyName, $checkedIds)->get();
|
||||
foreach ($models as $model) {
|
||||
@ -547,7 +547,7 @@ class RelationController extends ControllerBehavior
|
||||
/*
|
||||
* Check for existing relation
|
||||
*/
|
||||
$foreignKeyName = $this->relationModel->getKey();
|
||||
$foreignKeyName = $this->relationModel->getKeyName();
|
||||
$existing = $this->relationObject->where($foreignKeyName, $foreignId)->count();
|
||||
|
||||
if (!$existing)
|
||||
|
Loading…
x
Reference in New Issue
Block a user