Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong URL when search sub-category by tag if SEF is on #4314

Closed
oneumyvakin opened this issue Sep 21, 2014 · 8 comments
Closed

Wrong URL when search sub-category by tag if SEF is on #4314

oneumyvakin opened this issue Sep 21, 2014 · 8 comments

Comments

@oneumyvakin
Copy link

Steps to reproduce the issue

  1. Enable SEF.
  2. Create "category1" with ID 1 and alias "alias1"
  3. For "category1" create child "category2" with ID 2 and alias "alias2"
  4. Create "tag1" and assign it to "category2"
  5. Try to search by "tag1"

Expected result

In search result there will be right URL to "category2" like:
/index.php/component/content/category/1-alias1/2-alias2
or
/index.php/component/content/category/2-alias2
or
/index.php/component/content/category/alias1/2-alias2
or
/index.php/component/content/category/2-alias1/2-alias2

Actual result

In search result category2 has a wrong URL which gives 404 error
/index.php/component/content/category/2-alias1/alias2

System information (as much as possible)

Joomla 3.3.3
PHP 5.4

Additional comments

only if SEF is On
only if search by tag

@Kubik-Rubik
Copy link
Member

I can confirm this issue. Set to "Confirmed"!

PS: The plugin "Search - Tags" has to be activated manually first.

This comment was created with the J!Tracker Application at http://issues.joomla.org/.

@oneumyvakin
Copy link
Author

This patch works for me:

--- "components/com_content/router.php"
+++ "components/com_content/router.php"
@@ -171,7 +171,7 @@ class ContentRouter extends JComponentRouterBase

        if (!$advanced && count($array))
        {
-               $array[0] = (int) $catid . ':' . $array[0];
+               $array[count($array)-1] = (int) $catid . ':' . $array[count($array)-1];
        }

        $segments = array_merge($segments, $array);

@Kubik-Rubik
Copy link
Member

@oneumyvakin Please do a PR (Pull Request) with the fix so that we can check it and get it into the core!

@oneumyvakin
Copy link
Author

Viktor, is there some tutorial how to create PR request to GitHub project from TortoiseGIT? I've tries last day but with no luck.

@Kubik-Rubik
Copy link
Member

@oneumyvakin

I use the build-in functionality of PhpStorm to connect with GitHub. In the Docs we have a general description how to do a PR: http://docs.joomla.org/My_first_pull_request_to_Joomla!_on_Github

See also here: http://docs.joomla.org/Portal:Joomla!_Code_Contributors/GitHub_Pull_Requests

Hopefully it helps you!

@nicksavov
Copy link
Contributor

For a small change like this, here's the easiest way by far:
http://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests

@brianteeman
Copy link
Contributor

Closed in favor of #4448

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

@jissues-bot
Copy link

Set to "closed" on behalf of @brianteeman by The JTracker Application at issues.joomla.org/joomla-cms/4314

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants