joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.77k stars 3.65k forks source link

An error was detected in the breadcrumbs module #27866

Closed alex-90-rus closed 1 year ago

alex-90-rus commented 4 years ago

A bug was detected in breadcrumbs on the material output page in the com_tags component. There is a link to the same page you are on, and the last element in the module-the page title is pulled up.

Described the problem on the forum Your text to link here...

gerryfrancis commented 4 years ago

Is https://github.com/joomla/joomla-cms/pull/23599 related to your problem?

richard67 commented 4 years ago

23599 has been merged long before 3.9.15 was released, and according to the Forum Post Assistant (FPA) output in the forum post linked above in the description, the problem took place on a 3.9.15.

So the only explanation I have would be an outdated template override of the html view of com tags, which doesn't contain the fix from #23599 .

Or it is a related but not the same problem.

@alex-90-rus Could you check and report back if an override is the problem?

richard67 commented 4 years ago

I have set priority to medium on the issue tracker since this is neither a critical nor an urgent issue.

alex-90-rus commented 4 years ago

@richard67 I checked, the problem is not related to override.


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

richard67 commented 4 years ago

@alex-90-rus Could you post a screnshot so we all can understand the problem better?

alex-90-rus commented 4 years ago

@richard67 http://g.recordit.co/lpP9UiTK35.gif

alex-90-rus commented 4 years ago

By the way, in Joomla 3.9.2 there is no such error, I checked

richard67 commented 4 years ago

lpP9UiTK35

richard67 commented 4 years ago

@brianteeman Since you had made PR #23599 and that has been released with 3.9.3 and the issuer here sais here that in 3.9.2 he did not have this error: Could you check if PR #23599 might have caused the issue here (if it is an issue)?

brianteeman commented 4 years ago

Sorry but I do not see what the issue is.

alex-90-rus commented 4 years ago

@brianteeman A bug was detected in breadcrumbs on the material output page in the com_tags component. There is a link to the same page you are on, and the last element in the module-the page title is pulled up.

alex-90-rus commented 4 years ago

@brianteeman The title tag is displayed last, not the menu item

brianteeman commented 4 years ago

This is what I have - I dont understand the problem

tag

alex-90-rus commented 4 years ago

what version of joomla did you test on?


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

brianteeman commented 4 years ago

3.9.15

richard67 commented 4 years ago

Are only the breadcrumbs wrong, and the URL used in the browser is correct? Or is the URL wrong, too?

alex-90-rus commented 4 years ago

Posted on the test site http://k3axapkb.bget.ru/ When you click on the "Tagged Items" menu item, you can see that the url is formed correctly /article-1/tagged-items.html, but Tag 1 will appear in breadcrumbs. The last item must be " Tagged Items" Also, if you fill in the "Browser Page Title" in the admin panel, this will be the last element of breadcrumbs.

alex-90-rus commented 4 years ago

OR8KyYIYGF

brianteeman commented 4 years ago

Ah - I think I understand you now.

What happens if you go to the breadcrumbs module and change the setting "show last" to no

image

alex-90-rus commented 4 years ago

http://k3axapkb.bget.ru/article-1/tagged-items.html

richard67 commented 4 years ago

@alex-90-rus Did you check the settings of the breadcrumbs module as asked by @brianteeman in his previous comment?

See the option in question marked with a red frame in following screenshot (if your backend language is Russian, the setting should apear at the same place as in the English version, i.e. the 4th from top = the 2nd from bottom of that page in the settings:

74379549-eb5ce180-4ddf-11ea-8034-9213b8a7c68f

If you haven't done that yet, please check and report back here what the value currently is, "yes" or "No", and if it is "Yes", please change to "No" and test if the breadrcumps module does what you want or not, and report back here the result.

Please test also if the behavior of the breadcrumps module for other pages like the one with which you have the problem is still ok.

After that test, change the setting back to like it was before the test, if it was "No" before and if the result with "Yes" is not what you want.

alex-90-rus commented 4 years ago

I set in the settings - hide the last element in the pathway. Now the last item corresponds to the menu item I clicked " Tagged Items" http://k3axapkb.bget.ru/article-1/tagged-items.html But I need the last element in the pathway on other pages and it shouldn't be a link

richard67 commented 4 years ago

@brianteeman I think the "problem" for the issuer came with your PR #23599 ... not that it was wrong, I think it does the right thing, but it changed things for the issuer. To me it is significant that your PR was merged into staging after release of 3.9.2 and before 3.9.3, and the issuer wrote in the discussion that with 3.9.2 he doesn't have his "problem". Could you confirm that? And could it be that the change from PR #23599 shouln't have effect in every case, e.g. not when browser page title is set? Or could it be related to routing? I wouldn't bother you if I was not sure that you are the best expert to check that.

@alex-90-rus As a workaround you could do following: Make another, 2nd breadcrumbs module, so you have 2 breadcrumbs modules. In one of them you switch "Show Last" to "No", in the other one you switch it to "Yes". The first one you assign to all pages where you don't want to show the last item, e.g. because you have a page title or because it is the case which you have described in your issue with coming from the "Tagged items" page. The second one you use everywhere else where you want to show the last item. If you don't have too many pages, it could be a good workaround. Let us know if that would work for you so this issue here is less urgent.

alex-90-rus commented 4 years ago

The problem remains that the last element will be a link. There was no such error in Joomla 3.9.2.


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

alex-90-rus commented 4 years ago

I updated Joomla to version 3.9.2. Now everything works correctly. Look at this http://k3axapkb.bget.ru/article-1/tagged-items.html


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

maciejczub commented 4 years ago

I can confirm the presence of this problem in Joomla! 3.9.16. I attach a screenshot with the value of variable $list from mod_breadcrumbs.


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

maciejczub commented 4 years ago

Screenshotscreen shot 2020-03-23 at 14 26 25


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

zero-24 commented 4 years ago

Hi where do you get that report from?

maciejczub commented 4 years ago

I created a template override for mod_breadcrumbs and added print_r($list). There is evidently one element too many in this array.

zero-24 commented 4 years ago

can you please set this up with the core template and en-GB and than with the print_r i don't understand that text as it is not in my language. Thanks!

maciejczub commented 4 years ago

Sure. Screen from the fresh Joomla installation: screen

maciejczub commented 4 years ago

Array should be: Array ( [0] => stdClass Object ( [name] => Home [link] => /wzdw/demo/ ) [1] => stdClass Object ( [name] => News [link] => /wzdw/demo/news ) [2] => stdClass Object ( [name] => Demo tag articles [link] => ) )

zero-24 commented 4 years ago

well that how jrouter works as far as i know. Maybe @Hackwar can take a look here. But when there is a menu entry for the artice tags it get loaded not sure whether this can be done differen.

richard67 commented 4 years ago

@zero-24 Just for you as info because that might be hidden at the beginning of this issue. It was working well for the author of this issue before #23599 was merged. Not sure if that is related.

zero-24 commented 4 years ago

Correct there was the change done, but as said above the current behavior looks like the expected one. I'm not sure whether it makes sense to introduce another option to this?

maciejczub commented 4 years ago

When user is adding single submenu item (link to a specific tag), breadcrumb should just show this as single submenu item, without link. Not as two nested items - first linked and named as menu item, and second not linked and named as tag name. This does not seem to be expected.

gerryfrancis commented 4 years ago

To me in regard of being a user, the breadcrumb function does not make sense the way it works now. Why would anybody want to click on a link that basically loads the same site again? That is what reloading the site by the browser is for.

alex-90-rus commented 3 years ago

I found a solution to the problem:

In the file components/com_tags/views/tag/view.html.php, on about line 302, this code causes the last breadcrumb to be duplicated. $pathway->addItem($title);

If you delete it, then the problem is solved

joomdonation commented 1 year ago

PR https://github.com/joomla/joomla-cms/pull/39331 should fix this issue. Unfortunately, we will only have it fixed for Joomla 4 because Joomla 3 is now in maintenance mode and will only receive security bugs fixes. Please help testing. Thanks !

gerryfrancis commented 1 year ago

A backport would have been fair enough, the issue was reported almost three years ago. Anyway, not relevant to me anymore...

joomdonation commented 1 year ago

@gerryfrancis Sorry, there won't be a backport because the project decided that Joomla 3 will only receives security fix from now on. Once the solution is accepted, I can submit the modified file for Joomla 3 here in case someone needs it.