Skip to content

Commit

Permalink
CLOUDINARY-427 - fix variable validation at afterPrepare function
Browse files Browse the repository at this point in the history
  • Loading branch information
arielien committed Jan 31, 2023
1 parent 707d7c0 commit ea137b0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Plugin/Ui/Component/Form/Element/DataType/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ protected function isGallerySupported()
*/
public function afterPrepare(\Magento\Ui\Component\Form\Element\DataType\Media $component, $result = null)
{
if ($this->appState->getAreaCode() === Area::AREA_ADMINHTML && ($cloudinaryMLoptions = $this->mediaLibraryHelper->getCloudinaryMLOptions(false))) {
$uploaderConfigUrl = $component->getData('config/uploaderConfig/url');
if ($this->appState->getAreaCode() === Area::AREA_ADMINHTML
&& ($cloudinaryMLoptions = $this->mediaLibraryHelper->getCloudinaryMLOptions(false))
&& ($uploaderConfigUrl = $component->getData('config/uploaderConfig/url'))
) {

if (strpos($uploaderConfigUrl, '/design_config_fileUploader/') !== false) {
$type = 'design_config_fileUploader';
} elseif (strpos($uploaderConfigUrl, '/category_image/') !== false) {
Expand Down

0 comments on commit ea137b0

Please sign in to comment.