? Success

User tests: Successful: Unsuccessful:

avatar masters1333
masters1333
12 Jun 2014

As an extension developer I sometimes include HTML in the description for better presentation in the administrator. When a new module is created the HTML is displayed in the new module screen which not only looks bad but does not provide the user a brief description of the module. I will create a pull request for the changes.

http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33854

avatar masters1333 masters1333 - open - 12 Jun 2014
avatar masters1333 masters1333 - change - 12 Jun 2014
Labels
avatar masters1333 masters1333 - change - 12 Jun 2014
Labels Added: ?
avatar Kubik-Rubik
Kubik-Rubik - comment - 27 Jul 2014

@masters1333 Works as described. Thank you!

avatar roland-d
roland-d - comment - 31 Jul 2014

@test: Successful, after applying the patch the description no longer contains the tags and is displayed as expected.

avatar brianteeman brianteeman - change - 1 Aug 2014
Labels Added: ?
avatar brianteeman brianteeman - change - 1 Aug 2014
Labels Added: ?
avatar Bakual
Bakual - comment - 7 Aug 2014

I think you should only use strip_tags for the $short_desc.
The $desc is used in the tooltip where tags are parsed perfectly fine when escaped.
Also it will break the tooltip, if there is a double quote (") in the description, which currently works perfectly fine.

Setting back to in progress.

avatar Bakual Bakual - change - 7 Aug 2014
Labels Removed: ?
avatar Bakual Bakual - change - 7 Aug 2014
Labels Removed: ?
avatar roland-d
roland-d - comment - 7 Aug 2014

A double quote doesn't work fine in the current code. I think the only change needed is to update the current PR with this line instead of the proposed $desc.

$desc   = str_replace('"', '', ((JHTML::_('string.truncate', (strip_tags($item->desc)), 200))));

The idea behind it is that only the double quotes need to be removed from the left over description as these mess up the markup.

Any other ideas are welcome of course. Tested this with the provided module in the JC tracker and changing the description in there.

avatar Bakual
Bakual - comment - 7 Aug 2014

A double quote doesn't work fine in the current code.

Works fine for me. I just double checked in my testing installation. I wouldn't remove them if there is no reason.
What is the issue with using $this->escape for $desc (which is used in the tooltip)? The tracker only talks about a problem with the $short_desc.

The only Issue I see is that it could potentially generate invalid markup because we only use the first 200 characters there. This may break the tooltip layout in that the text goes outside and the like. On the other hand formattings and quotes would be preserved.

avatar roland-d
roland-d - comment - 9 Aug 2014

Agree with @Bakual we need to keep the $this->escape in the code as well. So the new code will look like this:

$desc   = JHTML::_('string.truncate', ($this->escape(strip_tags($item->desc))), 200);
$short_desc = JHTML::_('string.truncate', ($this->escape(strip_tags($item->desc))), 90);

The only Issue I see is that it could potentially generate invalid markup
I tested this and Joomla! handles it well because it doesn't break in the middle of a word within quotes.

avatar brianteeman brianteeman - change - 21 Aug 2014
Status New Pending
avatar nicksavov nicksavov - change - 21 Aug 2014
Labels
avatar nicksavov nicksavov - change - 21 Aug 2014
Labels Removed: ?
avatar brianteeman brianteeman - change - 1 Sep 2014
Category Modules
avatar brianteeman brianteeman - change - 19 Sep 2014
The description was changed
avatar roland-d
roland-d - comment - 27 Feb 2015

@masters1333 Could you please update your PR with the final changes as pointed out? Thanks.

avatar zero-24
zero-24 - comment - 3 May 2015

@masters1333 i have just send you a PR with the changes that @roland-d suggested. I hope you can review and merge so we can move this issue forward. Thanks :smile:

PR is: masters1333#1

avatar zero-24 zero-24 - close - 31 May 2015
avatar zero-24
zero-24 - comment - 31 May 2015

New PR with the changes here: #7087

avatar zero-24 zero-24 - change - 31 May 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-05-31 08:31:21
Closed_By zero-24
avatar zero-24 zero-24 - close - 31 May 2015
avatar Bakual Bakual - reference | 0f69b1f - 12 Jun 15
avatar zero-24 zero-24 - reference | 5907423 - 12 Jun 15
avatar Bakual Bakual - change - 14 Jun 2015
Milestone Added:

Add a Comment

Login with GitHub to post a comment