aos_products_product_image image width and height are harcoded #2569

Closed
opened 2026-02-20 15:25:44 -05:00 by deekerman · 0 comments
Owner

Originally created by @Abuelodelanada on GitHub (Dec 28, 2017).

Issue

The $aos_products_product_image with and height in PDF_Templates are harcoded in 50px.

$value = '<img src="' . $value . '"width="50" height="50"/>';

More data in this post

Expected Behavior

The image sizes should not be harcoded. The image should adopt the size of its container

Actual Behavior

The image is very small in the PDF or in the email when you "Email Quotation"

Possible Fix

Replace

$value = '<img src="' . $value . '"width="50" height="50"/>';

with:

$value = '<img src="' . $value . '"width="100%"/>';

in modules/AOS_PDF_Templates/templateParser.php, line 110

Steps to Reproduce

  1. Create a PDF Template for Quotation including $aos_products_product_image variable
  2. Create a Product with an image
  3. Create a Quotation.
  4. Email PDF this Quotation
  5. Check that the image is 50px width and 50px height

Context

Your Environment

  • SuiteCRM Version used: 7.9x - 7.10-beta3
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Firefox 57
  • Environment name and version (e.g. MySQL, PHP 7): MySQL 5.7, PHP 5.6
  • Operating System and version (e.g Ubuntu 16.04): Ubuntu 17.10
Originally created by @Abuelodelanada on GitHub (Dec 28, 2017). <!--- Provide a general summary of the issue in the **Title** above --> <!--- Before you open an issue, please check if a similar issue already exists or has been closed before. ---> <!--- If you have discovered a security risk please report it by emailing security@suitecrm.com. This will be delivered to the product team who handle security issues. Please don't disclose security bugs publicly until they have been handled by the security team. ---> #### Issue <!--- Provide a more detailed introduction to the issue itself, and why you consider it to be a bug --> The $aos_products_product_image with and height in PDF_Templates are [harcoded](https://github.com/salesagility/SuiteCRM/blob/master/modules/AOS_PDF_Templates/templateParser.php#L109-L110) in 50px. `$value = '<img src="' . $value . '"width="50" height="50"/>';` More data [in this post](https://suitecrm.com/forum/suitecrm-7-0-discussion/17058-aos-pdf-templates-images-sizes#57462) #### Expected Behavior <!--- Tell us what should happen --> The image sizes should not be harcoded. The image should adopt the size of its container #### Actual Behavior <!--- Tell us what happens instead --> <!--- Also please check relevant logs (suitecrm.log, php error.log etc.) --> The image is very small in the PDF or in the email when you "Email Quotation" #### Possible Fix <!--- Not obligatory, but suggest a fix or reason for the bug --> Replace `$value = '<img src="' . $value . '"width="50" height="50"/>';` with: `$value = '<img src="' . $value . '"width="100%"/>';` in modules/AOS_PDF_Templates/templateParser.php, line 110 #### Steps to Reproduce <!--- Provide a link to a live example, or an unambiguous set of steps to --> <!--- reproduce this bug include code to reproduce, if relevant --> 1. Create a PDF Template for Quotation including $aos_products_product_image variable 2. Create a Product with an image 3. Create a Quotation. 4. Email PDF this Quotation 5. Check that the image is 50px width and 50px height #### Context <!--- How has this bug affected you? What were you trying to accomplish? --> <!--- If you feel this should be a low/medium/high priority then please state so --> #### Your Environment <!--- Include as many relevant details about the environment you experienced the bug in --> * SuiteCRM Version used: 7.9x - 7.10-beta3 * Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Firefox 57 * Environment name and version (e.g. MySQL, PHP 7): MySQL 5.7, PHP 5.6 * Operating System and version (e.g Ubuntu 16.04): Ubuntu 17.10
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#2569
No description provided.