Open junnhouse opened 2 years ago
Please open file Sp\Orderattachment\view\adminhtml\layout\sales_order_view.xml
. Replace with the below code
<referenceBlock name="sales_order_tabs">
<block class="Sp\Orderattachment\Block\Adminhtml\Order\View\Tab\Attachments" name="sales.order.view.tab.attachment" as="sp_attachments" template="order/view/tab/attachments.phtml"/>
<action method="addTab">
<argument name="name" xsi:type="string">sp_attachments</argument>
<argument name="block" xsi:type="string">sp_attachments</argument>
</action>
</referenceBlock>
Replace file app/code/Sp/Orderattachment/view/adminhtml/layout/sales_order_view.xml content by:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Sp_Orderattachment::css/orderattachment.css"/>
</head>
<update handle="editor"/>
<body>
<referenceContainer name="left">
<referenceBlock name="sales_order_tabs">
<block class="Sp\Orderattachment\Block\Adminhtml\Order\View\Tab\Attachments" name="sales.order.view.tab.attachment" as="sp_attachments" template="order/view/tab/attachments.phtml"/>
<action method="addTab">
<argument name="name" xsi:type="string">sp_attachments</argument>
<argument name="block" xsi:type="string">sp_attachments</argument>
</action>
</referenceBlock>
</referenceContainer>
</body>
</page>
than run php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f --area adminhtml
@sandiegobr It solved the issue. Thank you!
Solution for blank page on admin order view page:
Replace file app/code/Sp/Orderattachment/view/adminhtml/layout/sales_order_view.xml content by:
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Sp_Orderattachment::css/orderattachment.css"/> </head> <update handle="editor"/> <body> <referenceContainer name="left"> <referenceBlock name="sales_order_tabs"> <block class="Sp\Orderattachment\Block\Adminhtml\Order\View\Tab\Attachments" name="sales.order.view.tab.attachment" as="sp_attachments" template="order/view/tab/attachments.phtml"/> <action method="addTab"> <argument name="name" xsi:type="string">sp_attachments</argument> <argument name="block" xsi:type="string">sp_attachments</argument> </action> </referenceBlock> </referenceContainer> </body> </page>
than run php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f --area adminhtml
Works for version Magento 2.4.3-p1
Thanks @sandiegobr. Scary how easily Magento 2 breaks without any clues anywhere as to why.
Solution for blank page on admin order view page:
Replace file app/code/Sp/Orderattachment/view/adminhtml/layout/sales_order_view.xml content by:
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Sp_Orderattachment::css/orderattachment.css"/> </head> <update handle="editor"/> <body> <referenceContainer name="left"> <referenceBlock name="sales_order_tabs"> <block class="Sp\Orderattachment\Block\Adminhtml\Order\View\Tab\Attachments" name="sales.order.view.tab.attachment" as="sp_attachments" template="order/view/tab/attachments.phtml"/> <action method="addTab"> <argument name="name" xsi:type="string">sp_attachments</argument> <argument name="block" xsi:type="string">sp_attachments</argument> </action> </referenceBlock> </referenceContainer> </body> </page>
than run php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f --area adminhtml
that's the right solution.
Thank you!
Please advise for you solution to make it display. Best Regards,