bug fixes

This commit is contained in:
Dennis Eichhorn 2023-12-08 21:52:32 +00:00
parent 2004833058
commit 95af17ec60
4 changed files with 25 additions and 22 deletions

View File

@ -17,7 +17,6 @@ namespace Modules\Attribute\Controller;
use Modules\Attribute\Models\Attribute;
use Modules\Attribute\Models\AttributeType;
use Modules\Attribute\Models\AttributeValue;
use Modules\Attribute\Models\NullAttributeType;
use Modules\Attribute\Models\NullAttributeValue;
use phpOMS\Localization\BaseStringL11n;
use phpOMS\Localization\ISO639x1Enum;
@ -359,7 +358,7 @@ trait ApiAttributeTraitController
*
* @return BaseStringL11n
*
* @todo: consider to move all these FromRequest functions to the attribute module since they are the same in every module!
* @todo consider to move all these FromRequest functions to the attribute module since they are the same in every module!
*
* @since 1.0.0
*/
@ -380,14 +379,15 @@ trait ApiAttributeTraitController
*
* @return array<string, bool>
*
* @todo: implement
*
* @since 1.0.0
*/
private function validateAttributeTypeL11nUpdate(RequestAbstract $request) : array
{
$val = [];
if (($val['id'] = !$request->hasData('id'))) {
if (($val['id'] = !$request->hasData('id'))
|| ($val['title'] = !$request->hasData('title'))
|| ($val['language'] = $request->hasData('language') && !ISO639x1Enum::isValidValue($request->getDataString('language')))
) {
return $val;
}
@ -401,7 +401,7 @@ trait ApiAttributeTraitController
*
* @return array<string, bool>
*
* @todo: implement
* @todo Implement API validation function
*
* @since 1.0.0
*/
@ -423,7 +423,7 @@ trait ApiAttributeTraitController
*
* @return AttributeType
*
* @todo: implement
* @todo Implement API update
*
* @since 1.0.0
*/
@ -444,7 +444,7 @@ trait ApiAttributeTraitController
*
* @return array<string, bool>
*
* @todo: implement
* @todo Implement API validation function
*
* @since 1.0.0
*/
@ -485,7 +485,7 @@ trait ApiAttributeTraitController
*
* @return AttributeValue
*
* @todo: implement
* @todo Implement API update
*
* @since 1.0.0
*/
@ -504,7 +504,7 @@ trait ApiAttributeTraitController
*
* @return array<string, bool>
*
* @todo: implement
* @todo Implement API validation function
*
* @since 1.0.0
*/
@ -527,7 +527,7 @@ trait ApiAttributeTraitController
*
* @return array<string, bool>
*
* @todo: implement
* @todo Implement API validation function
*
* @since 1.0.0
*/
@ -549,7 +549,7 @@ trait ApiAttributeTraitController
*
* @return BaseStringL11n
*
* @todo: implement
* @todo Implement API update
*
* @since 1.0.0
*/
@ -570,14 +570,15 @@ trait ApiAttributeTraitController
*
* @return array<string, bool>
*
* @todo: implement
*
* @since 1.0.0
*/
private function validateAttributeValueL11nUpdate(RequestAbstract $request) : array
{
$val = [];
if (($val['id'] = !$request->hasData('id'))) {
if (($val['id'] = !$request->hasData('id'))
|| ($val['title'] = !$request->hasData('title'))
|| ($val['language'] = $request->hasData('language') && !ISO639x1Enum::isValidValue($request->getDataString('language')))
) {
return $val;
}
@ -591,7 +592,7 @@ trait ApiAttributeTraitController
*
* @return array<string, bool>
*
* @todo: implement
* @todo Implement API validation function
*
* @since 1.0.0
*/

View File

@ -16,6 +16,7 @@ namespace Modules\Attribute\Controller;
use phpOMS\Localization\BaseStringL11n;
use phpOMS\Localization\BaseStringL11nType;
use phpOMS\Localization\ISO639x1Enum;
use phpOMS\Localization\NullBaseStringL11nType;
use phpOMS\Message\RequestAbstract;
@ -81,7 +82,7 @@ trait ApiLocalizationTraitController
*
* @return BaseStringL11n
*
* @todo: consider to move all these FromRequest functions to the attribute module since they are the same in every module!
* @todo consider to move all these FromRequest functions to the attribute module since they are the same in every module!
*
* @since 1.0.0
*/
@ -102,14 +103,15 @@ trait ApiLocalizationTraitController
*
* @return array<string, bool>
*
* @todo: implement
*
* @since 1.0.0
*/
private function validateL11nUpdate(RequestAbstract $request) : array
{
$val = [];
if (($val['id'] = !$request->hasData('id'))) {
if (($val['id'] = !$request->hasData('id'))
|| ($val['content'] = !$request->hasData('content'))
|| ($val['language'] = $request->hasData('language') && !ISO639x1Enum::isValidValue($request->getDataString('language')))
) {
return $val;
}

View File

@ -1,6 +1,6 @@
# Individual Contributor License Agreement ("CLA") 1.0
Thank you for your interest in Karaka-Management (the "Company"). In order to clarify the intellectual property license granted with Contributions from any person or entity, the Company must provide a Contributor License Agreement ("CLA") on file that has been made available to each Contributor. This license is for your protection as a Contributor as well as the protection of the Company and its users; it does not change your rights to use your own Contributions for any other purpose.
Thank you for your interest in Jingga e. K. (the "Company"). In order to clarify the intellectual property license granted with Contributions from any person or entity, the Company must provide a Contributor License Agreement ("CLA") on file that has been made available to each Contributor. This license is for your protection as a Contributor as well as the protection of the Company and its users; it does not change your rights to use your own Contributions for any other purpose.
By contributing to the Company You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the Company. In return, the Company shall not use Your Contributions in a way that is contrary to the public benefit or inconsistent with its bylaws in effect at the time of the Contribution. Except for the license granted herein to the Company and recipients of software distributed by the Company, You reserve all right, title, and interest in and to Your Contributions.

View File

@ -50,7 +50,7 @@ $l11n = $this->data['defaultlocalization'] ?? new NullLocalization();
</select>
</div>
<!-- @todo: implement
<!-- @todo implement
<div class="form-group">
<label for="iAttributesUnit"><?= $this->getHtml('Unit', 'Attribute', 'Backend'); ?></label>
<select id="iAttributesUnit" name="unit" data-tpl-text="/unit" data-tpl-value="/unit">