];
}
- $this->objectAction = new BoxAction([], 'create', ['data' => array_merge($this->additionalFields, [
+ $data = [
'name' => $this->name,
- 'objectTypeID' => $this->boxControllerID,
'packageID' => 1,
'isMultilingual' => $this->isMultilingual,
'boxType' => $this->boxType,
'linkPageObjectID' => ($this->linkPageObjectID ?: 0),
'externalURL' => $this->externalURL,
'identifier' => ''
- ]), 'content' => $content, 'pageIDs' => $this->pageIDs ]);
+ ];
+ if ($this->boxControllerID) {
+ $data['objectTypeID'] = $this->boxControllerID;
+ }
+
+ $this->objectAction = new BoxAction([], 'create', ['data' => array_merge($this->additionalFields, $data), 'content' => $content, 'pageIDs' => $this->pageIDs ]);
$box = $this->objectAction->executeAction()['returnValues'];
// set generic box identifier
];
}
- $this->objectAction = new BoxAction([$this->box], 'update', ['data' => array_merge($this->additionalFields, [
+ $data = [
'name' => $this->name,
- 'objectTypeID' => $this->boxControllerID,
'isMultilingual' => $this->isMultilingual,
'boxType' => $this->boxType,
'position' => $this->position,
'linkPageID' => $this->linkPageID,
'linkPageObjectID' => ($this->linkPageObjectID ?: 0),
'externalURL' => $this->externalURL
- ]), 'content' => $content, 'pageIDs' => $this->pageIDs]);
+ ];
+ if ($this->boxControllerID) {
+ $data['objectTypeID'] = $this->boxControllerID;
+ }
+
+ $this->objectAction = new BoxAction([$this->box], 'update', ['data' => array_merge($this->additionalFields, $data), 'content' => $content, 'pageIDs' => $this->pageIDs]);
$this->objectAction->executeAction();
if ($this->boxController && $this->boxController->getProcessor() instanceof IConditionBoxController) {