This is the error I was getting on node saves.
Notice: Undefined offset: 0 in Drupal\permissions_by_term\Controller\NodeEntityBundleController->getContentType() (line 94 of modules/contrib/permissions_by_term/src/Controller/NodeEntityBundleController.php).
Warning: assert(): Cannot load the "node" entity with NULL ID. failed in Drupal\Core\Entity\EntityStorageBase->load() (line 249 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).
Warning: array_flip(): Can only flip STRING and INTEGER values! in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 266 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).
I have path aliases setup to that instead of /node/ it shows as // (/someContentType/someTitle). And the edit turned out to be /someContentType/someTitle/edit. So when the code in NodeEntityBundleController was looking for a numeric value in the URL (ie /node//edit), it wasn't finding it and causing an error.
I'll post my patch shortly.
Comments
Comment #2
eahonet commentedthis patch is what I did to address the error.
Before this, I could reproduce by just saving a node that had a path like /urlAlias/path/edit and wasn't using /node/45/edit. No errors now.
Comment #4
jepster_@eahonet: Thanks for testing and sharing your patches! I have reviewed your patches and added them to the latest releases:
Drupal 9 version (3.1.5): https://www.drupal.org/project/permissions_by_term/releases/3.1.5
Drupal 8 version (8.x-2.28): https://www.drupal.org/project/permissions_by_term/releases/8.x-2.28
Comment #5
jepster_