GX-Bug #60995 » refs_#60992_manufactures_are_now_created_even_if_urls_object_is_missing.patch
src/GXMainComponents/Controllers/Api/v2/ManufacturersApiV2Controller.inc.php (date 1549297760000) | ||
---|---|---|
329 | 329 |
$manufacturerData = json_decode($manufacturerJson, true); |
330 | 330 |
$manufacturer = $id ? $this->readService->getById(new IdType($id)) : $this->writeService->createManufacturer(); |
331 | 331 |
|
332 |
$manufacturerData['image'] = $manufacturerData['image'] ? $manufacturerData['image'] : ''; |
|
333 |
|
|
332 | 334 |
$manufacturer->setName(new StringType($manufacturerData['name'])) |
333 | 335 |
->setImage(new StringType($manufacturerData['image'])); |
334 | 336 |
|
... | ... | |
338 | 340 |
$manufacturer->setUrl(new StringType(''), new LanguageCode(new StringType('de'))); |
339 | 341 |
$manufacturer->setUrl(new StringType(''), new LanguageCode(new StringType('en'))); |
340 | 342 |
} |
341 |
|
|
342 |
foreach($manufacturerData['urls'] as $languageCode => $url) |
|
343 |
{ |
|
344 |
$manufacturer->setUrl(new StringType($url), new LanguageCode(new StringType($languageCode))); |
|
343 |
else |
|
344 |
{ |
|
345 |
foreach($manufacturerData['urls'] as $languageCode => $url) |
|
346 |
{ |
|
347 |
$manufacturer->setUrl(new StringType($url), new LanguageCode(new StringType($languageCode))); |
|
348 |
} |
|
345 | 349 |
} |
350 |
|
|
346 | 351 |
|
347 | 352 |
return $manufacturer; |
348 | 353 |
} |
docs/REST/swagger/definitions/manufacturers/GXManufacturer.yml (date 1549299088000) | ||
---|---|---|
3 | 3 |
type: object |
4 | 4 |
required: |
5 | 5 |
- name |
6 |
- image |
|
7 |
- dateAdded |
|
8 |
- lastModified |
|
9 |
- urls |
|
10 | 6 |
properties: |
11 | 7 |
id: |
12 | 8 |
type: integer |