Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Good Development Practices
 
lazzymonk
Guru
 
Avatar
Total Posts:  391
Joined:  2008-04-03
England
 

Is it good development practice to put the admin part of a module into core/mage/adminhtml?

One of the modules im creating has a bug that is only fixable by putting the admin part of the module into the core. But if this isnt good practice i dont really want to do it.

Anyone got an idea about this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
R22B
Sr. Member
 
Total Posts:  76
Joined:  2008-06-12
 
lazzymonk - 04 September 2008 11:36 AM

Is it good development practice to put the admin part of a module into core/mage/adminhtml?

One of the modules im creating has a bug that is only fixable by putting the admin part of the module into the core. But if this isnt good practice i dont really want to do it.

Anyone got an idea about this?

I cant help you, but I hope its the WP plugin :D!!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
lazzymonk
Guru
 
Avatar
Total Posts:  391
Joined:  2008-04-03
England
 

anybody? Moshe?

 
Magento Community Magento Community
Magento Community
Magento Community
 
LeeSaferite
Guru
 
Avatar
Total Posts:  322
Joined:  2007-08-31
Lake City, FL
 

Have you used the module creator software?  Not sure if that follows a recommended format, but it puts the adminhtml under the module like this:

/magento/app/code/local/Youcompany/Yourmodule/Block/Adminhtml/*
/magento/app/code/local/Youcompany/Yourmodule/controllers/Adminhtml/*
/magento/app/design/adminhtml/default/default/layout/yourmodule.xml
/magento/app/design/adminhtml/default/default/template/yourmodule/*

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 

Have you tried adding your file to the same file structure but in the local folder?

app/code/local/Mage/adminhtml/yourfile.php

In my experience, you can just use the same folder structure and add files into the local folder to overwrite / add to core modules

 
Magento Community Magento Community
Magento Community
Magento Community
 
LeeSaferite
Guru
 
Avatar
Total Posts:  322
Joined:  2007-08-31
Lake City, FL
 

What is the bug you are experiencing?  I’ve written a lot of code in add on modules already without adding anything to the core.

 
Magento Community Magento Community
Magento Community
Magento Community
 
LeeSaferite
Guru
 
Avatar
Total Posts:  322
Joined:  2007-08-31
Lake City, FL
 

@nikefido

The problem with doing it that way is you cannot extend any of the Mage classes if you use the exact same class name, you can only replace them.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lazzymonk
Guru
 
Avatar
Total Posts:  391
Joined:  2008-04-03
England
 

the problem is when put store code in url is enabled. it adds admin an extra admin/ to the url which is causing a 404 error on my module admin pages.

maybe im missing something in the config. but if its in the core/mage/adminhtml it works ok.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top