BasketUpload: ignore Datafields, they get special

...treatment
This commit is contained in:
Thomas Gelf 2019-02-14 21:57:10 +01:00
parent 640da36c62
commit e961f0eb2a
2 changed files with 4 additions and 1 deletions

View File

@ -122,7 +122,9 @@ class BasketUploadForm extends DirectorObjectForm
$basket = $this->object();
foreach ($this->upload as $type => $content) {
$basket->addObjects($type, array_keys((array) $content));
if ($type !== 'Datafield') {
$basket->addObjects($type, array_keys((array) $content));
}
}
if ($basket->isEmpty()) {
$this->addError($this->translate("It's not allowed to store an empty basket"));

View File

@ -61,6 +61,7 @@ class Basket extends DbObject implements ExportInterface
protected function onLoadFromDb()
{
$this->chosenObjects = (array) Json::decode($this->get('objects'));
unset($this->chosenObjects['Datafield']); // Might be in old baskets
}
public function getUniqueIdentifier()