Upgrading to version 3.1.22 breaks the website.
Versión de Drupal 9.5.7
---
Servidor web
LiteSpeed
---
PHP
Versión
8.1.17 (más información)
Límite de memoria
1G
---
Base de datos
Versión
10.3.38-MariaDB
Sistema
MariaDB
---
New fresh or existing installation when updating to version 3.1.22 breaks the website.
Cannot add any content, error:
Twig\Error\LoaderError: Template "__TwigTemplate_f69815c0a1e71e7a1db5a98e881cd2a6" is not defined. in Twig\Loader\ChainLoader->getCacheKey() (line 98 of /home/***user***/public_html/***site***/vendor/twig/twig/src/Loader/ChainLoader.php).
***user*** -> fake folder
***site*** -> fake folder
for security reazon.
Downgrading to version 3.1.21 solves the problem.
All make with composer.
Thancks.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | Screenshot 2023-07-20 at 6.13.52 PM.png | 147.85 KB | srinivasraod |
| #25 | Screenshot 2023-07-06 at 13.37.05.png | 100.16 KB | adrianliegmann |
Issue fork permissions_by_term-3354478
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 #2
goz commentedThis error occures on D9 installation, after updating to 3.1.22.
Here is the issue which introduce the regression https://www.drupal.org/node/3289053, especially https://www.drupal.org/project/permissions_by_term/issues/3289053#commen...
In src/Service/NodeEntityBundleInfo.php
Change has been made to follow Twig update in version 3.x. used by D10, which is different from D9 using version 2.x of Twig
loadTemplate definition for D10 using twig 3.x :
previous loadTemplate definition for D9 using twig 2.x :
In any cases loadTemplate method is defined as internal and should not be used by modules.
I suggest to use Drupal templates instead of low level integration.
Comment #4
goz commentedComment #5
izus commentedpatch in MR #3 worked well for me.
thanks
Comment #6
ady1503 commentedThank you very much for the reply.
Comment #7
pgn5qs commentedSame issue. Site broken by this update.
Comment #8
emmguyot commentedThe patch fixes the crash for me
Comment #9
goz commented@emmguyot can you create another issue for your case, so it can be resolved in it?
This issue is relative to twig update and loadTemplate method.
Thanks
Comment #10
greatmatter commentedThe patch works beautifully. Please roll this as a release; if anyone had the same issues we had, you'll save hours of debug time for other folks...
Comment #11
wheelercreek commentedI'm not seeing a patch here for version 3.1.22, is there one?
This is same issue I'm seeing as reported here:
https://www.drupal.org/project/permissions_by_term/issues/3289053#commen...
Comment #12
steveoriolI confirm that the patch : https://git.drupalcode.org/project/permissions_by_term/-/merge_requests/...
Works for me, thank you !
Comment #13
protitude commentedConfirmed this patch works on my site. Thanks!
Comment #14
zany commentedConfirmed this fix works with D9.5.8
@wheelercreek the patch is the drupalcode link above, or as plain diff it's
https://git.drupalcode.org/issue/permissions_by_term-3354478/-/commit/4d...
E.g. in composer.json under extras patches insert:
Comment #15
shyam-sawhneyThanks for Patch: https://git.drupalcode.org/project/permissions_by_term/-/merge_requests/....
Worked with D9.5.5
Comment #16
jepster_@fathima.asmat Would you please take a look on this?
Comment #17
rwam commentedPatch https://git.drupalcode.org/project/permissions_by_term/-/merge_requests/... worked for me too on D 9.5.9
Interesting finding: the issue only exists on our production environment. I've dumped the database from live for local investigation but cannot reproduce it locally.Sorry for confusion: I was on an outdated branch locally with version 3.1.21.Comment #18
somersoft commentedThanks for Patch: https://git.drupalcode.org/project/permissions_by_term/-/merge_requests/....
Worked with D9.5.8
Comment #19
ambient.impactI ran into a similar issue in #3361318: Fatal error from Twig when creating default target module in Drupal 10 where another maintainer had previously used the same Twig
loadTemplate()method and it failed spectacularly when moving to Drupal 10, which bumped the major Twig version from 2 to 3 and the method changed. While the merge request is a definite improvement, I'm a bit baffled about why the template file is still left in thesrc/View, or why it was put there in the first place, when it should be under atemplatesdirectory. If the problem is that it could conflict with other templates, then name it something likepermissions-by-term-node-details.html.twigand then just reference the template name without having to grab the path. That way it's possible for a theme or other module to build on the template and it keeps things tidy and where they should live.Comment #20
yurg commented#3354478-14: Regression updating to 3.1.22 for Drupal 9.x using loadTemplate from twig works
Comment #21
kris77 commentedI think it is necessary to update the module immediately with this patch.
Comment #22
marcoliverWhile https://www.drupal.org/project/permissions_by_term/issues/3354478#commen... is a valid remark, I think a release including the patch should be prioritized to get the regression fixed.
Rethinking / renaming the template can be done as a followup task.
Comment #25
adrianliegmann commentedHello,

I tested https://git.drupalcode.org/project/permissions_by_term/-/merge_requests/... patch and it works, but generate error in JS after select something, like on the screen.
I created a fix including a item type element: https://git.drupalcode.org/project/permissions_by_term/-/merge_requests/...
Comment #26
adrianliegmann commentedComment #27
joelseguinThanks @adrianliegmann - I've run into the same issue and applied the latest merge request (#25) and all seems to work perfectly fine now.
Comment #28
srinivasraod commentedAfter upgrading permissions_by_term to 3.1.22 and applying the patch https://git.drupalcode.org/project/permissions_by_term/-/merge_requests/...
I see JS error

Comment #29
srinivasraod commentedComment #30
leducdubleuet commented@srinivasraod I believe you did not apply the right patch. Can you try this one?
https://git.drupalcode.org/project/permissions_by_term/-/merge_requests/...
Comment #31
srinivasraod commented@LeDucDuBleuet Thank you!!
#30 worked for me
Comment #32
leducdubleuet commented@srinivasraod Great, glad I could help!
So I also reviewed and tested the merge request !25 with success and I think it is safe to put this issue to RTBC.
Thanks!
Comment #33
kreatil commented3.1.22 breaks functionality also in my case with drupal 9.5.10.
Cannot review the proposed solution because there is no patch provided here.Found it at last :-) The patch https://git.drupalcode.org/project/permissions_by_term/-/merge_requests/25.patch fixes it. Thanks.
Comment #34
davedg629 commentedIt's been over a month since a working patch was posted. Is one of the maintainers available to get this patch released?
Comment #36
marcoliverFixed in 3.1.24, thanks everyone!