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

Navigation between Articles with different Access Levels in same Category not working #5685

Closed
pe7er opened this issue Jan 12, 2015 · 2 comments

Comments

@pe7er
Copy link
Contributor

pe7er commented Jan 12, 2015

Steps to reproduce the issue

In short: Create a couple of Articles in the same Category, but with different Access Levels. Create a menu item of Category Blog. Login into the website, go to the "Category Blog" Menu Item and check that all new Articles are there. Open an Article and notice that you cannot use "Previous" and "Next" to navigate to all Articles in the same Category, but only to the ones that have the same Access Level.
screen shot 2015-01-12 at 08 03 28

Long description to reproduce the issue:

Create a new User Group: test-usergroup
Group Parent = "Public" (I have also tested it with Group Parent = "Registered"
(Users > Groups > New)

Create a new Access Level: test-userlevel
and "User Groups Having Viewing Access" add "test-usergroup"
(Users > Access Levels > New)

Create a new User: test
& assign to groups: Registered & test-user

Create a new Category: navigation-test
(Content > Category Manager > New)

Create a 2 new articles in "Navigation-test"
with intro + readmore + full text
and Access: Public
(Content > Category Manager > New)

Create a 2 new articles in "Navigation-test" accessible by "test-user" group.
with intro + readmore + full text
and Access: test-userlevel
(Content > Category Manager > New)

Create a new menu item "test-catblog" in main menu of type Category Blog,
and choose category: navigation-test
(Menus > Main Menu > New > Menu Item Type = Articles, Category Blog & Choose a category = "navigation-test")

Test front-end:

  1. Do not log in into the Front-end, click menu item "test-catblog", and see 2 Articles. Open one Article and see "Next" or "Previous".
  2. Log in into the Front-end with user "test" (from Group: test-usergroup), and see 4 Articles (the 2 public + the 2 assigned to Access Level "test-userlevel". Open an Article and notice that you cannot navigate between all 4 Articles (that are in the same Category, but with different Access Levels).

Expected result

I expected to be able to navigate with "Previous" & "Next" among all the Articles within the same Category as the Article you are reading.

Actual result

You can only navigate between Articles that are from the same Category AND have the same Access Level.

screen shot 2015-01-12 at 08 03 28

screen shot 2015-01-12 at 08 03 28

System information (as much as possible)

Additional comments

@pe7er
Copy link
Contributor Author

pe7er commented Jan 12, 2015

After investigating somewhat more I have found the cause of the problem:
Article 1 + Article 2 have "[access] => 1" (1 = ACL: Public)
Article 3 + Article 4 have "[access] => 7" (7 = ACL: test-userlevel)

The Pagenavigation "Prev" and "Next" is added by the Plugin "Content - Page Navigation".

In /plugins/content/pagenavigation/pagenavigation.php line 137 - 143 the following SQL is defined:
$query->select('a.id, a.title, a.catid, a.language,' . $case_when . ',' . $case_when1)
->from('#__content AS a')
->join('LEFT', '#__categories AS cc ON cc.id = a.catid')
->where(
'a.catid = ' . (int) $row->catid . ' AND a.state = ' . (int) $row->state
. ($canPublish ? '' : ' AND a.access = ' . (int) $row->access) . $xwhere
);
If I remove the . ($canPublish ? '' : ' AND a.access = ' . (int) $row->access) then I can browse between all 4 articles. But if you are not logged in, browsing from article 2 to 3 gives an "You are not authorised to view this resource" error (which is ok).

This means that the Pagenavigation "Prev" and "Next" buttons are determined by $row->access (the "access" level of the opened Article), and not on basis of the ACL level/group of the User (only indirectly because the users ACL is checked when they open the Article).


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

@pe7er
Copy link
Contributor Author

pe7er commented Jan 13, 2015

PR: #5698

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

3 participants