0

Here is my layout:

<?xml version="1.0"?>
<layout>    
    <adminhtml_sales_order_view>
        <reference name="sales_order_tabs">
            <action method="addTab">
                <name>order_view_tab_avans</name>
                 <block>ordersedit/adminhtml_order_view_tab_avans</block>
            </action>
        </reference>
    </adminhtml_sales_order_view>
</layout>

Here is my /app/code/community/MageWorx/OrdersEdit/Block/Adminhtml/Order/View/Tab/Avans.php:

<?php
class MageWorx_OrdersEdit_Block_Adminhtml_Order_View_Tab_Avans
    extends Mage_Adminhtml_Block_Template
    implements Mage_Adminhtml_Block_Widget_Tab_Interface
{    
    //change _constuct to _construct()
    public function _construct()
    {
        parent::_construct();
        $this->setTemplate('ordersedit/order/view/tab/avans.phtml');
    }

    public function getTabLabel() {
        return $this->__('Fraud Detection');
    }

    public function getTabTitle() {
        return $this->__('Fraud Detection');
    }

    public function canShowTab() {
        return true;
    }

    public function isHidden() {
        return false;
    }

    public function getOrder(){
        return Mage::registry('current_order');
    }
} 
?>

Here is my /app/design/adminhtml/default/default/template/mageworx/ordersedit/order/view/tab/avans.phtml:

<div class="entry-edit">
    <div class="entry-edit-head">
        <h4><?php echo $this->__('Hello its me!'); ?></h4>
    </div>
    <div class="fieldset fieldset-wide">
        the content you want to show
    </div>
</div>

And here is the Error I receive in the exception.log:

2016-08-01T15:00:29+00:00 ERR (3): 
exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Ordersedit_Block_Adminhtml_Order_View_Tab_Avans' in /var/public_html/dev_sportsdirect_bg/app/Mage.php:595
Stack trace:
#0 /var/public_html/dev_sportsdirect_bg/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('???????????????...')
#1 /var/public_html/dev_sportsdirect_bg/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('ordersedit/admi...', Array)
#2 /var/public_html/dev_sportsdirect_bg/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php(112): Mage_Core_Model_Layout->createBlock('ordersedit/admi...')
#3 [internal function]: Mage_Adminhtml_Block_Widget_Tabs->addTab('order_view_tab_...', 'ordersedit/admi...')
#4 /var/public_html/dev_sportsdirect_bg/app/code/core/Mage/Core/Model/Layout.php(348): call_user_func_array(Array, Array)
#5 /var/public_html/dev_sportsdirect_bg/app/code/core/Mage/Core/Model/Layout.php(214): Mage_Core_Model_Layout->_generateAction(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#6 /var/public_html/dev_sportsdirect_bg/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#7 /var/public_html/dev_sportsdirect_bg/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#8 /var/public_html/dev_sportsdirect_bg/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#9 //var/public_html/dev_sportsdirect_bg/app/code/core/Mage/Adminhtml/Controller/Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true)
#10 /var/public_html/dev_sportsdirect_bg/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php(59): Mage_Adminhtml_Controller_Action->loadLayout()
#11 /var/public_html/dev_sportsdirect_bg/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php(124): Mage_Adminhtml_Sales_OrderController->_initAction()
#12 /var/public_html/dev_sportsdirect_bg/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Sales_OrderController->viewAction()
#13 /var/public_html/dev_sportsdirect_bg/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('view')
#14 /var/public_html/dev_sportsdirect_bg/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 /var/public_html/dev_sportsdirect_bg/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#16 /var/public_html/dev_sportsdirect_bg/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#17 /var/public_html/dev_sportsdirect_bg/index.php(83): Mage::run('', 'store')
#18 {main}

Here is what I have in the system.log:

2016-08-01T15:00:29+00:00 ERR (3): Warning: file_exists(): open_basedir restriction in effect. File(/usr/share/php/Mage/Ordersedit/Block/Adminhtml/Order/View/Tab/Avans.php) is not within the allowed path(s): (/var/sentora/hostdata/zadmin/public_html/dev_sportsdirect_bg:/var/sentora/temp/)  in /var/sentora/hostdata/zadmin/public_html/dev_sportsdirect_bg/app/code/core/Mage/Core/functions.php on line 145

I think the problem comes from not propery directory settings.

Note that it is important the order directory to be OrdersEdit not Ordersedit where it seems it is seeking the file.

I am not sure what is the problem, please help me out resolve this!

0

Open the config.xml of your module and see the <block> section. Maybe the name of the block (alias) is not an ordersedit. If that is true, just use in your layout correct block alias from the config.xml.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.