Error: Class "Drupal\spamspan\TwigExtension\SpamSpanExtension" not found

Created on 21 September 2022, over 2 years ago
Updated 12 July 2023, over 1 year ago

After updating from 8.x-1.2 via /admin/reports/updates/update, I encountered following error message from https://[website]/core/authorize.php:

The website encountered an unexpected error. Please try again later.
Error: Class "Drupal\spamspan\TwigExtension\SpamSpanExtension" not found in Drupal\Component\DependencyInjection\Container->createService() (line 262 of core/lib/Drupal/Component/DependencyInjection/Container.php).

After having reinstalled 8.x-1.2 manually and visiting my website afterwards, it reported these warnings:

Warning: include([$DOCUMENT_ROOT]/modules/spamspan/src/TwigExtension/SpamSpanExtension.php): Failed to open stream: No such file or directory in include() (line 571 of vendor/composer/ClassLoader.php).
Warning: include(): Failed opening '[$DOCUMENT_ROOT]/modules/spamspan/src/TwigExtension/SpamSpanExtension.php' for inclusion (include_path='[$DOCUMENT_ROOT]/vendor/pear/pear_exception:[$DOCUMENT_ROOT]/vendor/pear/console_getopt:[$DOCUMENT_ROOT]/vendor/pear/pear-core-minimal/src:[$DOCUMENT_ROOT]/vendor/pear/archive_tar:.:/usr/share/pear') in include() (line 571 of vendor/composer/ClassLoader.php).
Warning: include([$DOCUMENT_ROOT]/modules/spamspan/src/TwigExtension/SpamSpanExtension.php): Failed to open stream: No such file or directory in include() (line 571 of vendor/composer/ClassLoader.php).
Warning: include(): Failed opening '[$DOCUMENT_ROOT]/modules/spamspan/src/TwigExtension/SpamSpanExtension.php' for inclusion (include_path='[$DOCUMENT_ROOT]/vendor/pear/pear_exception:[$DOCUMENT_ROOT]/vendor/pear/console_getopt:[$DOCUMENT_ROOT]/vendor/pear/pear-core-minimal/src:[$DOCUMENT_ROOT]/vendor/pear/archive_tar:.:/usr/share/pear') in include() (line 571 of vendor/composer/ClassLoader.php).

🐛 Bug report
Status

Closed: outdated

Version

1.3

Component

Code

Created by

🇩🇪Germany Andreas.Pohl

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany Anybody Porta Westfalica

    @Grevil could you please take a look? I never ran into this...

    Important: Might be fixed in 3.x - then please close this outdated.

  • Issue was unassigned.
  • Status changed to Closed: outdated over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Can not be reproduced in 3.x anymore. Please use the latest version.

  • 🇩🇪Germany zany

    Just a heads up: it can still be reproduced with 3.x.

    Going from 1.2 to 3.x one of the file names should be
    spamspan/src/TwigExtension/SpamspanExtension.php (1.3 and later)
    but this file name might be stuck (depending on file system and used tools)
    spamspan/src/TwigExtension/SpamSpanExtension.php (1.2)

    Still see #9 for a solution if this affects you. There is nothing to fix/change in the project though.

Production build 0.71.5 2024