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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:58:56+00:00 2026-06-17T09:58:56+00:00

I am using magento 1.7. i have got issue i don’t know why this

  • 0

I am using magento 1.7. i have got issue i don’t know why this is happen. i just open product in backend for edit then click on duplicate then i got following error

Warning: Illegal string offset 'new_file' in D:\wamp\www\easyshop\app\code\core\Mage\Catalog\Model\Product\Attribute\Backend\Media.php on line 158

when i try following code to debug file:

print_r($newImages);
die;

then i got this following data

Array
(
    [/s/a/samsung_galaxy_s2_front1.jpg] => /s/a/samsung_galaxy_s2_front1_4.jpg
    [/s/g/sgs2p1.jpg] => /s/g/sgs2p1_4.jpg
    [/s/g/sgs2_11.jpg] => /s/g/sgs2_11_4.jpg
    [/s/g/sgs2-4386.jpg] => /s/g/sgs2-4386_4.jpg
)

I thing array keys are wrong can you please give solution to solve this problem

  • 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-17T09:58:57+00:00Added an answer on June 17, 2026 at 9:58 am

    I had the same problem on 1.7.02. The solution I found was to change Magento’s (IMHO) bugged code.

    On Mage_Catalog_Model_Product_Attribute_Backend_Media i’ve changed the lines where you find:

            // For duplicating we need copy original images.
            $duplicate = array();
            foreach ($value['images'] as &$image) {
                if (!isset($image['value_id'])) {
                    continue;
                }
                $duplicate[$image['value_id']] = $this->_copyImage($image['file']);
                $newImages[$image['file']] = $duplicate[$image['value_id']];
            }
    

    for:

            // For duplicating we need copy original images.
            $duplicate = array();
            foreach ($value['images'] as &$image) {
                if (!isset($image['value_id'])) {
                    continue;
                }
                $duplicate[$image['value_id']] = $this->_copyImage($image['file']);
                $newImages[$image['file']] = array();
                $newImages[$image['file']]['new_file'] = $duplicate[$image['value_id']];
                $newImages[$image['file']]['label'] = $image['label'];
            }
    

    It did the trick for me… Images are now being properly duplicated and enabled on new product.

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

Sidebar

Related Questions

I have a Magento site using JS (prototype) to display tabbed content on product
I'm using Magento 1.7.0.1 just recently upgraded from 1.6.2.0 . I have the SCP
I have created a new product attribute in Magento using the admin panel. But
I am using Magento community version 1.5.1.0. I need to get a product have
We are using Magento I have got the below error in exception log file
I am using Magento and I'm trying to fix a small issue I have
We are using Magento as our eCommerce platform. We have Oracle apps in which
i am using Magento 1.5.1.0 and the mPAY24 Payment Gateway Extension. I have an
I am using Magento community ver1.6.1.0. I found this state diagram on Magento wiki
I'm using Magento Community Edition ver. 1.6.2.0. I’m trying to add a Simple product

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.