Comments (12)
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.
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.
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.
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.
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.
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.
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.
@maaxxicarvalho Thanks for letting us know.
Is the nodule currently working properly when you get this error?
from cloudinary_magento.
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.
@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.
@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.
Closing due to time elapsed.
from cloudinary_magento.
Related Issues (20)
- 409 Already Exists results in unsynchronized image HOT 5
- wysiwyg-images with problems if media behind a symlink HOT 1
- Cloudinary Broken if using Composer HOT 1
- Error in logs: Strict Notice: Declaration of Cloudinary_Cloudinary_Model_Cache::save() should be compatible with Mage_Core_Model_Abstract::save() in public_html/app/code/community/Cloudinary/Cloudinary/Model/Cache.php on line 0 HOT 7
- Your magento subfolder setup prevents using composer for install HOT 10
- Module does not work with symlinked media folder HOT 9
- Some images are not served from Cloudinary HOT 2
- Installing latest version causes admin menu to dissapeer HOT 3
- Non existant classes HOT 2
- M1 Indexing Issue HOT 4
- Change Preference for Plugin for class: Magento\Widget\Model\Template\Filter HOT 2
- Warning: The use statement with non-compound name 'Cloudinary' has no effect... HOT 4
- Fatal error: Uncaught Error: Class 'Cloudinary' not found in /var/www/htdocs/.modman/cloudinary_magento/lib/CloudinaryExtension/CloudinaryImageProvider.php:114 HOT 2
- Cloudinary is Useless in the CMS Pages! HOT 8
- Automatic DPR detection not working HOT 1
- Data reset in after_save observer HOT 6
- Adding youtube and vimeo videos HOT 1
- about INSTALL.md and composer HOT 3
- MySQL index on cloudinary_synchronisation table HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudinary_magento.