Skip to content

Commit 549231d

Browse files
authored
fixes #19
1 parent 0cecc6a commit 549231d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

RelationTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public function loadAll($POST, $skippedRelations = [])
2121
{
2222
if ($this->load($POST)) {
2323
$shortName = StringHelper::basename(get_class($this));
24+
$relData = $this->getRelationData();
2425
foreach ($POST as $key => $value) {
2526
if ($key != $shortName && strpos($key, '_') === false) {
2627
/* @var $AQ ActiveQuery */
@@ -33,7 +34,7 @@ public function loadAll($POST, $skippedRelations = [])
3334
$relPKAttr = $relModelClass::primaryKey();
3435
$isManyMany = count($relPKAttr) > 1;
3536

36-
if (in_array($relName, $skippedRelations))
37+
if (in_array($relName, $skippedRelations) || !array_key_exists($relName,$relData))
3738
continue;
3839

3940
if ($isManyMany) {

0 commit comments

Comments
 (0)