- Issue created by @snowmountain
- Status changed to Closed: cannot reproduce
over 1 year ago 3:28pm 19 August 2023 - πΊπΈUnited States snowmountain
I checked further into this by downloading the .tar.gz file for version 3.1.25 of this module. The affected file, permissions_by_term.module, did NOT contain the duplicated function. It is unclear how this duplicated function got into my site, but since the duplicated function definition was not in the downloaded module, I am closing this.
- Status changed to Active
over 1 year ago 2:27pm 30 August 2023 - πΊπΈUnited States codeelegance
I'm opening this again, because I, too, found the duplicated theme function at the end of the file. Module was updated via composer.
- πΊπΈUnited States snowmountain
After correcting this by removing the duplicated function code, the module was updated by composer and the problem reappeared - even though the downloaded tarred gzipped code for the new version did not contain the duplicated function code. Composer seems to be somehow duplicating the code.
- π©πͺGermany marcoliver Neuss, NRW, Germany
I've spent some time just now trying to reproduce the problem, changing module versions in all directions, but the module file always comes through clean.
Can anyone please note the steps to make this problem reproducible on a clean Drupal installation?
Also, what Composer versions are you using?
And are you maybe applying any additional patches from other issues?
- πΊπΈUnited States snowmountain
Here ids what I was using:
Drupal version : 9.5.10
Composer version 2.1.5 2021-07-23 10:35:47After restoring the site by commenting out the duplicate function,
I ran composer again:$ composer update drupal/permissions_by_term
and composer reported it could not apply a patch: the result was the WSOD again for the site, and this message from composer, after
$ composer update drupal/permissions_by_termGathering patches for root package.
Removing package drupal/permissions_by_term so that it can be re-installed and re-patched.
- Removing drupal/permissions_by_term (3.1.26)
Deleting ./modules/contrib/permissions_by_term - deleted
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
- Installing drupal/permissions_by_term (3.1.26): Extracting archive
- Applying patches for drupal/permissions_by_term
https://git.drupalcode.org/project/permissions_by_term/-/merge_requests/... (perm by term patch to allow editing nodes)
Could not apply patch! Skipping. The error was: Cannot apply patch https://git.drupalcode.org/project/permissions_by_term/-/merge_requests/...Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
Generating autoload files
54 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Scaffolding files for drupal/core:
- Copy [web-root]/.htaccess from assets/scaffold/files/htaccess - Status changed to Needs review
over 1 year ago 5:56am 7 September 2023 - π©πͺGermany marcoliver Neuss, NRW, Germany
Hi snowmountain, okay, but that makes sense though, because the issue the now failing patch addresses has been fixed. So your Composer installation is attempting to apply the patch to files that already include the changes from the patch.
Kindly remove the patch from your composer.json and let me know if that solves your problem.
- πΊπΈUnited States jimconte
I had the same problem after updating from composer.
I was able to fix with composer "reinstall"-bash-4.2$ drush cr PHP Fatal error: Cannot redeclare permissions_by_term_theme() (previously declared in ###/html/web/modules/contrib/permissions_by_term/permissions_by_term.module:592) in ###/html/web/modules/contrib/permissions_by_term/permissions_by_term.module on line 604 -bash-4.2$ composer reinstall drupal/permissions_by_term - Removing drupal/permissions_by_term (3.1.26) Deleting web/modules/contrib/permissions_by_term - deleted Gathering patches for root package. Gathering patches for dependencies. This might take a minute. - Installing drupal/permissions_by_term (3.1.26): Extracting archive -bash-4.2$ drush cr [success] Cache rebuild complete.
- πΊπΈUnited States snowmountain
Thanks marcoliver,
I removed the patch from composer.json, which got rid of the duplicate function error!
However, a new error appeared. This new error is specific to version 3.1.27; after reverting back to 3.1.26, the error disappeared. I plan to open a new issue reporting this error, unless I find it has already been reported.
I did not find it reported, so I reported it at https://www.drupal.org/project/permissions_by_term/issues/3387431 π too few args in AccessChecker Active
The new error is below, FYI - but, reverting to 3.1.26 fixed it, and there is an issue for it (above).
The website encountered an unexpected error. Please try again later.
ArgumentCountError: Too few arguments to function Drupal\permissions_by_entity\Service\AccessChecker::__construct(), 4 passed in /var/www/clients/client3/web41/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 5 expected in Drupal\permissions_by_entity\Service\AccessChecker->__construct() (line 52 of modules/contrib/permissions_by_term/modules/permissions_by_entity/src/Service/AccessChecker.php). - Status changed to Fixed
over 1 year ago 11:30am 20 September 2023 - π©πͺGermany marcoliver Neuss, NRW, Germany
Hi snowmountain,
as some people commented your new issue, clearing the cache should do the trick. I was just able to reproduce the problem. Clearing the cache, so the changed method signature becomes known, should be the solution.
I'll mark this and the other issue as fixed. Feel free to reopen either one if the problems persist.
Automatically closed - issue fixed for 2 weeks with no activity.