verbb / navigation

A Craft CMS plugin to create navigation menus for your site.
Other
90 stars 23 forks source link

all nodes in all navigations gone after enabling and disabling propagation in one navigation #275

Closed joelstrom closed 2 years ago

joelstrom commented 2 years ago

We have a multi-site (5 languages), each site having 5-7 different navigations. While inputting content to a new navigation, we thought that it could be faster to just do the content input on one and then propagate that to all the other languages, instead of manually having to go through each. When toggling on the propagation, none of the content got propagated over to the same navigation for different site versions (bug?), but after toggling the propagation off again all of a sudden ALL nodes across ALL navigations and sites disappeared, not just for the navigation that we were configuring settings for! The nodes are not visible in admin and neither are they visible on the frontend, however we did notice that the content still exists in the database! This is obviously a critical error. Luckily this happened on staging, but all of our recent work including navigation related work is supposed to go to live tomorrow.

Steps to reproduce

  1. Multi-site setup with multiple navigations
  2. Go into settings for one navigation, toggle on propagation -> Nothing happens
  3. Go back to same navigation's settings and toggle off propagation -> All nodes across all navigations are gone

Additional info

What can we do to get back the data for all of our navigations?

joelstrom commented 2 years ago

Update: we managed to return the nodes to the admin from the database. The structure/order of them was wrong, but it was enough to get by.

Any idea what went wrong with the nodes disappearing after toggling propagation on one navigation?

engram-design commented 2 years ago

So turning on propagation is s tricky scenario we aren't taking care of, as it poses some issues. Namely, what if your other navigations contained nodes - they would be completely deleted (and un-recoverable), which I don't feel great about, and related to your issue about nodes being deleted unexpectedly.

As for your actual error, that totally shouldn't be happening, and frustratingly, I can't replicate it on a few installs, of varying different complexities, nested levels and multi-sites.

What turning off Propagate nodes across all enabled sites? will do is remove all nodes for every site (except the primary one), and then re-add new ones which are un-linked to the primary site's navigation. It's think linking and un-linked of nodes that's clearly tricky, but have spent some time trying to get right.

It's probably a little late now, but would've been great if you could supply the database at the time before (or after) the propagation toggling so I can replicate it.

andreasbecker commented 2 years ago

Update: we managed to return the nodes to the admin from the database. The structure/order of them was wrong, but it was enough to get by.

Any idea what went wrong with the nodes disappearing after toggling propagation on one navigation?

@joelstrom We have exactly the same problem except this just happened on a production server. Can you tell me how you managed to get the nodes back from the database?

engram-design commented 2 years ago

@andreasbecker Do you have a database and project backup from before your changes that you'd be willing to share so I can replicate this? As I've mentioned, I can't seem to get this behaviour to trigger on the many different install combinations I've tried, but would love to get to the bottom of it. Unfortunately, it'd need to be a backup from before your change, rather than now.

joelstrom commented 2 years ago

Unfortunately I am unable to share a database myself as it's a banking website, and I am not completely sure how we managed to get the nodes back as the person who did it has left the company some weeks ago! 😓 As mentioned earlier though, the nodes were still left in the database even if they disappeared from admin, so I am assuming the developer must have looked through the tables and perhaps mapped it again manually to the correct ids. (They did not succeed in returning the original structure/levels of the navigation, but luckily it's quite easy to reorder everything by dragging and dropping so this was not a huge issue for us.)

andreasbecker commented 2 years ago

@engram-design Hi Josh, I was able to reproduce this on a local setup. Just sent an email with a short video and database dumps before and after changing the propagation method.

engram-design commented 2 years ago

Thanks @andreasbecker I'll do my best to address this fix and report back

engram-design commented 2 years ago

Should be fixed in 1.4.24 - thanks very much @andreasbecker for your assistance.