verbb / navigation

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

Invalid SiteId #179

Closed apt-thomas closed 4 years ago

apt-thomas commented 4 years ago

Description

After upgrading to Craft 3.5, the plugin fails with "Invalid site ID: 26656" where site ID is something else than any of my site ids.

Steps to reproduce

  1. Content type structure
  2. An article in the structure is connected to a menu.
  3. Edit and save the article.

Additional info

Additional context The exception occurs because the function getElementSiteId() returns en invalid site id: https://github.com/verbb/navigation/blob/craft-3/src/elements/Node.php#L157

I have checked my db and the slug-field in the elements_sites table doesn't always contain a site ID. It is both site ID, other ID and strings.

I have made a local patch where i return $this->siteId instead, which seems to work, but I am not sure if that is the right fix.

ghost commented 4 years ago

I can confirm the behavior. I'm also on Craft 3.5.1, latest Navigation and in a multisite (multilang) configuration. I'm not able to save entries unless I deactivate the Navigation plugin.

engram-design commented 4 years ago

Looking into a fix for this, definitely a 3.5 change with Craft's elements overtaking the elementSiteId property we're using.

brandonkelly commented 4 years ago

Just released Craft 3.5.2 which fixes the underlying elementSiteId property conflict. Josh said he’s working on a migration to fix existing sites that have been affected by this bug, but if you are able to restore a pre-Craft 3.5 backup, you could just restore that and update to 3.5.2+, and be good to go.

engram-design commented 4 years ago

Thanks @brandonkelly for being so accommodating!

engram-design commented 4 years ago

Should be fixed in 1.3.24