Bug #30488
Wrong count in tagcloud if tag has special characters
| Status: | Closed | Start date: | 2011-09-30 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | Felix Nagel | % Done: | 0% |
|
| Category: | Bug | |||
| Target version: | - | Estimated time: | 0.50 hour | |
| Votes: | 0 |
Description
Tags that include special characters like German umlauts only receive a count of one. This is caused be encoding issues with the array key.
Fix:
Change line 125 in pi1/widgets/tagCloud/class.tagCloud.php from
$this->tagArray[$tag] = array(
to
$this->tagArray[$key] = array(
History
Updated by Felix Nagel over 1 year ago
Where to check "receive a count of one"?
Updated by Felix Nagel over 1 year ago
- Status changed from New to Needs Feedback
- Assignee set to Felix Nagel
Updated by Christian Hennecke over 1 year ago
Felix Nagel wrote:
Where to check "receive a count of one"?
Insert a var_dump statement in the rendering function. You will see that such tags are only counted once and the problematic index. The thing is that due to the encoding, the if statement in line 121 checks for an array element with an index that will never exist if special characters are involved. Hence, the existing element will be reset to 1. Changing line 125 from $tag to $key that the element has the expected index. As an alternative, you could make sure that the string conversion that takes place before has the expected result.
Updated by Felix Nagel over 1 year ago
- Estimated time set to 0.50
Ive checked this with latest t3blog 1.1.2, TYPO3 4.6.3 and PHP 5.3 without problems. Ive checked by using xdebug($this->tagArray); at the end of the main function.
Are you using non utf8 encoding? Version numbers?
Updated by Christian Hennecke over 1 year ago
Felix Nagel wrote:
Ive checked this with latest t3blog 1.1.2, TYPO3 4.6.3 and PHP 5.3 without problems. Ive checked by using xdebug($this->tagArray); at the end of the main function.
Are you using non utf8 encoding? Version numbers?
t3blog 1.1.0 with some own changes (that do not concern the tag cloud part) and later fixes manually applied, TYPO3 4.5.10, and PHP 5.2.13. Everything should be UTF-8. Currently, I'm on a vacation. I'll check when I'm at work again.
Updated by Dmitry Dulepov about 1 month ago
- Status changed from Needs Feedback to Closed
No feedback provided.