Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Legacy] Fix #319 - Prevent css sanitization #320

Open
wants to merge 2 commits into
base: hotfix
Choose a base branch
from

Conversation

yunusyerli1
Copy link
Contributor

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

  • 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

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

@clemente-raposo clemente-raposo added the Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member label Aug 21, 2023
Copy link
Contributor

@clemente-raposo clemente-raposo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@johnM2401 johnM2401 added the Status:Requires Updates Issues & PRs which requires input or update from the author label Oct 17, 2023
@johnM2401
Copy link

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
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member Status: Passed Code Review Status: Requires Testing Status:Requires Updates Issues & PRs which requires input or update from the author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants