News:

Looking for documentation? Take a look on our wiki

Main Menu

Issue in product media object

Started by sandomatyas, July 15, 2022, 22:27:42 PM

Previous topic - Next topic

sandomatyas

There is a VM installaton, where I set the  'no image' image to a custom image (424.jpg)
When I list a category there are 2 products with no images. None of them has rows in #__virtuemart_product_medias table, both of them have 0 value in #__virtuemart_products.has_media field.
Both of them shows the 'no image' image, but when I dump $product->images in products.php sublayout I get this:
First product:

Array
(
    [0] => VmImage Object
        (
            [media_attributes] => 0
            [setRole] =>
            [file_name] =>
            [file_extension] => jpg
            [virtuemart_media_id] => 0
            [theme_url] => components/com_virtuemart/
            [noImageSet] =>
            [_foldersToTest:VmMediaHandler:private] => Array
                (
                    [0] => public_html/images/stories/virtuemart/product/
                    [1] => public_html/images/stories/virtuemart/product/resized/
                )
            [_actions] => Array
                (
                )
            [_mLocation] => Array
                (
                )
            [_hidden:VmMediaHandler:private] => Array
                (
                )
            [virtuemart_vendor_id] => 0
            [file_title] =>
            [file_description] =>
            [file_meta] =>
            [file_class] =>
            [file_mimetype] =>
            [file_type] => products
            [file_url] => .jpg
            [file_url_thumb] =>
            [published] => 0
            [file_is_downloadable] => 0
            [file_is_forSale] => 0
            [file_is_product_image] => 0
            [shared] => 0
            [file_params] => 0
            [file_lang] =>
            [created_on] =>
            [created_by] => 0
            [modified_on] =>
            [modified_by] => 0
            [file_url_folder] => images/stories/virtuemart/product/
            [file_path_folder] => images/stories/virtuemart/product/
            [file_url_folder_thumb] => images/stories/virtuemart/product/resized/
            [media_role] => file_is_displayable
        )
)


Second product:

Array
(
    [0] => VmImage Object
        (
            [media_attributes] => 0
            [setRole] =>
            [file_name] => 474
            [file_extension] => jpg
            [virtuemart_media_id] => 0
            [theme_url] => components/com_virtuemart/
            [noImageSet] => 1
            [_foldersToTest:VmMediaHandler:private] => Array
                (
                    [0] => public_html/images/stories/virtuemart/product/
                    [1] => public_html/images/stories/virtuemart/product/resized/
                )
            [_actions] => Array
                (
                )
            [_mLocation] => Array
                (
                )
            [_hidden:VmMediaHandler:private] => Array
                (
                )
            [virtuemart_vendor_id] => 0
            [file_title] =>
            [file_description] =>
            [file_meta] =>
            [file_class] =>
            [file_mimetype] =>
            [file_type] => products
            [file_url] => components/com_virtuemart/assets/images/vmgeneral/474.jpg
            [file_url_thumb] =>
            [published] => 0
            [file_is_downloadable] => 0
            [file_is_forSale] => 0
            [file_is_product_image] => 0
            [shared] => 0
            [file_params] => 0
            [file_lang] =>
            [created_on] =>
            [created_by] => 0
            [modified_on] =>
            [modified_by] => 0
            [file_url_folder] => components/com_virtuemart/assets/images/vmgeneral/
            [file_path_folder] => public_html/components/com_virtuemart/assets/images/vmgeneral/
            [file_url_folder_thumb] => images/virtuemart/typeless/
            [media_role] => file_is_displayable
        )
)


As you can see the second product's image object has the proper file_url, file_name, file_extension, noImageSet etc from the 'no image' image setting, but the first one is empty. As far as I can see it does not make a big difference on display because displayMediaThumb can handle this. But I have some custom scripts which should have the proper value.
Any idea why the first product's image object doesn't have the 'no image' values?

sandomatyas