Suitecrm: Quotation Marks or Apostrophes Converted to HTML Entities in Product Lines

Created on 12 Apr 2017  路  3Comments  路  Source: salesagility/SuiteCRM

Issue

A product can be created that contains apostrophes and quotation marks. In display of the product, the apostrophes and quotation marks will appear as normal. However, when that product is assigned to an invoice and the invoice is saved, any apostrophe or quote in the product line will be converted to their respective html entity. On display, the HTML entity is displayed instead of the character.

Expected Behavior

A product with a description as below:
"This is a line item" it has quotation marks and an apostrophe (Y'all).

Should appear as below on the invoicing line items after a save:
"This is a line item" it has quotation marks and an apostrophe (Y'all).

Actual Behavior

A product with a description as below:
"This is a line item" it has quotation marks and an apostrophe (Y'all).

Appears as below on the invoicing line items after a save:
"This is a line item" it has quotation marks and an apostrophe (Y'all).

Possible Fix

There must be something different in the processing that happens on a line item versus the processing that happens on a product description when it is not a line item.

Steps to Reproduce

  1. Create a new product with a description containing an apostrophe or quotation mark.
  2. Create a new invoice
  3. Add a new product group to the Invoice (call it anything)
  4. Add the new product that was created to the product group invoice. Note that the quotation marks and apostrophes appear as normal.
  5. Save the invoice
  6. Edit the invoice and note the change in the product line.

Context

Medium Priority - I'm not sure how many other characters this bug effects, the more characters obviously the higher priority. We have special characters in our invoices, but we can change the quotation marks out. My concern is that there are other characters this will happen with that we don't yet know about.

Your Environment

  • SuiteCRM Version used: (our prod) 7.8.2 & (Also occurs in the demo system) 7.8.3
  • Browser name and version: Tested in Chrome and Internet Explorer
  • Environment name and version: MariaDB
  • Operating System and version (e.g Ubuntu 16.04): CentOS
Important Fix Proposed Bug

All 3 comments

@Vhex Guithub converted your htmlentities and made your issue appear not to be an issue. You need to put backticks around the expected and actual lines of text so that github won't convert them and just leave them as literals.

Ha, thanks @chris001 -- I didn't even notice it.

Our current workaround is to edit:

modules/AOS_Products_Quotes/Line_Items.php

Where we replace around line 68:

$line_item->retrieve($row['id']);

To:

$line_item->retrieve($row['id'], false);

Related code: https://github.com/salesagility/SuiteCRM/blob/v7.8.3/modules/AOS_Products_Quotes/Line_Items.php#L66-L69

This enforces the retrieve function not to encode the retrieved content.

Can we have feedback from AOS_Products_Quotes module developers? Did they avoid using that parametre on purpose? Or they didn't think about saving such symbols?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dawansv picture dawansv  路  3Comments

Mausino picture Mausino  路  3Comments

ArturoBurela picture ArturoBurela  路  3Comments

pgorod picture pgorod  路  3Comments

Mausino picture Mausino  路  3Comments