SuiteCRM-Core icon indicating copy to clipboard operation
SuiteCRM-Core copied to clipboard

[Legacy] Fix #319 - Prevent css sanitization

Open yunusyerli1 opened this issue 1 year ago • 2 comments

Description

Add purifyHtml variable in SugarBean.php and get the value from $def['metadata']['purifyHtml']. #319

Motivation and Context

Whenever you save a Case and change tabs in detail view, CSS of the related fileds was disappearing.

How To Test This

If you add new fields like Property History and if these fields are getting CSS styles:

  1. Go to custom vardefs file of custom fields.
  2. Add following: 'metadata' => [ 'trustHTML' => true, 'purifyHtml' => false ],

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • [x] My code follows the code style of this project found here.
  • [ ] My change requires a change to the documentation.
  • [x] I have read the How to Contribute guidelines.

yunusyerli1 avatar Aug 18 '23 11:08 yunusyerli1

Hey @yunusyerli1

I've tried to test this PR, but I think I need further information as I'm not sure I understand the intent/fix.

I've applied your PR and added the suggested to vardefs, ie: image

However, I cannot see any changes to either a WYSIWYG or HTML field that i've added to the Accounts module. (Ive added a large number of special characters with bold/italic/underline styling in these fields, but the way they are displayed doesn't appear to change when swapping between true/false)

The "How to Test" on this PR, (as well as the Bug related to this PR), appear to be referring to already exisiting custom functionality.

Would you be able to provide some steps to test this PR that would be applicable to a generic CRM environment? (or, alternatively, advise where I may have gone wrong?)

Thanks!

johnM2401 avatar Oct 17 '23 12:10 johnM2401

Hey @yunusyerli1

I've had a further look into this and it appears as though the trustHTML functionality may be missing from this branch

See: image

Could you have another look at this, when you get a chance?

Thanks!

johnM2401 avatar Oct 19 '23 11:10 johnM2401