? ? Pending

User tests: Successful: Unsuccessful:

avatar n9iels
n9iels
1 Nov 2015

About this PR

This PR solves a bug with the word count parameter of mod_feed. If you load a feed with HTML tags (for example: http://community.joomla.org/blogs/community.feed?type=rss) and set the word count to 20 there are way less than 20 words visible. The two things that cause this problem:

  • JHtml::_('string.truncate') counts the characters, not the words of the string
  • HTML tags like <a href="http://link.nl"> are counted too

This PR change the text of the parameter to Character count and I also adds strip_tags() for the character count.

Other changes in this PR are code style and some change to make the code more readably and logic.

Test instructions

  1. Make a mod_feed module and use http://community.joomla.org/blogs/community.feed?type=rss as Feed URL, set the RTL Feed paramter on "No" and all other parameters on "Yes" for now
  2. Set the "Word count" parameter on 20, and confirm the feed displays less than 20 words on the front-end
  3. Apply the patch, and confirm the parameter is now called "Character limit" and the amount of characters is better now (Maybe still not 20 characters, because the function don't cut words in half)
  4. Confirm all parameters are working like they use to do
  5. Install an RTL language (Persion for example), and test the "RTL Feed" parameter for this language. If "RTL Feed" is set to no, even on RTL languages the feed must be displayed LTR
avatar n9iels n9iels - open - 1 Nov 2015
avatar n9iels n9iels - change - 1 Nov 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Nov 2015
Labels Added: ? ?
avatar zero-24 zero-24 - change - 2 Nov 2015
Category Front End RTL
avatar zero-24 zero-24 - change - 2 Nov 2015
Labels
Easy No Yes
avatar Ruchiranga Ruchiranga - test_item - 14 Mar 2016 - Tested unsuccessfully
avatar Ruchiranga
Ruchiranga - comment - 14 Mar 2016

I have tested this item :red_circle: unsuccessfully on 61f6253

### Tested successfully

Tested unsuccessfully

avatar joomla-cms-bot
joomla-cms-bot - comment - 15 Mar 2016

This PR has received new commits.

CC: @Ruchiranga


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8230.

avatar joomla-cms-bot
joomla-cms-bot - comment - 15 Mar 2016

This PR has received new commits.

CC: @Ruchiranga


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8230.

avatar n9iels
n9iels - comment - 15 Mar 2016

@Ruchiranga Thanks for testing! Yes you're right, the RTL function wasn't working, I used a wrong variable. I also changed the label of the parameter to Character limit, that is a better label indeed.

Can you please test again, and confirm the problems are solved?

avatar Ruchiranga Ruchiranga - test_item - 16 Mar 2016 - Tested successfully
avatar Ruchiranga
Ruchiranga - comment - 16 Mar 2016

I have tested this item :white_check_mark: successfully on 607a440

* The amount of characters shown has become better. See
Before applying the patch and
After applying the patch.

avatar designbengel
designbengel - comment - 8 Apr 2016

I´m not sure if this breaks something on existing sites because even if the wordcount didn´t work right before
i don´t know if we can just change it to character limit?

Isn´t it better to fix the wordcount instead?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8230.

avatar brianteeman
brianteeman - comment - 13 Apr 2016

Changing from word count to character count will break peoples sites. Imagine I have it set to 10

before

my news feed of approximately ten words excepting html bug

after

my news fe

So with this change form word to character count it cannot be accepted.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8230.

avatar brianteeman brianteeman - change - 13 Apr 2016
Status Pending Information Required
Labels
avatar brianteeman
brianteeman - comment - 13 Apr 2016

If you want to update the PR to retain the word count then this can be tested otherwise I am afraid it will have to be closed


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8230.

avatar brianteeman brianteeman - change - 27 Apr 2016
Labels
avatar brianteeman brianteeman - change - 27 Apr 2016
Category Front End RTL Front End Language & Strings RTL
avatar brianteeman brianteeman - change - 8 May 2016
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2016-05-08 09:39:03
Closed_By brianteeman
avatar brianteeman
brianteeman - comment - 8 May 2016

Closed for the reason above


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8230.

avatar brianteeman brianteeman - change - 8 May 2016
Labels

Add a Comment

Login with GitHub to post a comment