You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The nav items shown in the content manager aren't filtered properly. In particular collection nav items from journal A can be seen in the content manager for journal B
Janeway version
clean install from current master
To Reproduce
Steps to reproduce the behavior:
Install janeway with 2 journals
The table journal_issuetype contains 4 rows
id=1: issue for journal A
id=2: collection for journal A
id=3: issue for journal B
id=4: collection for journal B
The table cms_navigationitem is empty.
3. Open the content manager for journal A, toggle collection nav.
cms_navigationitem now has a single row with object_id=2
4. Open the content manager for journal B
You see the collection nav item from journal A...
Additional context
In cms/views.py there is
@editor_user_required
def nav(request, nav_id=None):
...
top_nav_items = models.NavigationItem.objects.filter(content_type=request.model_content_type,
object_id=request.site_type.pk,
top_level_nav__isnull=True)
...
object_id=request.site_pk ist wrong, for journal B the value is 2 which is the same as id for journal A's collection in journal_issuetype. For journal B we need 3 here to get the correct nav items, so maybe replace by something like
issue_type = journal_models.IssueType.objects.get(journal=request.site_type.pk, code='issue')
top_nav_items = models.NavigationItem.objects.filter(content_type=request.model_content_type,
object_id=issue_type.pk,
top_level_nav__isnull=True)
The text was updated successfully, but these errors were encountered:
hi @Beethro we will be totally revamping the CMS system as part of 1.3.8, I've noted this issue in #509 to ensure that the new system filters all nav items properly.
Describe the bug
The nav items shown in the content manager aren't filtered properly. In particular collection nav items from journal A can be seen in the content manager for journal B
Janeway version
clean install from current master
To Reproduce
Steps to reproduce the behavior:
The table journal_issuetype contains 4 rows
id=1: issue for journal A
id=2: collection for journal A
id=3: issue for journal B
id=4: collection for journal B
The table cms_navigationitem is empty.
3. Open the content manager for journal A, toggle collection nav.
cms_navigationitem now has a single row with object_id=2
4. Open the content manager for journal B
You see the collection nav item from journal A...
Additional context
In cms/views.py there is
@editor_user_required
def nav(request, nav_id=None):
...
top_nav_items = models.NavigationItem.objects.filter(content_type=request.model_content_type,
object_id=request.site_type.pk,
top_level_nav__isnull=True)
...
object_id=request.site_pk ist wrong, for journal B the value is 2 which is the same as id for journal A's collection in journal_issuetype. For journal B we need 3 here to get the correct nav items, so maybe replace by something like
issue_type = journal_models.IssueType.objects.get(journal=request.site_type.pk, code='issue')
top_nav_items = models.NavigationItem.objects.filter(content_type=request.model_content_type,
object_id=issue_type.pk,
top_level_nav__isnull=True)
The text was updated successfully, but these errors were encountered: