Problem/Motivation
With a microsite enabled, adding a child node at a depth of 9 or more triggers the following error:
Drupal\Core\Entity\EntityStorageException: The link with ID entity_hierarchy_microsite:88540548-85f7-4ff2-b7db-324a5dbac241 or its children exceeded the maximum depth of 9 in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()
Steps to reproduce
- Create a microsite
- Add children down to a depth of 8
- Adding more children triggers the above error
Proposed resolution
The microsite module should perhaps not create more menus after the depth limit is reached. Perhaps even alert the user that the maximum depth has been reached. I'll dig into this and have a patch soon-ish.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3212448-6.patch | 6.87 KB | larowlan |
| #6 | 3212448-6-interdiff.txt | 3.38 KB | larowlan |
| #5 | interdiff_5.txt | 3.39 KB | markgp |
| #5 | 3212448-max-depth-5.patch | 6.95 KB | markgp |
| #3 | 3212448-max-depth.patch | 4.64 KB | markgp |
Comments
Comment #2
larowlan+1 to that approach
Great find, thanks
Comment #3
markgp commentedComment #4
larowlanCouple of minor things, but this looks solid - thanks
This class uses dependency injection, can we inject this instead of using the global \Drupal singleton
can we keep the continues here, and avoid using else
Comment #5
markgp commentedComment #6
larowlanFixing a whitespace issue and keeping the argument order the same just in case
We can avoid another else here too.
If this passes will cut a new release
Comment #8
larowlanThis will go out as 3.0.2 shortly
Thanks for your contributions
Comment #9
larowlanhttps://www.drupal.org/project/entity_hierarchy/releases/3.0.2