Problem/Motivation
There are cases (at least in our setup) which the sfc_unique_id is not actually unique when SFCs are nested within eachother. I think this has to do with how twig templates handle variables that are present in both inner and outer embed/include templates. Going to create a MR that helps to ensure that nested SFCs reliably get assigned their own unique ID as opposed to inheriting from the parent.
Steps to reproduce
Embed/include an SFC inside of another {% embed "sfc--foo.html.twig" %}.
Proposed resolution
Track generated unique IDs in a static variable to help ensure that all IDs are truly unique.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3309555-5.patch | 2.65 KB | samuel.mortenson |
Issue fork sfc-3309555
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mrweiner commentedComment #4
samuel.mortenson@mrweiner Nice issue. I think you can get around this by using the "only" keyword but your fix seems like a good idea.
Comment #5
samuel.mortensonAdded tests, fixed PHPCS errors.
Comment #6
samuel.mortensonTest failures appear to be a core bug:
Ref #2531564: Fix leaky and brittle container serialization solution
Comment #8
samuel.mortensonThanks again!
Comment #9
samuel.mortensonI've just released 8.x-1.8 as well if you'd like to update.
Comment #10
mrweiner commentedYeah I actually came across
onlyafter I opened this. We're now using it to address a variety of inheritance issues, but glad this was helpful nonetheless!