【问题标题】:Uncaught TypeError: Cannot read property 'select' of null in magento 2.1未捕获的类型错误:无法在 magento 2.1 中读取 null 的属性“选择”
【发布时间】:2017-02-14 08:51:23
【问题描述】:

我遇到了 Magento 2.1 自定义模块的问题。在加载 Magento 管理页面时,我在控制台中遇到以下错误。

configure.js:76 Uncaught TypeError: Cannot read property 'select' of null

【问题讨论】:

  • 可能是第 76 行的错误 - 可能使用浏览器开发工具进行调查
  • 嗨@JaromandaX configure.js 错误?我怎样才能编辑相同的?我刚刚写了一个布局文件并在加载它时显示错误。你能描述同样的原因吗?
  • 没有。您没有显示要检查的代码
  • 投票结束,因为它需要minimal reproducible example

标签: javascript php jquery magento2


【解决方案1】:

你覆盖了吗:

vendor/magento/module-catalog/view/adminhtml/templates/catalog/product/composite/configure.phtml

似乎这个文件正试图从那里获取值:

vendor/magento/module-catalog/view/adminhtml/web/catalog/product/composite/configure.js

this.blockMsg                   = $('product_composite_configure_messages');
this.blockMsgError              = this.blockMsg.select('.message.error div')[0];

【讨论】:

  • 嗨 @Tim Zwinkels,我在 2 个 phtml 文件中包含以下脚本 <script> require([ "prototype","Magento_Sales/order/create/form","Magento_Catalog/catalog/product/composite/configure","domReady!" ], function(){ order.sidebarHide(); if (window.productConfigure) { productConfigure.addListType('product_to_add', { urlFetch: '<?php echo $block->getUrl('adminhtml/create/configureProductToAdd') ?>' }); productConfigure.addListType('items', { urlFetch: '<?php echo $block->getUrl('adminhtml/create/configureQuoteItems') ?>' });}}); </script>
猜你喜欢
  • 2022-01-10
  • 1970-01-01
  • 1970-01-01
  • 2021-11-18
  • 1970-01-01
  • 2022-01-19
  • 2021-12-01
  • 2022-07-02
相关资源
最近更新 更多