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

Adding multiple nav items adds all but the last selected #68

Closed
missmatsuko opened this issue Feb 5, 2019 · 4 comments
Closed

Adding multiple nav items adds all but the last selected #68

missmatsuko opened this issue Feb 5, 2019 · 4 comments

Comments

@missmatsuko
Copy link

Description

When I try to add multiple items to the navigation, the last one is not added.

Steps to reproduce

  1. Go to a navigation
  2. Click 'Add an entry'
  3. Click an entry once. Press shift and click another entry a few rows down. This will highlight multiple entries. In my case, I highlighted the first/top 4 entries.
  4. Click 'Select'.
  5. Only 3 items (number selected - 1) appear in the navigation. The last/lowest one was not added.

Additional info

  • Plugin version: 1.0.18
  • Craft version: 3.0.40
@engram-design
Copy link
Member

Thanks for this, although struggling to reproduce this one on my end. I don't suppose this is a multi-site? Is it also doing it for other elements (as a test)? Also, tried in different sections?

And lastly, does this happen all the time, consistently?

@missmatsuko
Copy link
Author

My site isn't multi-site, and I only have one section right now. I tried with different entries in that section, though.

It happens most of the time, but not super consistent. I think it happens most when I add multiple items to an empty nav.

Sometimes it works but the visible list doesn't update, but then I see all the items if I refresh the page.

Also noticed some weird stuff when I try to add an entry that's already in the navigation. Some items get added, but some don't. Should I be able to add multiple links to the same page in a nav?

I did notice these errors in the console when it didn't add the last item of the selection:

POST {siteUrl}/index.php?p=admin/actions/navigation/nodes/save-node 500 (Internal Server Error)

navigation.js:168 Uncaught TypeError: Cannot read property 'success' of null
    at s.constructor.<anonymous> (navigation.js:168)
    at i (jquery.js:496)
    at Object.error (Craft.js:361)
    at c (jquery.js:3317)
    at Object.fireWith [as rejectWith] (jquery.js:3447)
    at l (jquery.js:9274)
    at XMLHttpRequest.<anonymous> (jquery.js:9514)

And the error in network for navigation.js:

{"error":"Unable to acquire a lock for the structure 58"}

The formdata sent for that error:

navId: 5
siteId: 1
elementId: 219
elementSiteId: 1
title: Blog
url: {siteUrl}/blog
type: craft\elements\Entry
newWindow: 
parentId: 0

@engram-design
Copy link
Member

Thanks @missmatsuko that's super helpful. I believe I've fixed one of those issues (the list doesn't show like it adds new nodes if you first remove all of them).

You should definitely be able to add the same entry/etc to a nav multiple times.

The error is interesting, and might be the root of your issues. I'll need to do some investigating here. Might be similar to craftcms/cms#2958 and craftcms/cms#3148

@engram-design
Copy link
Member

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants