salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.42k stars 2.07k forks source link

Cases created automatically from E-mails showing HTML in fresh install of 7.5.1 #975

Closed meethoss closed 7 years ago

meethoss commented 8 years ago

As you can see from the below screenshots when a case is automatically created from an E-mail it is displaying HTML. That same E-mail, however, when used to manually create a case shows up fine. I've looked around for similar issues which I have attempted to resolve in the same way but could not get it working properly; either way this needs a permanent fix as this is a fresh install.

A little extra info if it helps - I used Gmail as the mailbox and the test E-mail was sent from Outlook 2013.

capture1

capture2

opensourcecrm commented 8 years ago

go to custom/modules/Cases/metadata/detailviewdefs.php and add this piece of code it will resolve your issue. array ( 0 => array ( 'name' => 'description', 'customCode' => '{$fields.description.value|escape:\'html_entity_decode\'}', ),

meethoss commented 8 years ago

Hi there,

Thanks for your response, unfortunately it hasn't fixed the issue. I have modified line 122 from:

    array (
    'description',
    ),

to:

    array (
      0 => array (
        'description',
        'customCode' => '{$fields.description.value|escape:\'html_entity_decode\'}',
      ),
    ),

But no luck. Any ideas?

opensourcecrm commented 8 years ago

check with this : 'customCode' => '{$fields.description.value|escape:\'htmlentitydecode\' |escape:\'html\'|strip_tags|url2html|nl2br}',

meethoss commented 8 years ago

This has fixed the issue, thanks - I take it this is going into a later release? I wouldn't know how to add this myself otherwise I would offer to :)

opensourcecrm commented 8 years ago

go to custom/modules/Cases/metadata/detailviewdefs.php update that customcode with description field

abeo commented 8 years ago

Running 7.5.3 and still have this issue.

Using opensourcecrm's suggestion I edited custom/modules/Cases/metadata/detailviewdefs.php to look like this, array ( 0 => array ( 'description', 'customCode' => '{$fields.description.value|escape:\'html_entity_decode\'}', ), and this, array ( 0 => 'description', 'customCode' => '{$fields.description.value|escape:\'htmlentitydecode\' |escape:\'html\'|strip_tags|url2html|nl2br}', ),

Not joy, HTML still displays either way.

meethoss commented 8 years ago

Maybe it's because you're editing the file in the custom directory? I directly edited the one in the modules directory: modules/Cases/metadata

That worked for me.

abeo commented 8 years ago

Yes I was editing in the Custom directory. However, when I edit in the Modules directory same result, Case Description still displays HTML tags.

This is my code' ' 4 => array ( 0 => array ( 'description', 'customCode' => '{$fields.description.value|escape:\'htmlentitydecode\' |escape:\'html\'|strip_tags|url2html|nl2br}', ), 5 => '

abeo commented 8 years ago

I also edited custom/modules/Cases/metadata/detailviewdefs.php with the same code but this cases and error that does not allow the Cases page to display.

meethoss commented 8 years ago

I'd suggest you get rid of the custom one - I don't know how that works as my experience of Suite so far is limited, but I would guess that's not helping.

My code from line 121 to 127 looks like this:

    4 => 
    array (
      0 => array (
        'description',
        'customCode' => '{$fields.description.value|escape:\'htmlentitydecode\' |escape:\'html\'|strip_tags|url2html|nl2br}',
      ),
    ),

Looks like mine but you seem to be missing a bracket and comma?

abeo commented 8 years ago

Okay I removed any changes from custom./modules/Cases/metadata/detailviewdefs.php and updated /modules/Cases/metadata/detailviewdefs.php with

array ( 0 => array ( 'description', 'customCode' => '{$fields.description.value|escape:\'htmlentitydecode\' |escape:\'html\'|strip_tags|url2html|nl2br}', ), ),

Still no joy

meethoss commented 8 years ago

Can you attach the file? Do you have any other changes in custom/modules/Cases/metadata/detailviewdefs.php? If not then delete the file, it may be overriding the default file.

abeo commented 8 years ago

Thanks for the help. I deleted custom./modules/Cases/metadata/detailviewdefs.php No effect from doing that. Attached is the /modules/Cases/metadata/detailviewdefs.php file detailviewdefs.zip

meethoss commented 8 years ago

Hmm, your file is an exact match to mine. Sorry I've got no other ideas beyond deleting your custom/modules/Cases folder.

abeo commented 8 years ago

Weird, I renamed the custom/modules/Cases folder.

Still no joy.

Thanks for the help.

meethoss commented 8 years ago

Sorry got no other ideas - good luck with it!

opensourcecrm commented 8 years ago

after making changes with metadata file please repair and rebuild which will adopt the changes.

abeo commented 8 years ago

I updated the /modules/Cases/metadata/detailviewdef.php by replacing the file with a new file containing the updated code. Then I ran a Quick Repair.

Still no joy.

gokhanerdogdu commented 8 years ago

Is this problem still valid in 7.7.4?

bmwtourer commented 8 years ago

I can confirm that this problem is still in 7.7.4 I would add : If I do not put one of the suggested patch I get this

image

when I put the patch (or very like) I get this image

as one can see, with no patch the foreign characters are shown properly but html tags are also shown if i put the patch html renders correctly but I lose the foreign characters.

btw here is my detailviewdev file portion array ( 'name' => 'description', 'comment' => 'Full text of the note', 'label' => 'LBL_DESCRIPTION', 'customCode' => '{$fields.description.value|escape:\'html_entity_decode\'}', ),

I would believe that this problem is getting old and seems to attract little attention.

The MAJOR issue is that when we reply to customers the wrong code is shown which is not really good for our image and by association SuiteCRM image too...

If I am wrong and a solution exist please point me in the right direction.

vladbar commented 7 years ago

I could not replicate this issue - description box does not contain any html markup and foreign characters are displayed correctly. Tested with SuiteCRM 7.7.9, email was sent from Gmail, FastMail was used for the Case Handler (Inbound Email).

shogunpol commented 7 years ago

@meethoss , an issue has been tested on recent version of SuiteCRM(7.8.1), and not appear, can you confirm it and close the issue?

bmwtourer commented 7 years ago

@shogunpol I will test and report Serge

bmwtourer commented 7 years ago

Problem was still there after upgrade to 7.8.1 on test instance... I deleted my custom detail view , performed a repair I looked at the standard view and the problem is gone! 👍 I rebuilt my custom detail view and still ok 👍 Thank you! Serge

bmwtourer commented 7 years ago

BTW my problem was related to   (space -> & nbsp;) characters... all (most?) other html stuff was ok but not the space for some reason.

shogunpol commented 7 years ago

@meethoss , according to community review, an issue doesnt exist any more. If this issue still exists and information can be given to allow us to proceed with this it can be reopened.

fcorluka commented 5 years ago

Hi, I have similar problem in ListView (SuiteCRM 7.8.23 -> Cases - description).

EditView nad DetailView are all good but Listview is not.

I have tried to put custom code line but with no luck. Any ideas? Filip

OKEY so I can not put my html code in here because here it is shown good, but why not in my ListView?