News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

Issues with menu link to single category

Started by joltman, 21.09.2015 17:04:50

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

joltman

I was previously using 1.9 and am currently working on upgrading to 3.2 on a test site. I am having a problem with menu items. In my Joomla menu, I have links to categories that only users in specific Joomla groups can see, but the menu items themselves are public. The way it was working with 1.9 is that if you click on the link and you are not logged in, you are redirected to the login page.

I seem to be having two problems with this with 3.2. First, the menu links don't seem to be working if I point it to a single category that you need specific access to view, it just redirects you to the home page, regardless of whether you are logged in or not. In this case, if I'm logged in with the correct access and I go into the menu manager and copy the generated link and paste it, I go to the correct page, but just clicking the menu link takes me to the home page.

The other issue is, I'm not logged in and I either click on the menu link, or I copy and paste the generated link, I am taken to the home page and not the login page like I was with 1.9.
  •  

ColinM

Hi
Apart from the menu aspects did the migration itself go OK?  Also which version of jd1.9 were you running.
I am not so familiar with running jD1.9 series but I did think any redirection was to the login page.  I believe it was another extension that redirected.

Quoteif I point it to a single category that you need specific access to view, it just redirects you to the home page, regardless of whether you are logged in or not.
I think this is the correct action because if you do not have access to see the category then as far as that user is concerned that category does not exist.  I set up a situation as you described: menu has public access but category has view access of  'uploader_view' .  When not logged in and when logged in but not in a User Group that is included in 'uploader_view' then  in both cases it created a 404 error -see pic below.  This default 404 error handler is in my case provided by my hosting service and shows a suitable error message and has a button with a link to the home page.  Some 404 handlers will just redirect you to the home page instead of giving the error report. This can be in a .htaccess file or by one of the Joomla! extensions, also many templates provide their own error handlers.
Quote
if I'm logged in with the correct access and I go into the menu manager and copy the generated link and paste it, I go to the correct page, but just clicking the menu link takes me to the home page
Not sure I quite understand here.  I logged in with a user whose User Group was in 'uploader_view' access level. Clicking on the menu item took me as expected to the correct Category View.

Now the link in the menu is of the form index.php?option=com_jdownloads&view=category&catid=6 where in my case the id of the selected category is 6.  This link goes to jDownloads that then generates the relevant code.  The code generated code is of the form <a href="/name-of-cat">Name of Cat</a>
It is not a good idea to copy the link in the menu item.

Basically I believe you need to find out how your 404 errors and similar are handled.  Is it your hosting service, your .htaccess file, your template or in Joomla!

I hope this helps

Colin




[gelöscht durch Administrator]
Colin M
  •  

joltman

Quote from: ColinM on 21.09.2015 22:52:18
Hi
Apart from the menu aspects did the migration itself go OK?  Also which version of jd1.9 were you running.

We were running 1.9.2.11 Beta. I had a couple other issues, like 'Activate Hotlinking protection' getting turned back on even though it was off on the old version, and some of my subcategories somehow got under the root. But overall it went well.

Quote
I am not so familiar with running jD1.9 series but I did think any redirection was to the login page.  I believe it was another extension that redirected.
I think this is the correct action because if you do not have access to see the category then as far as that user is concerned that category does not exist.  I set up a situation as you described: menu has public access but category has view access of  'uploader_view' .  When not logged in and when logged in but not in a User Group that is included in 'uploader_view' then  in both cases it created a 404 error -see pic below.  This default 404 error handler is in my case provided by my hosting service and shows a suitable error message and has a button with a link to the home page.  Some 404 handlers will just redirect you to the home page instead of giving the error report. This can be in a .htaccess file or by one of the Joomla! extensions, also many templates provide their own error handlers.

Hmm, that's interesting. I don't remember specifically setting something up with 1.9 to redirect to a login page if they weren't logged in. I'll have to investigate that further.

QuoteNot sure I quite understand here.  I logged in with a user whose User Group was in 'uploader_view' access level. Clicking on the menu item took me as expected to the correct Category View.

Now the link in the menu is of the form index.php?option=com_jdownloads&view=category&catid=6 where in my case the id of the selected category is 6.  This link goes to jDownloads that then generates the relevant code.  The code generated code is of the form <a href="/name-of-cat">Name of Cat</a>
It is not a good idea to copy the link in the menu item.

The menu link looks like /index.php/downloads-link, which if I click on it just redirects to the homepage if I'm logged in with the correct permissions. The generated link looks like index.php?option=com_jdownloads&view=category&catid=6 and if I go to that URL, it goes to the category as it should. So for some reason, the alias doesn't work, but the URL the alias is pointing at does.

Quote
Basically I believe you need to find out how your 404 errors and similar are handled.  Is it your hosting service, your .htaccess file, your template or in Joomla!

I hope this helps

Colin
  •  

joltman

I just figured out part of my problem. The reason the menu link wasn't working corrected when logged in was a caching issue. Basically, I would click it when I wasn't logged in and it would redirect to the home page, so then once I logged in, my browser already cached the menu link as going to the home page. So my only issue at this point is figuring out what is redirecting you to the home page if you click on a link to a category that needs permissions that you don't have.
  •  

joltman

I found the 404 redirect extension that I was using and disabled it, and sure enough, if you click on the link without being logged in, you get a 404 error.

The thing is, I really don't remember setting anything up with 1.9 to get it to show the login page if you weren't logged in. Are you sure that 1.9 gave you a 404 by default if you weren't logged in?
  •  

ColinM

Hi
Thanks for update.
No I am not absolutely certain about what jD 1.9.x did but there is no setting that said it would divert to the login function on a 404 error.  Also there is nothing in the documentation.  Doing a redirect to somewhere in that circumstance is not within the scope of jDs activities.  About the only thing one can always know is the home page.  I will ask Arno.

I am certain however that jD 3.2 ,and jD 2.5, series do not redirect.

You also mentioned that 'Activate Hotlinking protection' got turned on.  I will look at that to see if jD does invert that setting.

Sometimes a template will have an error.php and Joomla! will use that in preference to the system error.php  There are some articles on 404 error handling in Joomla! docs which might help

Colin
Colin M
  •