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

Bugfix/issue 542 accented character displayed incorrectly #579

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

Conversation

cvillarongace
Copy link

Description

A bug was identified where special characters in text fields were not properly handled. This issue was resolved by adding a new format for text fields that can be extended to handle additional characters. The following changes were made:

  1. New Files Added:

    • text-formatter.service.ts: Implements logic for handling and formatting special characters, designed to be extensible.
    • text-formatter.service.spec.mock.ts: Provides mock data and unit tests for the text-formatter.service.ts.
    • New characters may be added in the future, I decided not to incorporate third-party libraries and manage the conversions with a map
  2. Modifications to Existing Files:

    • data-type.formatter.service.ts: Added the TextFormatter to the list of formats, integrating the new functionality into the existing service.
    • filter-field.builder.ts: Fixed an issue where the formatted value was not assigned to text fields. Added the following lines:
      if (field.type == 'text') {
          field.value = formattedValue;
      }

For more details, see GitHub Issue #542.

Motivation and Context

How To Test This

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

  • 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.

@SuiteBot
Copy link

SuiteBot commented Dec 10, 2024

CLA assistant check
All committers have signed the CLA.

@fmarsico70
Copy link

Unfortunately this solution doesn't seem to work for "TextArea" type fields, such as the "Description" fields of Contacts or Leads.
Any ideas to solve the problem of accented letters displaying badly even in these cases?

@desarrollador20
Copy link

Hi @fmarsico70
What version of SuiteCRM do you have? I have version 8.7.1, and it works correctly for me.

@shubham-pawar
Copy link

@cvillarongace, You need to sign CLA for this one too.

@cvillarongace
Copy link
Author

Ok, I've added both addresses to my Github profile, but it doesn't seem to change anything. Is there anything else I can try?

@shubham-pawar
Copy link

@cvillarongace Now try to sign CLA again and submit.

@cvillarongace
Copy link
Author

I did that but It was unsuccessful.
As far as I can see in the PR the problem is another one. The first commit of the PR has been created with a user who apparently does not exist. As you can see in the following commit 3823ecb However, that user is myself, I really can't find how to associate it, nor can I explain why that happened.

@shubham-pawar
Copy link

@cvillarongace cvillarongace force-pushed the bugfix/issue-542-accented-character-displayed-incorrectly branch 2 times, most recently from a73d02d to d71ddea Compare January 14, 2025 18:03
@cvillarongace
Copy link
Author

@shubham-pawar It seems that it didn't work the same here, any suggestions?

@cvillarongace cvillarongace force-pushed the bugfix/issue-542-accented-character-displayed-incorrectly branch from d71ddea to 39d5185 Compare January 14, 2025 19:05
@cvillarongace
Copy link
Author

@shubham-pawar done.

@shubham-pawar
Copy link

@cvillarongace Thank you 💯 🥇

@TomaszSR
Copy link

TomaszSR commented Jan 15, 2025

Hello. I only have this error in the description field for accounts. In other fields, like this, everything is ok. I changed the field type to VARCHAR (10000) with MySQL Workbench and then ran a quick repair. The Suite itself generated a script to improve the handling of this field. Of course, i previously checked whether this field does not contain more characters. It works ok. After correcting this error, i will restore the type to text medium as it was originally.
What puzzles me most is why the description for accounts does not correctly display the letter "ó" on the screen, while for other areas the description field displays correctly, even though they are of the same type.

@shubham-pawar
Copy link

@TomaszSR, you need to check if description field as of type text, textArea or textField from the studio. I think we get characters issue when field is of type textArea.

@TomaszSR
Copy link

TomaszSR commented Jan 15, 2025

@shubham-pawar you were right. It worked. Thank you very much.
In studio all these fields are type Text, but in mysql workbench these types are difference. With type Text works properly but with type TextArea not.
I explain it in detail for others who are looking for a solution. The SuiteCRM authors just need to change the type of this field when generating the database during installation and it will be ok. They do a great job, so it's worth helping them in this work that we all benefit from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants