?
Referenced as Pull Request for: # 5698
avatar pe7er
pe7er
12 Jan 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

avatar pe7er pe7er - open - 12 Jan 2015
avatar pe7er
pe7er - comment - 12 Jan 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.
avatar pe7er
pe7er - comment - 13 Jan 2015

PR: #5698

avatar brianteeman brianteeman - change - 13 Jan 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-01-13 00:52:20
Closed_By brianteeman
avatar brianteeman brianteeman - close - 13 Jan 2015
avatar zero-24 zero-24 - close - 13 Jan 2015
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment