bug fixes

This commit is contained in:
Dennis Eichhorn 2024-05-12 00:03:34 +00:00
parent 8b4715412c
commit 29f0411b89
9 changed files with 20 additions and 36 deletions

View File

@ -9,5 +9,5 @@ jobs:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Thank you for createing this issue. We will check it as soon as possible.'
issue-message: 'Thank you for creating this issue. We will check it as soon as possible.'
pr-message: 'Thank you for your pull request. We will check it as soon as possible.'

View File

@ -1,18 +1,4 @@
[
{
"type": "type",
"name": "vehicle_profile_image",
"l11n": [
{
"title": "Profile image",
"lang": "en"
},
{
"title": "Profilbild",
"lang": "de"
}
]
},
{
"type": "collection",
"create_directory": true,

View File

@ -66,7 +66,7 @@ final class ApiDriverAttributeController extends Controller
->where('id', (int) $request->getData('type'))
->execute();
if (!$type->repeatable) {
if (!$type->isRepeatable) {
$attr = DriverAttributeMapper::count()
->with('type')
->where('type/id', $type->id)

View File

@ -268,7 +268,7 @@ final class ApiDriverController extends Controller
pathSettings: PathSettings::FILE_PATH,
hasAccountRelation: false,
readContent: $request->getDataBool('parse_content') ?? false,
type: $request->getDataInt('type'),
tag: $request->getDataInt('tag'),
rel: $driver->id,
mapper: DriverMapper::class,
field: 'files'

View File

@ -66,7 +66,7 @@ final class ApiVehicleAttributeController extends Controller
->where('id', (int) $request->getData('type'))
->execute();
if (!$type->repeatable) {
if (!$type->isRepeatable) {
$attr = VehicleAttributeMapper::count()
->with('type')
->where('type/id', $type->id)

View File

@ -643,7 +643,7 @@ final class ApiVehicleController extends Controller
pathSettings: PathSettings::FILE_PATH,
hasAccountRelation: false,
readContent: $request->getDataBool('parse_content') ?? false,
type: $request->getDataInt('type'),
tag: $request->getDataInt('tag'),
rel: $vehicle->id,
mapper: VehicleMapper::class,
field: 'files'

View File

@ -32,8 +32,8 @@ use Modules\FleetManagement\Models\InspectionTypeMapper;
use Modules\FleetManagement\Models\VehicleMapper;
use Modules\FleetManagement\Models\VehicleTypeMapper;
use Modules\Media\Models\MediaMapper;
use Modules\Media\Models\MediaTypeMapper;
use Modules\Organization\Models\UnitMapper;
use Modules\Tag\Models\TagMapper;
use phpOMS\Contract\RenderableInterface;
use phpOMS\DataStorage\Database\Query\Builder;
use phpOMS\Message\RequestAbstract;
@ -595,7 +595,7 @@ final class BackendController extends Controller
->with('attributes/type/l11n')
->with('attributes/value/l11n')
->with('files')
->with('files/types')
->with('files/tags')
->with('type')
->with('type/l11n')
->with('fuelType')
@ -627,15 +627,14 @@ final class BackendController extends Controller
->on(VehicleMapper::HAS_MANY['files']['table'] . '.' . VehicleMapper::HAS_MANY['files']['self'], '=', VehicleMapper::TABLE . '.' . VehicleMapper::PRIMARYFIELD)
->leftJoin(MediaMapper::TABLE)
->on(VehicleMapper::HAS_MANY['files']['table'] . '.' . VehicleMapper::HAS_MANY['files']['external'], '=', MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD)
->leftJoin(MediaMapper::HAS_MANY['types']['table'])
->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['self'])
->leftJoin(MediaTypeMapper::TABLE)
->on(MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['external'], '=', MediaTypeMapper::TABLE . '.' . MediaTypeMapper::PRIMARYFIELD)
->leftJoin(MediaMapper::HAS_MANY['tags']['table'])
->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['tags']['table'] . '.' . MediaMapper::HAS_MANY['tags']['self'])
->leftJoin(TagMapper::TABLE)
->on(MediaMapper::HAS_MANY['tags']['table'] . '.' . MediaMapper::HAS_MANY['tags']['external'], '=', TagMapper::TABLE . '.' . TagMapper::PRIMARYFIELD)
->where(VehicleMapper::HAS_MANY['files']['self'], '=', $vehicle->id)
->where(MediaTypeMapper::TABLE . '.' . MediaTypeMapper::getColumnByMember('name'), '=', 'vehicle_profile_image');
->where(TagMapper::TABLE . '.' . TagMapper::getColumnByMember('name'), '=', 'profile_image');
$view->data['vehicleImage'] = MediaMapper::get()
->with('types')
->where('id', $results)
->limit(1)
->execute();
@ -688,7 +687,7 @@ final class BackendController extends Controller
->with('attributes/type/l11n')
->with('attributes/value/l11n')
->with('files')
->with('files/types')
->with('files/tags')
->where('id', (int) $request->getData('id'))
->where('attributes/type/l11n/language', $response->header->l11n->language)
->where('attributes/value/l11n/language', [$response->header->l11n->language, null])
@ -712,15 +711,14 @@ final class BackendController extends Controller
->on(DriverMapper::HAS_MANY['files']['table'] . '.' . DriverMapper::HAS_MANY['files']['self'], '=', DriverMapper::TABLE . '.' . DriverMapper::PRIMARYFIELD)
->leftJoin(MediaMapper::TABLE)
->on(DriverMapper::HAS_MANY['files']['table'] . '.' . DriverMapper::HAS_MANY['files']['external'], '=', MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD)
->leftJoin(MediaMapper::HAS_MANY['types']['table'])
->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['self'])
->leftJoin(MediaTypeMapper::TABLE)
->on(MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['external'], '=', MediaTypeMapper::TABLE . '.' . MediaTypeMapper::PRIMARYFIELD)
->leftJoin(MediaMapper::HAS_MANY['tags']['table'])
->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['tags']['table'] . '.' . MediaMapper::HAS_MANY['tags']['self'])
->leftJoin(TagMapper::TABLE)
->on(MediaMapper::HAS_MANY['tags']['table'] . '.' . MediaMapper::HAS_MANY['tags']['external'], '=', TagMapper::TABLE . '.' . TagMapper::PRIMARYFIELD)
->where(DriverMapper::HAS_MANY['files']['self'], '=', $driver->id)
->where(MediaTypeMapper::TABLE . '.' . MediaTypeMapper::getColumnByMember('name'), '=', 'driver_profile_image');
->where(TagMapper::TABLE . '.' . TagMapper::getColumnByMember('name'), '=', 'profile_image');
$view->data['driverImage'] = MediaMapper::get()
->with('types')
->where('id', $results)
->limit(1)
->execute();

View File

@ -42,7 +42,7 @@ final class DriverAttributeTypeMapper extends DataMapperFactory
'fleetmgmt_driver_attr_type_datatype' => ['name' => 'fleetmgmt_driver_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'],
'fleetmgmt_driver_attr_type_fields' => ['name' => 'fleetmgmt_driver_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
'fleetmgmt_driver_attr_type_custom' => ['name' => 'fleetmgmt_driver_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
'fleetmgmt_driver_attr_type_repeatable' => ['name' => 'fleetmgmt_driver_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'],
'fleetmgmt_driver_attr_type_repeatable' => ['name' => 'fleetmgmt_driver_attr_type_repeatable', 'type' => 'bool', 'internal' => 'isRepeatable'],
'fleetmgmt_driver_attr_type_internal' => ['name' => 'fleetmgmt_driver_attr_type_internal', 'type' => 'bool', 'internal' => 'isInternal'],
'fleetmgmt_driver_attr_type_pattern' => ['name' => 'fleetmgmt_driver_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
'fleetmgmt_driver_attr_type_required' => ['name' => 'fleetmgmt_driver_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],

View File

@ -42,7 +42,7 @@ final class VehicleAttributeTypeMapper extends DataMapperFactory
'fleetmgmt_vehicle_attr_type_datatype' => ['name' => 'fleetmgmt_vehicle_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'],
'fleetmgmt_vehicle_attr_type_fields' => ['name' => 'fleetmgmt_vehicle_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
'fleetmgmt_vehicle_attr_type_custom' => ['name' => 'fleetmgmt_vehicle_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
'fleetmgmt_vehicle_attr_type_repeatable' => ['name' => 'fleetmgmt_vehicle_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'],
'fleetmgmt_vehicle_attr_type_repeatable' => ['name' => 'fleetmgmt_vehicle_attr_type_repeatable', 'type' => 'bool', 'internal' => 'isRepeatable'],
'fleetmgmt_vehicle_attr_type_internal' => ['name' => 'fleetmgmt_vehicle_attr_type_internal', 'type' => 'bool', 'internal' => 'isInternal'],
'fleetmgmt_vehicle_attr_type_pattern' => ['name' => 'fleetmgmt_vehicle_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
'fleetmgmt_vehicle_attr_type_required' => ['name' => 'fleetmgmt_vehicle_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],