crash backup
Some checks failed
Image optimization / general_image_workflow (push) Has been cancelled
CI / general_module_workflow_php (push) Has been cancelled
CI / general_module_workflow_js (push) Has been cancelled

This commit is contained in:
Dennis Eichhorn 2025-03-21 02:48:19 +00:00
parent 1849854ff1
commit c1388b7fe1
5 changed files with 20 additions and 19 deletions

View File

@ -243,7 +243,7 @@ final class ApiAttributeController extends Controller
->with('type')
->with('type/defaults')
->with('value')
->where('id', (int) $request->getData('id'))
->where('id', $request->getDataInt('id') ?? 0)
->execute();
$new = $this->updateAttributeFromRequest($request, clone $old);
@ -291,7 +291,7 @@ final class ApiAttributeController extends Controller
$itemAttribute = ItemAttributeMapper::get()
->with('type')
->where('id', (int) $request->getData('id'))
->where('id', $request->getDataInt('id') ?? 0)
->execute();
if ($itemAttribute->type->isRequired) {
@ -327,7 +327,7 @@ final class ApiAttributeController extends Controller
}
/** @var BaseStringL11n $old */
$old = ItemAttributeTypeL11nMapper::get()->where('id', (int) $request->getData('id'))->execute();
$old = ItemAttributeTypeL11nMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute();
$new = $this->updateAttributeTypeL11nFromRequest($request, clone $old);
$this->updateModel($request->header->account, $old, $new, ItemAttributeTypeL11nMapper::class, 'item_attribute_type_l11n', $request->getOrigin());
@ -357,7 +357,7 @@ final class ApiAttributeController extends Controller
}
/** @var BaseStringL11n $itemAttributeTypeL11n */
$itemAttributeTypeL11n = ItemAttributeTypeL11nMapper::get()->where('id', (int) $request->getData('id'))->execute();
$itemAttributeTypeL11n = ItemAttributeTypeL11nMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute();
$this->deleteModel($request->header->account, $itemAttributeTypeL11n, ItemAttributeTypeL11nMapper::class, 'item_attribute_type_l11n', $request->getOrigin());
$this->createStandardDeleteResponse($request, $response, $itemAttributeTypeL11n);
}
@ -385,7 +385,7 @@ final class ApiAttributeController extends Controller
}
/** @var AttributeType $old */
$old = ItemAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('id'))->execute();
$old = ItemAttributeTypeMapper::get()->with('defaults')->where('id', $request->getDataInt('id') ?? 0)->execute();
$new = $this->updateAttributeTypeFromRequest($request, clone $old);
$this->updateModel($request->header->account, $old, $new, ItemAttributeTypeMapper::class, 'item_attribute_type', $request->getOrigin());
@ -417,7 +417,7 @@ final class ApiAttributeController extends Controller
}
/** @var AttributeType $itemAttributeType */
$itemAttributeType = ItemAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('id'))->execute();
$itemAttributeType = ItemAttributeTypeMapper::get()->with('defaults')->where('id', $request->getDataInt('id') ?? 0)->execute();
$this->deleteModel($request->header->account, $itemAttributeType, ItemAttributeTypeMapper::class, 'item_attribute_type', $request->getOrigin());
$this->createStandardDeleteResponse($request, $response, $itemAttributeType);
}
@ -445,7 +445,7 @@ final class ApiAttributeController extends Controller
}
/** @var AttributeValue $old */
$old = ItemAttributeValueMapper::get()->where('id', (int) $request->getData('id'))->execute();
$old = ItemAttributeValueMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute();
/** @var \Modules\Attribute\Models\Attribute $attr */
$attr = ItemAttributeMapper::get()
@ -485,7 +485,7 @@ final class ApiAttributeController extends Controller
// }
// /** @var \Modules\ItemManagement\Models\ItemAttributeValue $itemAttributeValue */
// $itemAttributeValue = ItemAttributeValueMapper::get()->where('id', (int) $request->getData('id'))->execute();
// $itemAttributeValue = ItemAttributeValueMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute();
// $this->deleteModel($request->header->account, $itemAttributeValue, ItemAttributeValueMapper::class, 'item_attribute_value', $request->getOrigin());
// $this->createStandardDeleteResponse($request, $response, $itemAttributeValue);
}
@ -513,7 +513,7 @@ final class ApiAttributeController extends Controller
}
/** @var BaseStringL11n $old */
$old = ItemAttributeValueL11nMapper::get()->where('id', (int) $request->getData('id'));
$old = ItemAttributeValueL11nMapper::get()->where('id', $request->getDataInt('id') ?? 0);
$new = $this->updateAttributeValueL11nFromRequest($request, clone $old);
$this->updateModel($request->header->account, $old, $new, ItemAttributeValueL11nMapper::class, 'item_attribute_value_l11n', $request->getOrigin());
@ -543,7 +543,7 @@ final class ApiAttributeController extends Controller
}
/** @var BaseStringL11n $itemAttributeValueL11n */
$itemAttributeValueL11n = ItemAttributeValueL11nMapper::get()->where('id', (int) $request->getData('id'))->execute();
$itemAttributeValueL11n = ItemAttributeValueL11nMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute();
$this->deleteModel($request->header->account, $itemAttributeValueL11n, ItemAttributeValueL11nMapper::class, 'item_attribute_value_l11n', $request->getOrigin());
$this->createStandardDeleteResponse($request, $response, $itemAttributeValueL11n);
}

