SuiteCRM-Core
SuiteCRM-Core copied to clipboard
[Legacy] Fix #319 - Prevent css sanitization
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:
- Go to custom vardefs file of custom fields.
- 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.
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:
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!
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:
Could you have another look at this, when you get a chance?
Thanks!