Skip to content

Commit

Permalink
Update some inner-matrix service items
Browse files Browse the repository at this point in the history
  • Loading branch information
engram-design committed Oct 24, 2018
1 parent 8a275ba commit 635e591
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/services/SuperTableMatrixService.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ public function getMatrixInputHtml($matrixField, $value, ElementInterface $eleme
if ($value instanceof MatrixBlockQuery) {
$value = $value
->limit(null)
->status(null)
->enabledForSite(false)
->anyStatus()
->all();
}

Expand All @@ -184,8 +183,7 @@ public function getMatrixInputHtml($matrixField, $value, ElementInterface $eleme
$block = new MatrixBlock();
$block->fieldId = $matrixField->id;
$block->typeId = $blockType->id;
$block->fieldLayoutId = $blockType->fieldLayoutId;
$block->siteId = $element->siteId;
$block->siteId = $element->siteId ?? Craft::$app->getSites()->getCurrentSite()->id;
$value[] = $block;
}
}
Expand Down Expand Up @@ -241,6 +239,9 @@ private function _getFieldOptionsForConfigurator(): array
];
}

// Sort them by name
ArrayHelper::multisort($fieldTypes, 'name');

Craft::$app->getView()->setNamespace($originalNamespace);

return $fieldTypes;
Expand All @@ -261,7 +262,6 @@ private function _getBlockTypeInfoForInput($matrixField, ElementInterface $eleme
$block = new MatrixBlock();
$block->fieldId = $matrixField->id;
$block->typeId = $blockType->id;
$block->fieldLayoutId = $blockType->fieldLayoutId;

if ($element) {
$block->setOwner($element);
Expand Down

0 comments on commit 635e591

Please sign in to comment.