View File

@ -580,7 +580,7 @@ final class ApiController extends Controller
}
$old = ItemL11nMapper::get()
->where('id', (int) $request->getData('id'))
->where('id', $request->getDataInt('id') ?? 0)
->execute();
$new = $this->updateItemL11nFromRequest($request, clone $old);

View File

@ -107,7 +107,7 @@ final class BackendController extends Controller
->with('l11n')
->with('defaults')
->with('defaults/l11n')
->where('id', (int) $request->getData('id'))
->where('id', $request->getDataInt('id') ?? 0)
->where('l11n/language', $response->header->l11n->language)
->where('defaults/l11n/language', [$response->header->l11n->language, null])
->execute();
@ -142,7 +142,7 @@ final class BackendController extends Controller
$view->attribute = ItemAttributeValueMapper::get()
->with('l11n')
->where('id', (int) $request->getData('id'))
->where('id', $request->getDataInt('id') ?? 0)
->where('l11n/language', [$response->header->l11n->language, null])
->execute();
@ -438,7 +438,7 @@ final class BackendController extends Controller
->with('attributes/type/l11n')
->with('attributes/value')
->with('attributes/value/l11n')
->where('id', (int) $request->getData('id'))
->where('id', $request->getDataInt('id') ?? 0)
->where('l11n/language', $response->header->l11n->language)
->where('l11n/type/title', ['name1', 'name2'], 'IN')
->where('attributes/type/l11n/language', $response->header->l11n->language)
@ -863,7 +863,7 @@ final class BackendController extends Controller
$view->data['type'] = MaterialTypeMapper::get()
->with('l11n')
->where('id', (int) $request->getData('id'))
->where('id', $request->getDataInt('id') ?? 0)
->where('l11n/language', $response->header->l11n->language)
->execute();

View File

@ -37,10 +37,10 @@ $item = $this->data['item'] ?? new NullItem();
$isNew = $item->id === 0;
$logs = $this->data['logs'] ?? [];
$itemImage = $this->getData('itemImage') ?? new NullMedia();
$itemImage = $this->data['itemImage'] ?? new NullMedia();
$allInvoices = $this->data['allInvoices'] ?? [];
$topCustomers = $this->getData('topCustomers') ?? [[], []];
$topCustomers = $this->data['topCustomers'] ?? [[], []];
$languages = ISO639Enum::getConstants();
$regions = RegionEnum::getConstants();
@ -145,7 +145,7 @@ echo $this->data['nav']->render();
<section class="portlet hl-4">
<div class="portlet-body">
<textarea class="undecorated"></textarea>
<textarea class="undecorated" aria-label="Info"></textarea>
</div>
</section>
<?php endif; ?>
@ -684,7 +684,7 @@ echo $this->data['nav']->render();
<div class="portlet-body">
<input id="iPriceId" class="vh" name="id" type="number" data-tpl-text="/id" data-tpl-value="/id">
<input id="iPriceItemId" class="vh" name="item" type="text" value="<?= $item->id; ?>">
<input id="iPriceItemType" class="vh" name="type" type="text" value="<?= PriceType::SALES; ?>">
<input id="iPriceType" class="vh" name="type" type="text" value="<?= PriceType::SALES; ?>">
<div class="form-group">
<label for="iPriceName"><?= $this->getHtml('Name'); ?></label>

View File

@ -25,6 +25,7 @@
"Editor": "*",
"Media": "*",
"Tag": "*",
"Workflow": "*",
"Admin": "*"
},
"load": [