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

collection nav item spills over to other journal #1391

Closed
Beethro opened this issue Jan 12, 2020 · 1 comment
Closed

collection nav item spills over to other journal #1391

Beethro opened this issue Jan 12, 2020 · 1 comment
Labels
bug Something's not working

Comments

@Beethro
Copy link
Contributor

Beethro commented Jan 12, 2020

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:

  1. 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)

@Beethro Beethro added the bug Something's not working label Jan 12, 2020
@ajrbyers ajrbyers added this to the 1.3.8 milestone Jan 13, 2020
@ajrbyers
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's not working
Projects
None yet
Development

No branches or pull requests

3 participants