Every node (also without this access category) makes such a error message when trying to edit.
Fatal error: Call to undefined method Drupal\Core\Template\TwigEnvironment::load() in /home/users/.../modules/permissions_by_term/src/Service/Info.php on line 61
P.S. And it's just after installation of the module, even without making a category for it.
Comments
Comment #2
Andrzej7 commentedComment #3
jepster_Does Drupal\Core\Template\TwigEnvironment exist on your Drupal site? Have you hacked the core? Which Drupal 8 version do you have?
Pozdrawiam
Comment #4
Andrzej7 commentedno there's not such a file not even catalog Template
I haven't hacked the core, but installed some modules
Drupal 8.3.1
Pozdrawiam również :-)
Comment #5
Andrzej7 commentedComment #6
jepster_Your Twig version is outdated.
Run "composer update" in your Drupal project folder.
Comment #7
jepster_Comment #8
Andrzej7 commentedThanks, Peter,
I've updated Drupal to 8.3.6. and it all works.
P.S. I can't operate Composer.
Comment #9
Andrzej7 commentedSorry, Peter, problem is again.
After upgrading to Drupal 8.3.7 I have the same error
Fatal error: Call to undefined method Drupal\Core\Template\TwigEnvironment::load() in /modules/permissions_by_term/src/Service/Info.php on line 61on all 3 sites!
They are quite fresh sites, no differences in modules
PHP 5.6, PostgreSQL
No such a cataloge: Core\Template\ in any of the sites...
Problem stops after uninstalling the module.
P.S. Problem is also with content types not allied with the access taxonomy
Comment #10
jepster_As I have wrote: execute the "composer update" terminal command in your D8 project. Composer is a dependency of Drupal. Composer provides PHP packages, which are dependencies from the Drupal setup.
If you cannot use Composer, than you cannot keep your setup up to date and secure and you have a problem.
If you need to learn about Composer, then check this page: https://getcomposer.org/doc/00-intro.md
Comment #11
Andrzej7 commentedSorry, but I'm not a programmer.
So the module does not work on fresh Drupal site without additional intallations?
Comment #12
jepster_You could use this version of PbT: https://www.drupal.org/project/permissions_by_term/releases/8.x-1.21
Only draw-back is, that you have no permission information block on node edit form.
It has nothing to do with being a programmer. If you cannot run "composer update", you cannot keep your Drupal site up to date.
Comment #13
Andrzej7 commentedThank you for your assistance, but using outdated versions of module is not a solution for my site.
For me it's the first time, when I hear that fresh version of Drupal is "not up to date". Using Drupal lot of years.
Drupal.org says:
Thank you for your work and assistance, but I think that it'd be useful to make an info on the module'page, that it doesn't work without composer. It can save time for people not using the composer or other stuff.
Thank you for your work, it's a pity, I can't use the module, although I need such a lot. :-(
Comment #14
jepster_Drupal 8 is very different from Drupal 7/6. So you need to use composer to maintain your site. By download of Drupal 8 you get composer packages. But they will be outdated after a certain time. Drush does not update them for you. Only composer does.
I will check if there is a way to update the module to work with the current D8 state from download. So long I would suggest you, to stick with https://www.drupal.org/project/permissions_by_term/releases/8.x-1.21 for now, if you need it. This version is ok. There is nothing critical, which you would miss.
Comment #16
jepster_Luckily the fix has been an easy one. The Twig Environment shipped with Drupal 8.3.7 has a loadTemplate() method, which das the same as the load() method, that has been used in the Info service. This method is deprecated, if a composer update has been run, but is is ensured that the template is being loaded with Drupal out-of-the-box and on the composer update. So there is no Composer update command execution needed to use Permissions by Term module.
The fix is part of the latest PbT version 8.x-1.23 release.
I am marking this issue as "fixed". Please re-open this issue, if you experience any problem.
@Andrzej7: Wesołego urzywania modułu Permissions by Term! :)