1

im working on Magento 1.9.3
i'm trying to override the admin grid of a custom module.
The original module strucutre is:

Miravist
- Helpdesk
-- Block
--- Adminhtml
---- Ticket
----- Grid.php

original module config.xml

<blocks>
  <helpdesk>
    <class>Mirasvit_Helpdesk_Block</class>
  </helpdesk>
</blocks>

my module config.xml is

...
    <global>
        <blocks>
            <helpdesk>
                <rewrite>
                    <adminhtml_ticket_grid>MyCompany_Helpdesk_Block_Adminhtml_Ticket_Grid</adminhtml_ticket_grid>
                </rewrite>
            </helpdesk>
        </blocks>
...

For what i've found around it should works but it does not. Any help?

--EDIT--
what i'm trying to do is override protected function _prepareColumns() maybe is it the problem?

  • Verify that your file is in app/code/local/Mycompany/Helpdesk/Block/Adminhtml/Ticket/Grid.php. Can you paste the original module's config.xml blocks section? – seanbreeden Jul 19 '17 at 19:55
  • @seanbreeden, thanks for answer, the path of my file is right. I've edited the question and added the original module block part of cong.xml – krybbio Jul 19 '17 at 20:12
  • That looks like it should work. Make sure your namespace in your Grid.php is class MyCompany_Helpdesk_Block_Adminhtml_Ticket_Grid extends Mirasvit_Helpdesk_Block_Adminhtml_Ticket_Grid. Be sure to flush caches. – seanbreeden Jul 19 '17 at 20:36
  • Another thing to check is that your module is activate in app/etc/modules. Sometimes it's easy to overlook the simple things. – seanbreeden Jul 19 '17 at 20:43
  • @seanbreeden everything you suggest is as it should be. thats why i can't understand why doesn't work. – krybbio Jul 19 '17 at 20:46
1

i have changed

MyCompany_Helpdesk_Block_Adminhtml_Ticket_Grid extends Mirasvit_Helpdesk_Block_Adminhtml_Ticket_Grid

with

MyCompany_Helpdesk_Block_Adminhtml_Ticket_Grid extends Mage_Adminhtml_Block_Widget_Grid

and now it works.

But in this way i had to override the whole class non just the protected function _prepareColumns()

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.