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 7046093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:36:34+00:00 2026-05-28T02:36:34+00:00

When I try to overwrite a model from Mage_Catalog (Mage_Catalog_Model_Product_Image for instance) I have

  • 0

When I try to overwrite a model from Mage_Catalog (Mage_Catalog_Model_Product_Image for instance) I have no problem but when I try to do it for a model from Mage_Core (Mage_Core_Model_File_Uploader) it doesn’t work.

Is there some kind of protection on Mage_Core?
I cannot use an observer instead so I really have to get that working.

My config.xml:

<models>
    <myshop>
        <class>Adrien_Myshop_Model</class>
    </myshop>
    <core>
        <rewrite>
            <file_uploader>Adrien_Myshop_Model_Core_File_Uploader</file_uploader>
        </rewrite>
    </core>
    <catalog>
        <rewrite>
            <product_image>Adrien_Myshop_Model_Catalog_Product_Image</product_image>
        </rewrite>
    </catalog>
</models>

My new Uploader model:

class Adrien_Myshop_Model_Core_File_Uploader extends Mage_Core_Model_File_Uploader
{
    protected function _moveFile($tmpPath, $destPath)
    {
        Mage::log("custom upload");
        return parent::_moveFile($tmpPath, $destPath);
    }

}

I put a debug log into Mage_Core_Model_File_Uploader::_moveFile as well, when I run the script I get only the log from Mage_Core_Model_File_Uploader.

However, when I test it with Catalog_Product_Image I properly get both debug logs.

  • 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-05-28T02:36:34+00:00Added an answer on May 28, 2026 at 2:36 am

    If you grep the source code for that class name you can see that it is invoked directly in PHP via new, hence the inability to rewrite.

    If you must rewrite this class, you will need to do so by copying it to the local codepool and making your changes therein, noting that you’ll need to merge in new changes as you upgrade the application.

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

Sidebar

Related Questions

I want to override the SubmitChanges() method for my model. Whern I try to
I try to inhering from ViewPage as shown in this question Inheriting from ViewPage
I have some problems when I try to bind the height and width of
Plenty of pages load since upgrading my site from MVC 1.0 but if I
hey. I'm trying to maintain an MVVM model, but am tripping up somewhere when
I'm having trouble running the 3n+1 Problem from the Programming Challenges book . I've
I have objects in their own tables using EF Codefirst. Now I try to
I have a simple program. Its job is to move files from A to
Suppose I have a table with the column Description, varchar(100). If try to insert
I am creating a linq-to-sql model with EF, and have a class that works

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.