Projekt

Allgemein

Profil

GX-Bug #54862 » APILinksFix.patch

Till Tepelmann, 18.01.2018 20:06

Unterschiede anzeigen:

src/GXMainComponents/Controllers/Api/HttpApiV2Controller.inc.php (revision )
222 222
			'addressId'       => 'addresses',
223 223
			'countryId'       => 'countries',
224 224
			'customerId'      => 'customers',
225
			'manufacturerId'  => 'manufacturers',
225 226
			'ordersId'        => 'orders',
227
			'statusId'        => 'customer_groups',
226 228
			'taxClassId'      => 'tax_classes',
227 229
			'taxZoneId'       => 'tax_zones',
230
			'vpeId'           => 'vpe',
228 231
			'zoneId'          => 'zones'
229 232
		];
230
		
233

  
231 234
		// If $response array is associative then converted to sequential array. 
232 235
		$revertBackToAssociative = false;
233 236
		if(key($response) !== 0 && !is_array($response[0]))
......
243 246
			
244 247
			foreach($map as $key => $resource)
245 248
			{
246
				if(array_key_exists($key, $item) && $item[$key] !== null)
249
				if(array_key_exists($key, $item) && $item[$key] !== null && (!empty($item[$key]) || $resource == 'customer_groups'))
247 250
				{
248 251
					$links[str_replace('Id', '', $key)] = GM_HTTP_SERVER . $this->api->request->getRootUri() . '/v2/'
249 252
					                                      . $resource . '/' . $item[$key];
    (1-1/1)