Coder Social home page Coder Social logo

Comments (12)

idobarnoam avatar idobarnoam commented on August 16, 2024

Hi @maxacarvalho Could you share the Magento version you are using and the module version?

Also what is the error that you are seeing?

from cloudinary_magento.

 avatar commented on August 16, 2024

Hi @idobarnoam
Let me give you a bit of context.

I have three environments Production, Staging and Development.
The idea is that all three environments share the same Cloudinary account so the resources are always available and up to date across all of them.

The above said. When I was trying to setup the Cloudinary Magento plugin on my local (development environment I got an error saying Incorrect custom transform ....
And I was simply inputting the Cloudinary Environment variable.

After some investigation I checked that the class app/code/community/Cloudinary/Cloudinary/Model/System/Config/Free.php calls a method validateImageUrl($url) which attempts to get the sampleImage ($this->validateImageUrl($this->sampleImageUrl($transform));).

For this is a bit weird since the first thing I do when I start a Cloudinary account is to delete the sample image since I don't want things that I'm not using polluting the Media library.
But, since I saw that this weird validation was happening I restored the sample image. Still, the method was calling and returning a 404 saying that the image is not there. But it is there.

The only solution I found was to comment out the line app/code/community/Cloudinary/Cloudinary/Model/System/Config/Free.php:41, save the configuration and then uncomment the line.

from cloudinary_magento.

idobarnoam avatar idobarnoam commented on August 16, 2024

Thanks @maxacarvalho This is very helpful.

Since this might be an issue that was already handled in later versions could you share the version number of both the Cloudinary module you are using and the Magento environment?

from cloudinary_magento.

 avatar commented on August 16, 2024

Hi again @idobarnoam
The Magento is at version 1.9.3.8
The Cloudinary extension is at version 2.8.2

All patches applied to the Magento code base so you might consider as 1.9.4.0

from cloudinary_magento.

idobarnoam avatar idobarnoam commented on August 16, 2024

Thanks, @maxacarvalho would it be possible to update the Cloudinary module to the latest one which is 2.9.6 and see if that helps?

from cloudinary_magento.

 avatar commented on August 16, 2024

I will do that later today @idobarnoam.
It's weird that I'm so many versions behind, I just installed the extension one month ago, downloaded from the Magento market place.

Also, I just downloaded the extension from the releases page and the app/code/community/Cloudinary/Cloudinary/etc/config.xml file says 2.9.5 instead of 2.9.6

from cloudinary_magento.

 avatar commented on August 16, 2024

Hi @idobarnoam
Just to let you know that the configuration is being saved properly.

But now I have another issue, the method code/community/Cloudinary/Cloudinary/Model/Catalog/Product/Media.php:37 is throwing an exception

There is one error message from magento server

Argument 1 passed to Cloudinary_Cloudinary_Model_Catalog_Product_Media::_getRemovedImages() must be of the type array, null given, called in code/community/Cloudinary/Cloudinary/Model/Catalog/Product/Media.php on line 39

This is happening because the code/community/Cloudinary/Cloudinary/Model/Catalog/Product/Media.php:42 method expects an array but the $product->getMediaGallery() could return null

I think its safer to test if $product->getData('media_gallery') returns an array

from cloudinary_magento.

idobarnoam avatar idobarnoam commented on August 16, 2024

@maaxxicarvalho Thanks for letting us know.

Is the nodule currently working properly when you get this error?

from cloudinary_magento.

 avatar commented on August 16, 2024

Hi @idobarnoam

It throws an exception when I try to create or update a product using the Magento API.

The problem happens because the Magento Product media_gallery can return null.
Since some of the methods of the Cloudinary plugin expects an array a fatal error occurs.

For example, the class app/code/community/Cloudinary/Cloudinary/Model/Catalog/Product/Media.php method newImagesForProduct

That's how it is

public function newImagesForProduct(Mage_Catalog_Model_Product $product)
    {
        $this->_setNewImages($product->getData('media_gallery'));
        return $this->_getNewImages($product);
    }

and that's how I solved the issue

public function newImagesForProduct(Mage_Catalog_Model_Product $product)
    {
        $mediaGallery = $product->getData('media_gallery') ?? [];
        $this->_setNewImages($mediaGallery);
        return $this->_getNewImages($product);
    }

from cloudinary_magento.

idobarnoam avatar idobarnoam commented on August 16, 2024

@maaxxicarvalho Thanks for sharing your solution!

I'll take this internally with our dev team and see how we can address the issue internally.

from cloudinary_magento.

IbrahimS2 avatar IbrahimS2 commented on August 16, 2024

@idobarnoam @maaxxicarvalho Yep, you were right, it might return null and when it does it breaks the configurable product quick create functionality altogether.

Please consider the following PR #49

from cloudinary_magento.

eyalktCloudinary avatar eyalktCloudinary commented on August 16, 2024

Closing due to time elapsed.

from cloudinary_magento.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.