供应商/ magento /中的类名“无效”


9

我正在尝试使用重新编译

php bin / magento安装程序:di:compile

但是,当我运行此命令时,我得到:

致命错误:无法在第9行的/var/www/html/magento/vendor/magento/module-sales/Controller/Adminhtml/Order/Invoice/Void.php中保留'Void'作为类名

我正在运行PHP 7.1.0-alpha。

Answers:



18

解决方法如下:

  1. 编辑vendor/magento/module-sales/etc/webapi.xml第112行:

    - <route url="/V1/invoices/:id/void" method="POST">
    + <route url="/V1/invoices/:id/voidInvoice" method="POST">
  2. 编辑vendor/magento/module-sales/Block/Adminhtml/Order/Invoice/View.php第242行:

    - return $this->getUrl('sales/*/void', ['invoice_id' => $this->getInvoice()->getId()]);
    + return $this->getUrl('sales/*/voidInvoice', ['invoice_id' => $this->getInvoice()->getId()]);
  3. 编辑vendor/magento/module-sales/Block/Adminhtml/Order/Creditmemo/View.php第183行:

    - return $this->getUrl('sales/*/void', ['creditmemo_id' => $this->getCreditmemo()->getId()]);
    + return $this->getUrl('sales/*/voidCreditmemo', ['creditmemo_id' => $this->getCreditmemo()->getId()]);
  4. 编辑vendor/magento/module-sales/Controller/Adminhtml/Order/Invoice/Void.php第9行:

    - class Void extends \Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoice\View
    + class VoidInvoice extends \Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoice\View
  5. 编辑vendor/magento/module-sales/Controller/Adminhtml/Order/Creditmemo/Void.php第10行:

    - class Void extends \Magento\Backend\App\Action
    + class VoidCreditmemo extends \Magento\Backend\App\Action
  6. 改名

    vendor/magento/module-sales/Controller/Adminhtml/Order/Creditmemo/Void.php

    vendor/magento/module-sales/Controller/Adminhtml/Order/Creditmemo/VoidCreditmemo.php

  7. 改名

    vendor/magento/module-sales/Controller/Adminhtml/Order/Invoice/Void.php

    vendor/magento/module-sales/Controller/Adminhtml/Order/Invoice/VoidInvoice.php

取自https://mage2.pro/t/topic/2433/2


先生,非常欢迎您
Konstantin Gerasimov

在Magento企业MV供应商/的magento /模块奖励/型号/动作/贷记通知单/ Void.php供应商/的magento /模块奖励/型号/动作/贷记通知单/ VoidCreditmemo.php在第8行变化类空隙类VoidCreditmemo
marcinsdance

@ KonstantinGerasimov,M230是否有可用的补丁程序?
拉维·杜达拉

2

与其修改核心的magento供应商文件来解决问题,不如使用正确的php版本。根据您所使用的内容,为特定的php bin位置设置BASH配置应该足够容易。


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.