Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8084461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:48:36+00:00 2026-06-05T17:48:36+00:00

Getting extremely confused with an adminhtml module i’m trying to write! Effectively I have

  • 0

Getting extremely confused with an adminhtml module i’m trying to write!

Effectively I have the indexcontroller written and working, and i’m trying to call a grid block:

$<?php

class MyTuxedo_OutOfStock_Block_Adminhtml_Web_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
   public function __construct()
 {
  parent::__construct();
  $this->setId('OOSGrid');
  $this->setDefaultSort('OOS_id');
  $this->setDefaultDir('ASC');
  $this->setSaveParametersInSession(true);
}

protected function _prepareCollection()
{
  $collection = Mage::getModel('MyTuxedo/OutOfStock')->getCollection();
  $this->setCollection($collection);
  return parent::_prepareCollection();
}

protected function _prepareColumns()
{
  $this->addColumn('category_name', array(
      'header'    => Mage::helper('OutOfStock')->__('Category'),
      'align'     =>'right',
      'width'     => '50px',
      'index'     => 'web_id',
  ));

  $this->addColumn('sku', array(
      'header'    => Mage::helper('OutOfStock')->__('SKU'),
      'align'     =>'left',
      'index'     => 'title',
  ));

/*
  $this->addColumn('quantity', array(
 'header'    => Mage::helper('OutOfStock')->__('Quantity Available'),
'width'     => '150px',
'index'     => 'content',
  ));
*/

  $this->addColumn('Backorder allowed', array(
      'header'    => Mage::helper('OutOfStock')->__('Status'),
      'align'     => 'left',
      'width'     => '80px',
      'index'     => 'status',
      'type'      => 'options',
      'options'   => array(
          1 => 'Enabled',
          2 => 'Disabled',
      ),
  ));

    $this->addColumn('action',
        array(
            'header'    =>  Mage::helper('OutOfStock')->__('Action'),
            'width'     => '100',
            'type'      => 'action',
            'getter'    => 'getId',
            'actions'   => array(
                array(
                    'caption'   => Mage::helper('OutOfStock')->__('Edit'),
                    'url'       => array('base'=> '*/*/edit'),
                    'field'     => 'id'
                )
            ),
            'filter'    => false,
            'sortable'  => false,
            'index'     => 'stores',
            'is_system' => true,
    ));

$this->addExportType('*/*/exportCsv', Mage::helper('OutOfStock')->__('CSV'));
$this->addExportType('*/*/exportXml', Mage::helper('OutOfStock')->__('XML'));

  return parent::_prepareColumns();
}


 public function getRowUrl($row)
{
  return $this->getUrl('*/*/edit', array('id' => $row->getId()));
}

I am using a controller to call the method through:

<?php
class MyTuxedo_OutOfStock_IndexController extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
    $this->loadLayout();
    $this->_addContent($this->getLayout()->createBlock('OutOfStock/adminhtml_OutOfStock'));
    $this->renderLayout();
    }
}

Layout file consists of the following:

<?xml version=“1.0??>
<layout version=“0.1.0?>
  <OutOfStock_index_index>
    <reference name=“content”>
  <block type=“OutOfStock/adminhtml_OutOfStock“ name=“OutOfStock“ />
</reference>
</OutOfStock_index_index>
</layout>

And finally the block base file:

 <?php
class MyTuxedo_OutOfStock_Block_Adminhtml_OutOfStock extends Mage_Adminhtml_Block_Widget_Grid_Container
{
public function __construct()
{
 $this->_controller = ‘adminhtml_OutOfStock’;
 $this->_blockGroup = ‘OutOfStock’;
 $this->_headerText = Mage::helper(‘OutOfStock’)->__(‘Item Manager’);
     $this->_addButtonLabel = Mage::helper(‘OutOfStock’)->__(‘Add Item’);
 parent::__construct();
  }
}

I have tried everything and anything to get the grid to show on the backend, it just absolutely refuses to work. Running echo’s in the indexcontroller works fine, I have even called a CMS static block fine from within the controller, just calling the block itself refuses to work.

Has anyone got any suggestions? Can post the config.xml as well if needed just didn’t want to bloat the question too much!

Thanks!!

Config.xml

