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

  • SEARCH
  • Home
  • 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 8397373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:46:19+00:00 2026-06-09T20:46:19+00:00

For this in the admin panel /brands/adminhtml_brand/new/ for my custom module, I am supposed

  • 0

For this in the admin panel /brands/adminhtml_brand/new/ for my custom module, I am supposed to be seeing a page when I want to add a new entry to the database. I am following this tutorial. And my layout.xml is setup correctly.

magento cannot edit

BrandController.php

class Desbest_Brands_Adminhtml_BrandController extends Mage_Adminhtml_Controller_Action
    public function editAction()
        {
            $id = $this->getRequest()->getParam('id', null);
            $model = Mage::getModel('brands/example');
            if ($id) {
                $model->load((int) $id);
                if ($model->getId()) {
                    $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
                    if ($data) {
                        $model->setData($data)->setId($id);
                    }
                } else {
                    Mage::getSingleton('adminhtml/session')->addError(Mage::helper('brands')->__('Example does not exist'));
                    $this->_redirect('*/*/');
                }
            }
            Mage::register('example_data', $model);

            $this->loadLayout();
            $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
            $this->renderLayout();
      }
 }

Edit.php

<?php 
class Desbest_Brands_Block_Adminhtml_Example_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
{
    public function __construct()
    {
        parent::__construct();

        $this->_objectId = 'id';
        $this->_blockGroup = 'brands';
        $this->_controller = 'adminhtml_example';
        $this->_mode = 'edit';

        $this->_addButton('save_and_continue', array(
                  'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
                  'onclick' => 'saveAndContinueEdit()',
                  'class' => 'save',
        ), -100);
        $this->_updateButton('save', 'label', Mage::helper('brands')->__('Save Example'));

        $this->_formScripts[] = "
            function toggleEditor() {
                if (tinyMCE.getInstanceById('form_content') == null) {
                    tinyMCE.execCommand('mceAddControl', false, 'edit_form');
                } else {
                    tinyMCE.execCommand('mceRemoveControl', false, 'edit_form');
                }
            }

            function saveAndContinueEdit(){
                editForm.submit($('edit_form').action+'back/edit/');
            }
        ";
    }

    public function getHeaderText()
    {
        if (Mage::registry('example_data') && Mage::registry('example_data')->getId())
        {
            return Mage::helper('brands')->__('Edit Example "%s"', $this->htmlEscape(Mage::registry('example_data')->getName()));
        } else {
            return Mage::helper('brands')->__('New Example');
        }
    }

}

Grid.php

<?php
class Desbest_Brands_Block_Adminhtml_Example_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
    public function __construct()
    {
        parent::__construct();
        $this->setId('example_grid');
        $this->setDefaultSort('id');
        $this->setDefaultDir('desc');
        $this->setSaveParametersInSession(true);
    }

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

    protected function _prepareColumns()
    {
        $this->addColumn('id', array(
            'header'    => Mage::helper('brands')->__('ID'),
            'align'     =>'right',
            'width'     => '50px',
            'index'     => 'id',
        ));

        $this->addColumn('attributelabelid', array(
            'header'    => Mage::helper('brands')->__('Name'),
            'align'     =>'left',
            'index'     => 'name',
        ));

        $this->addColumn('name', array(
            'header'    => Mage::helper('brands')->__('Description'),
            'align'     =>'left',
  • 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-09T20:46:21+00:00Added an answer on June 9, 2026 at 8:46 pm

    Based on the URL you’re attempting to access, your controller action should be newAction(), not editAction(), unless you already have newAction() forwarding to edit as in the tutorial.

    The tutorial you linked to included a forward from the newAction to the editAction, using this:

    public function newAction()
    {
        $this->_forward('edit');
    }
    

    So, either make sure that you’re using that forward, or access the controller at /brands/adminhtml_brand/edit/ instead, and if you do this, be sure to update your layout handle to target the edit route.

    Some things to do to troubleshoot:

    • First off, post all the relevant code to the SO question – including layout xml updates
    • Always include full class names or file paths of all magento classes / files. Because it doesn’t seem like you’ve done something obviously wrong, it will probably come down to some trivial thing like a typo or mismatched block type / name – that kind of thing has happened to me many times.
    • Disable cache if you haven’t already
    • Enable block template hints so you know for sure which templates and blocks are being pulled into the page.
    • Check exception.log, system.log, and also your PHP error log to see if there’s anything in there.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create custom page for admin panel without model. For first i
I want to know how to make a custom admin panel page in opencart.
On the admin panel of my website, I have a page to add a
I now try to made admin panel and there want add 3 section: Edit
I need to upload my customized excel file in magento admin panel. This excel
I am trying to create a search page, this allows the admin to search
This post relates to this: Add row to inlines dynamically in django admin Is
i am using codeigniter 2.1.0 and mysql database. in my admin panel i have
I've read these pages regarding this: http://philsturgeon.co.uk/blog/2009/07/Create-an-Admin-panel-with-CodeIgniter Separate Admin and Front in codeigniter (look
I'm trying to build an admin panel where users can populate the database with

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.