c_CategoryPath is used to build a breadcrumbs. Usually they consists from following components:
- Path > To > The > Category
- Item Name (e.g. Link/Product/etc)
- Custom Template
When you don't want the strip first N elements from it, then
shift parameter comes in handy. However it turns out that, when the 2 (or larger) value is used then links to the categories point back to homepage instead of corresponding category pages.
Here is the code which handles
shift parameter and creates a problem:
array_splice function removes first N categories from the array, but as a side effect resets indexes in the array, which are used to identify categories later on.