这可能与问题#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,
]
);
}
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确实很感兴趣,但是在我认为应该解决该问题的方式(从前端或后端)之前,应该与@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中修复!
谢谢