Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin url images not pointing to s3 #7

Open
EdgarGomez opened this issue Apr 26, 2015 · 6 comments
Open

Admin url images not pointing to s3 #7

EdgarGomez opened this issue Apr 26, 2015 · 6 comments
Assignees

Comments

@EdgarGomez
Copy link

Admin url images not pointing to s3, still pointing to media folder. How can i change this?

@rimutaka
Copy link
Member

We never implemented this because our customers use this app
https://play.google.com/store/apps/details?id=com.mventory to manage
their product images.
S3CDN works perfectly fine there.

On 27/04/2015 3:43 a.m., Edgar Gomez wrote:

Admin url images not pointing to s3, still pointing to media folder.
How can i change this?


Reply to this email directly or view it on GitHub
#7.

@sebastianwahn
Copy link

Hi,

since i also had this issue on #4 i had to find a solution by myself.
My workaround is overriding the Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery_Content getImagesJson() function.

public function getImagesJson()
    {
        $store = Mage::app()->getStore();

        if(is_array($this->getElement()->getValue())) {
            $value = $this->getElement()->getValue();
            if(count($value['images'])>0) {
                foreach ($value['images'] as &$image) {
                    $image['url'] =
                        $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)
                        . $store->getConfig(MVentory_CDN_Model_Config::PREFIX)
                        . '/'
                        . '100x100'
                        . $image['file'];
                }
                return Mage::helper('core')->jsonEncode($value['images']);
            }
        }
        return '[]';
    }

BTW: i have also applied the "fix" mentioned in #3

@rimutaka
Copy link
Member

Thanx Sebastian. We use mVentory smartphone app to upload and manage product information, including images, so the admin was never an issue for us.

@rimutaka
Copy link
Member

@sebastianwahn Can you create a pull request if it works?

@neoacevedo
Copy link

@sebastianwahn how did you override that function?

@sebastianwahn
Copy link

@rimutaka @NestorAcevedo i created a pull request regarding this issue. Also fixes #3 when the prefix is applied on default store level (necessary for admin section)

@anatolykazantsev anatolykazantsev self-assigned this Jan 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants