๋ฌธ์ # 6054์ ๊ด๋ จ์ด์์ ์ ์์ต๋๋ค.
๋ฒ์ 1.7.3
์์ฑ ํจ๋ฐ๋ฆฌ์ ์์ฑ์ ์ถ๊ฐ ํ ๋ sort_order์ ์ํด ์์คํ ์์> 20 ๋ฒ์งธ ์์ฑ ๊ทธ๋ฃน์์๋ ์์ฑ์ด ์คํจํ๊ณ javascript ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
attributes.js:109 Uncaught TypeError: Cannot read property 'sort_order' of undefined
at child.<anonymous> (attributes.js:109)
at underscore.js:380
at Function._.map._.collect (underscore.js:172)
at Function._.sortBy (underscore.js:376)
at child.<anonymous> (attributes.js:108)
at Array.<anonymous> (jquery-1.10.2.js:3204)
at fire (jquery-1.10.2.js:3048)
at Object.add [as done] (jquery-1.10.2.js:3094)
at Array.<anonymous> (jquery-1.10.2.js:3203)
at Function.each (jquery-1.10.2.js:657)
์๋ก์:
๋ค์์ pim_catalog_attribute_group์ ๋ฐ์ดํฐ ๋คํ์ ๋๋ค.
๊ฐ์ฌ!
๋ค์ ํ์ผ์์ FETCH_LIMIT๋ฅผ ๋ณ๊ฒฝํ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์ง๋ง ์์คํ ์ ๋ค๋ฅธ ์๋ฏธ๊ฐ ์๋์ง ํ์คํ์ง ์์ผ๋ฏ๋ก ํ ์์ฒญ์ ์์ฑํ๊ณ ์ถ์ง ์์ต๋๋ค. https://github.com/akeneo/pim-community-dev/blob/494b2c108427556e2818a3c2f18ede40b585c144/src/Akeneo/Component/StorageUtils/Repository/SearchableRepositoryInterface.php
์๋ ํ์ธ์ @adamrandazzo , ํผ๋๋ฐฑ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค. ์ ํฌ ์ง์ํ์ด์ด๋ฅผ ์ดํด๋ณด๊ณ ๊ณ์ ์ ๋ฐ์ดํธ ํ ๊ฒ์ ๋๋ค. :)
์๋
ํ์ธ์.
์ฐ๋ฆฌ๋ ๊ฐ์ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
๋ฌธ์ ๋ Pim \ Bundle \ EnrichBundle \ Controller \ Rest \ AttributeGroupC ontroller : 76์ ์์ต๋๋ค.
if (empty($options)) {
$options = $request->request->get(
'options',
[
'limit' => SearchableRepositoryInterface::FETCH_LIMIT,
'locale' => null,
]
);
}
์๋ฐ ์คํฌ๋ฆฝํธ ์ ํ๋ฆฌ์ผ์ด์
์์ด ์ปจํธ๋กค๋ฌ์ ์์ฑ ๊ทธ๋ฃน์ ์์ฒญํฉ๋๋ค.
๋ชจ๋ ์์ฑ ๊ทธ๋ฃน์ ๊ฒ์ ํ ๊ฒ์ผ๋ก ์์ํ์ง๋ง 'limit'๋งค๊ฐ ๋ณ์๊ฐ ์ค์ ๋์ง ์์ ๊ฒฝ์ฐ ์ปจํธ๋กค๋ฌ๋ ๊ฒฐ๊ณผ๋ฅผ 20 ๊ฐ ํญ๋ชฉ์ผ๋ก ์ ํํฉ๋๋ค.
๋๋ ์๋ฐ ์คํฌ๋ฆฝํธ ์์ฉ ํ๋ก๊ทธ๋จ์ด ๊ฒฐ๊ณผ๊ฐ ํ์ด์ง ๋งค๊น๋๊ณ ๋ชจ๋ ์์ฑ ๊ทธ๋ฃน์ ๊ฒ์ํ๊ธฐ ์ํด ์ฌ๋ฌ http ํธ์ถ์ํด์ผํ๋ค๋ ๊ฒ์ ์์์ผํ๋ค๊ณ ์๊ฐํฉ๋๋ค.
์ด ๋ฒ๊ทธ์ ์์ ์ ๊ธฐ๋ค๋ฆฌ๋ ๋์ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์ ์ฉํ์ฌ AttributeGroupController๋ฅผ ํ์ฅํ๊ณ ๊ต์ฒดํ์ต๋๋ค.
<?php
namespace Idrolab\Bundle\BugfixBundle\Enrich\Controller\Rest;
use Symfony\Component\HttpFoundation\Request;
use Pim\Bundle\EnrichBundle\Controller\Rest\AttributeGroupController as BaseAttributeGroupController;
class AttributeGroupController extends BaseAttributeGroupController
{
public function indexAction(Request $request)
{
// In this way I avoid it will set the default limit of 20 items because the js app expects all items
$options = $request->request->get('options', [
// 'limit' => SearchableRepositoryInterface::FETCH_LIMIT,
'locale' => null,
]);
$request->request->set('options', $options);
return parent::indexAction($request);
}
}
๋์์ด ๋๊ธธ ๋ฐ๋๋๋ค.
์๋ ํ์ธ์ @adamrandazzo ๋ , ์๊ฒฌ์ ๋ณด๋ด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค.
์ ๋ @ danielsan80 ํ ๋ฆฌํ์คํธ์ ์ ๋ง ๊ด์ฌ์ด ์์ง๋ง, (ํ๋ก ํธ ์๋ ์ธก ๋๋ ๋ฐฑ์๋ ์ธก์์) ๊ณ ์ณ์ผ ํ ๋ฐฉ๋ฒ์ ์๊ฐํ๊ธฐ ์ ์ @SamirBoulil๊ณผ ๋ ผ์ํด์ผํฉ๋๋ค.
๋ฌธ์ ์ธ์ฌ,
@mickaelandrieu ๋ญ๊ฐ ๋ด๊ฐ ์ด๋ฏธ PIM-6196 ์ด๋๊ฐ์์ ์์ ํ๊ณ https://github.com/akeneo/pim-community-dev/pull/5957
์ด ๋ฌธ์ ๋ SLA PIM-6416์์ ์ฒ๋ฆฌํด์ผํฉ๋๋ค. ๋๋ ์ด๊ฒ์ ์์ ํ๊ธฐ ์ํด PR์ ๋ง๋ค์์ง ๋ง @ a2xchip ์ ์ด๋ฏธ ๋ค๋ฅธ PR์์ ์์ ํ์ต๋๋ค. ๋๋ ๋์ ๊ฒ์ ๋ซ์๋ค.
@LaurentPetard , @ a2xchip ์ค๋ช ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค. ํ ์์ฒญ์ ๋ฌธ์ ์ ์ฐ๊ฒฐ ํ ๋ค์ :)
์ฐ๊ฒฐ๋ PR์ด ๋ณํฉ ๋์๊ธฐ ๋๋ฌธ์์ด ๋ฌธ์ ๋ฅผ ๋ซ์ต๋๋ค!
์ด๊ฒ์ด ๊ทํ์ ์๊ตฌ์ ๋ง์ง ์์ผ๋ฉด ๋ค์ ์ด์ด ์ฃผ์๊ธฐ ๋ฐ๋๋๋ค;)
์๋ถ!
ํผ์๋ฅด
์๋
ํ์ธ์ @adamrandazzo ๋ ,์ด ๋ฌธ์ ๋ ๊ธ์์ผ์ ์ถ์ ๋ 1.7.5์์ ์์ ๋์์ต๋๋ค!
๊ฐ์ฌ
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์๋ ํ์ธ์ @adamrandazzo ๋ ,์ด ๋ฌธ์ ๋ ๊ธ์์ผ์ ์ถ์ ๋ 1.7.5์์ ์์ ๋์์ต๋๋ค!
๊ฐ์ฌ