<?xml version="1.0"?>
<config>  
<modules> 
   <MyTuxedo_OutOfStock>    
    <version>0.1.0</version>
    </MyTuxedo_OutOfStock>   
 </modules>  
 <adminhtml>   
  <layout>    
    <updates>      
      <outofstock>        
        <file>OutOfStock.xml</file>      
      </outofstock>      
  </updates>   
 </layout>        
 <acl>        
 <resources>    
        <admin>     
         <children>      
              <outofstock>    
                    <title>Out of Stock Items</title>      
                  <children>                        
             <OutOfStock>     
                     <title>Out of Stock Items</title>                      
          </OutOfStock>                   
       </children>          
          </outofstock>             
     </children>      
      </admin> 
       </resources>  
  </acl>   
  </adminhtml>  
  <global>
  <models>
<outofstock>
    <class>MyTuxedo_OutOfStock_Model</class>
</outofstock> 
  </models>      
  <helpers>     
   <outofstock>   
         <class>MyTuxedo_OutOfStock_Helper</class>    
    </outofstock>   
  </helpers> 
<blocks>
<outofstock>
<class>MyTuxedo_OutOfStock_Block</class>
</outofstock>
</blocks> 
</global>
  <admin>
    <routers>
        <MyTuxedo_OutOfStock>
            <use>admin</use>
            <args>
                <module>MyTuxedo_OutOfStock</module>
                <frontName>OutOfStock</frontName>
            </args>
        </MyTuxedo_OutOfStock>
    </routers>
 </admin>
 </config>

I’ve actually changed the configuration scope, however i’m still getting:

 2012-06-12T09:43:35+00:00 ERR (3): 
 exception 'Mage_Core_Exception' with message 'Invalid block type:       MyTuxedo_OutOfStock_Block_Adminhtml_Nostock' in /chroot/home/mytuxedo   /developer.mytuxedo.co.uk/html/app/Mage.php:550
 Stack trace:
 #0 /chroot/home/mytuxedo/developer.mytuxedo.co.uk/html/includes/src/__default.php(24835): Mage::throwException('Invalid block t...')
 #1 /chroot/home/mytuxedo/developer.mytuxedo.co.uk/html/includes/src/__default.php(24777): Mage_Core_Model_Layout->_getBlockInstance('OutOfStock/Admi...', Array)
 #2 /chroot/home/mytuxedo/developer.mytuxedo.co.uk/html/app/code/local/MyTuxedo/OutOfStock/controllers/Adminhtml/OutOfStockController.php(7): Mage_Core_Model_Layout->createBlock('OutOfStock/Admi...')
 #3 /chroot/home/mytuxedo/developer.mytuxedo.co.uk/html/includes/src/__default.php(12068): MyTuxedo_OutOfStock_Adminhtml_OutOfStockController->indexAction()
 #4 /chroot/home/mytuxedo/developer.mytuxedo.co.uk/html/includes/src/__default.php(16116): Mage_Core_Controller_Varien_Action->dispatch('index')
 #5 /chroot/home/mytuxedo/developer.mytuxedo.co.uk/html/includes/src/__default.php(15713): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
 #6 /chroot/home/mytuxedo/developer.mytuxedo.co.uk/html/includes/src/__default.php(17973): Mage_Core_Controller_Varien_Front->dispatch()
 #7 /chroot/home/mytuxedo/developer.mytuxedo.co.uk/html/app/Mage.php(596): Mage_Core_Model_App->run(Array)
 #8 /chroot/home/mytuxedo/developer.mytuxedo.co.uk/html/index.php(97): Mage::run('', 'store')
 #9 {main}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T17:48:38+00:00Added an answer on June 5, 2026 at 5:48 pm

    Figured it out, hadn’t noticed the compilation process was switched on (Have no idea why I had switched it on?!). – Hours wasted, for those with class not found make sure you check the compiler before debugging!!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to call a Web service that is extremely demanding (unstandard) regarding the
I am extremely confused why I am getting this strange error all the sudden:
This is getting extremely irritating. Right now I have a winforms application, and things
I've been getting some extremely bizarre behaviour where NHibernate queries start to hang. I've
I'm having an extremely difficulty time getting the flowplayer to show up and the
I'm creating an XNA game and am getting an unexpected result, extremely low FPS
I am getting at extremely fast rate, tweets from a long-lived connection to the
Hey guys I'm trying to see where my pairs of keys stop, I have
I am extremely new for iPhone and SQLite. I have 1 button and three
I am getting confused with my code and not sure how to implement what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.