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

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

Closed
wants to merge 6 commits into from
Closed

Conversation

oneumyvakin
Copy link

@oneumyvakin oneumyvakin commented Oct 4, 2014

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

@infograf768
Copy link
Member

Did not test, but Code style should be:

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

                if (count($array) > 1)
                {
                    $array[count($array) - 1] = (int) $catid . ':' . $array[count($array) - 1];
                }
            }

@tairedweb
Copy link

@test it still said /index.php/alias1?view=form when i turnon SEF :D

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

@oneumyvakin
Copy link
Author

@tairedweb I can't get you.

/index.php/alias1?view=form - always gives 403

could you please create separate bug report with exact steps to reproduce?

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

@lunguyenhat
Copy link

@test It's working for me
@tairedweb I don't see any link as you talked

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

@tairedweb
Copy link

@oneumyvakin worked :D

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

@dimitargsg
Copy link

@test I also tested this and it seems that the patch is working properly. I was redirected to the correct category when I searched for tag1.

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

@AnishaTailored
Copy link

@test,
category link is redirected successfully, but when i click on the 'tag1'(index.php/component/tags/tag/2) which displays 'category2' link, when i click on the link(index.php/13-alias1/13-alias2), it give me "404 Article not found" error.

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

@haydenyoung
Copy link

I'm unable to replicate this problem. I created a search menu item to check this other than that I followed the steps to reproduce.

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

@oneumyvakin
Copy link
Author

@AnishaVora Yes, I can reproduce this. Start working to fix this.

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

@oneumyvakin
Copy link
Author

Fix is ready.

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

@roland-d
Copy link
Contributor

@Hackwar Is this not something you are also working on?

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

@brianteeman brianteeman removed the PBF14 label Jan 1, 2015
@MPompejus
Copy link

Added Patch and tried it the Problem still exist.
The ID for categorie 2 will set in the URL one step forward as id for categorie 1
http://127.0.0.1/bugtesting/index.php/component/content/category/79-alias1/alias2
number 79 is mine ID of categorie 2.


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

@kathastaden
Copy link

I tested it with Joomla version: 3.4.4-dev development

  • SEF is enabled
  • Patch was installed successful
  1. Created category1 (ID is set by system - mine is 78) with alias1

  2. Created category2 (ID is set by system - mine is 79) with alias2 and category1 as the parent

  3. Created a tag named tag1

  4. Assigned tag1 to category2

  5. Searched for tag1 and got this link as a result to category2:
    http://localhost/wpw2/bugtesting/index.php/component/content/category/79-alias1/alias2

  6. Still Error 404 - So the test was not successful

@roland-d
Copy link
Contributor

roland-d commented May 8, 2016

@oneumyvakin Can you follow up on the test results and make the needed changes to your pull request? Thank you.


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

@oneumyvakin
Copy link
Author

@roland-d to be clear, i've submitted this bug and patch two years ago for version 3.3.3, and it works for this version, and it was abandoned for the one year, and after the one year, on version 3.4.4, suddenly, fix became not working. This situation is not ok for me. So I've decide to do not contributing to Joomla any more.

@roland-d
Copy link
Contributor

roland-d commented May 8, 2016

@oneumyvakin Thank you for your response. The behavior you described happens when the same files you changed are changed by someone else. I will close this PR now as we have a new router merged for Joomla 3.6.

@roland-d roland-d closed this May 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet