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

Fix Job Log entries containing links so they will display properly #12659

Merged

Conversation

kenwest
Copy link
Contributor

@kenwest kenwest commented Aug 14, 2018

Overview

Fixes the display of JobLog entries when they contains links

Before

The geocode job provides links in it's message to help users fix unparseable addresses. These appear in the description, but because the description is truncated, the links get broken and the entry doesn't display properly (in this image the whole of the message has become a link).

Job entry before change

After

All HTML tags are stripped from the message before it is truncated to form the description

Job entry after change

Technical Details

Nil

Comments

The description is limited to 240 characters and has an ellipsis added if it is truncated. It does it in a better way than the original code ;-)

Prior to this change the message was truncated, but this causes issues if the message included HTML tags.
This change strips HTML tags from the message before truncation.
The description is limited to 240 characters and has an ellipsis added if it is truncated.
@civibot
Copy link

civibot bot commented Aug 14, 2018

(Standard links)

@eileenmcnaughton
Copy link
Contributor

eileenmcnaughton commented Aug 20, 2018

@seamuslee001 @colemanw what do you think? I'm inclined to think we should just remove the lines in CRM_Utils_Address_BatchUpdate that add the link if we are going to then strip them out of our primary supported UI for these jobs. The function is only called from the api

$unparseableContactAddress[] = " Contact ID: " . $dao->id . " <a href =\"$url\"> " . $dao->street_address . " </a> ";

@colemanw
Copy link
Member

Why are we trimming the string in the first place? This isn't Twitter.

@seamuslee001
Copy link
Contributor

@colemanw the description column is a varchar255 and comment is Title line of log entry where as the data column is text so i think teh suggestion here is that the message we get back > 255 char or something.

@colemanw
Copy link
Member

Ok I believe this is better in than out, as it fixes the breakage.

@colemanw colemanw merged commit e79f71c into civicrm:master Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants