views:

1744

answers:

2

So I downloaded the Magento free blog extension but it only supports a single blog. So I duplicated the extension as I need more than one blog in my magento store. I changed all the references and calls appropriately in my extension copy and was able to install it as a separate extension.

However when I want to create a new post from the admin panel it gives me a Magento 404 error.

I would appreciate if someone could take a look and let me know what I am missing.

Please NOTE that I use two environments for testing:

  1. a local installation of Magento through MAMP/WAMP (prepackaged LAMP desktop environment for Mac and Windows) with PHP 5.2.6, MySQL 5 and Apache 2.0.59

  2. a Webserver with PHP 5.2.10, MySQL 5.x and Apache 2.x

On my local MAMP/WAMP I am able to create a blog without a problem. However when I test it from a live server I am no longer able to create new blog post and the redirection to the admin page of the create post page gives me a magento 404 error.

I have been thinking that this might have to do with some server settings but I am not sure at all and would appreciate if someone else could look into this for me.

Thanks.

Programmer

+3  A: 

First a scold, then some help, because that's how StackOverflow rolls. Unless you're really conversant with Magento conventions, chances are you didn't change enough of the right things.

  1. Read up on the controller distach process in Magento and try tracing its progress

  2. So, that read, you now know your frontname here is "vblog_admin". Are ANY pages with this front name loading? If not, check your <routers> section of your customized module

  3. Your controller name is "manage_vblog", which means in the customized module you should have a controller at the following location: ModuleName/controllers/Manage/Vblog.php.

  4. Once you've ensured that controller is in place, make sure it has a newAction method on it.

If any of the above steps fail, magento will 404 on you. Finally, in

app/code/core/Mage/Core/Controller/Varien/Router/Standard.php

Search for the text getControllerFileName. This is where your controller gets its name, as well as the general area of the system where Magento decides if it has a legitimate request or not.

Update: Based on the file provided below (and private communication) it looks like it's your naming conventions that are causing the problem. Magento is extrodinarly strict about its camel case naming convention

VBlog

should be

Vblog

in all instances of class and filenames. While PHP itself doesn't care about case in classnames, msot linux servers DO case about case. Magento can't find your controller class file because of this and that's why you're getting a 404.

Alan Storm
Thanks for your reply Alan. From the admin panel, only the "add post" and "posts" menu items do not work. The other menu items work open fine, including "Comments", "Categories", "Settings".Also if this could be a controller/routing issue then why would this work on MAMP/WAMP but not on a live server? Feel free to download the blog here to check. Thanks.http://ecommerce-themes.com/blogissuesimages/duplicate_blog_extension.zip
eCommerce-Themes.com
Not sure, I'd try tracing the dispatch process (http://alanstorm.com/magento_controller_dispatch_logging) and seeing where it falls down
Alan Storm
A: 

Thanks to this thread, I could solve my similar issue. The problem is that the letter case is ignored on Mac. My controller file name wasn't complying with the Magento naming convention, causing 404 error on Linux, although it worked fine on Mac.

This logging module by Alan was really helpful. http://alanstorm.com/magento_controller_dispatch_logging

Thank you.

sanoju