Keyword

Magic numbers. Wrong some categories links

More
11 years 9 months ago - 11 years 9 months ago #108093 by Zupo
I have one category (Games) with subcategories (Gamesnames).

www.gamerno1.net/index.php?option=com_k2&view=itemlist&layout=category&task=category&id=1&Itemid=113

The settings of all categories is the same. But, links certain subcategories return to the parent category (Games). As soon as I change the alias name - everything works as it should. Below is a list of subcategories and their aliases.


Ancients of Ooga 91810
Anomaly Warzone Earth 91200
Cloning Clyde 91800
Dead Island 91310
Demolition, Inc. 98600
Dungeon Defenders 65800
Dungeons of Dredmor 98800
E.Y.E: Divine Cybermancy 91700
Hard Reset 98400
Jamestown 94200
Post Apocalyptic Mayhem 91900
Ravaged 96300
Revenge of the Titans 93200
Rise of Immortals 90530
Sanctum 91600
SkyDrift 91100
SpaceChem 92800
Spiral Knights 99900
The Elder Scrolls V: Skyrim 72850
Toy Soldiers 98300
Worms Ultimate Mayhem 70600
Xotic 92600


What is my problem? Thank you!


Update.
If you create a category with an alias: 91810, 91200, 91800, etc. .. category will refer to the parent category.

Whyyyyy? :silly:
Magic numbers ...

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago - 11 years 9 months ago #108094 by Zupo
I got it!
Joomla converts this numbers (91810, 91200, 91800, 91310, 98600....) to a different format.
(Because of this links is incorrect.)

I tried to change the field type to text on MySql, but it did not help.

I found a line in the file: "/components/com_k2/views/itemlist/view.html.php"

$child->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($child->id.':'.urlencode($child->alias))));

urlencode($child->alias) // is my "number alias"

change to
(string)$child->alias
or
strval($child->alias)

does not help(((

How to solve this problem?
:(

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #108095 by Zupo
I solved the problem.
I removed

urlencode($item->alias)

everywhere
and all earned the right

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum