Pim-community-dev: 20番目を超えるグループのファミリに属性を追加する

作成日 2017年04月20日  ·  9コメント  ·  ソース: akeneo/pim-community-dev

これは問題#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)

例として:

screen shot 2017-04-20 at 8 25 05 am

これがpim_catalog_attribute_groupからのデータダンプです

screen shot 2017-04-20 at 8 31 44 am

ありがとう!

bug has-PR

最も参考になるコメント

こんにちは@adamrandazzo 、この問題は金曜日にリリースされた1.7.5で修正されています!
ありがとう

全てのコメント9件

次のファイルの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,
        ]
    );
}

javascriptアプリケーションは、このコントローラーへの属性グループを要求します。
すべての属性グループを取得することを想定していますが、「limit」パラメーターが設定されていない場合、コントローラーは結果を20項目に制限します。

javascriptアプリケーションは、結果がページ付けされていることを認識し、すべての属性グループを取得するためにいくつかの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に本当に興味がありますが、それを修正する方法(フロントエンド側またはバックエンド側から)について考える前に、

よろしく、

@mickaelandrieu何かが私を覚えています私はすでにPIM-6196のどこかでそれを修正していましたhttps://github.com/akeneo/pim-community-dev/pull/5957

この問題は、SLAPIM-6416で処理する必要があります。 これを修正するためのPRも作成しましたが、 @ a2xchipはすでに別のPRで修正していました。 私は私のものを閉じました。

@ LaurentPetard@ a2xchip説明をありがとう、プルリクエストを問題にリンクします:)

リンクされたPRがマージされたので、私はこの問題を閉じます!
これがあなたのニーズに合わない場合は、それを再び開いてください;)

よろしく!
ピエール

こんにちは@adamrandazzo 、この問題は金曜日にリリースされた1.7.5で修正されています!
ありがとう

このページは役に立ちましたか?
0 / 5 - 0 評価