if "Trim this field to a maximum length" is checked and so is "Link this field to its user", the entire output link html is chopped down to the num of chars, not just the text.

Causes field to not display at all or with broken html.

I outsmarted it by using "Output this field as a link" with tokens instead. ( "user/[name]").

Probably just the wrong order of filters.

Comments

dsms’s picture

Priority: Normal » Critical

I second that!

this bug also appears if one checked "Rewrite the output of this field" and wrapped the content with an html-tag as it is especially suggested: "You may include HTML."
the closing html-tag is trimmed away.

bdwelle’s picture

+1
I just ran across this issue myself, and would love to get it fixed.

The code is in modules/views/handlers/views_handler_field.inc -> render_trim_text() , which itself calls _filter_htmlcorrector() to try to close tags, but that doesn't seem to be working properly.

merlinofchaos’s picture

Status: Active » Closed (won't fix)

The problem here is that when you link a field to its user, it goes through theme('username') to make sure that the viewing user has the access to visit a user profile. That means the link HTML has already been added by the time it comes time to trim. Therefore, the workaround you used is the only way to actually 'fix' this.

halloffame’s picture

dsms, you found any solution there? I'm experiencing the same problem. merlinofchaos said it isn't a bug and can't be fix. I need to wrap some html tag around that field. How will I be able to do this when it is being stripped? Waaa!

dsms’s picture

I think the only chance you have is to create a particular template file for this field and put your html into that.
I suppose the base to start would be views-view-field.tpl.php, just check out the "Theme: Information" in your
view.
Good Luck :)