- Issue created by @steven.vdw
- Status changed to Closed: works as designed
almost 2 years ago 11:54pm 14 March 2023 - 🇺🇸United States wells Seattle, WA
Hi, steven.vdw -- sorry to bounce you around but it looks like you were on the right track seeking support in the post install forum → . I'm not sure why the first response there pointed you to the issue queue.
The
Spatie\CalendarLinks\Link
class is provided by a dependency managed by composer -- it's not possible to just put the files in a directory and have it wok. Composer also handles the autoloading of the file so needs to be involved in the installation.Hopefully you'll get some more helpful responses to your forum post soon.
- 🇺🇸United States jayvolk
I've run into the exact same issue....
Error: Class "Spatie\CalendarLinks\Link" not found in Drupal\calendar_link\Twig\CalendarLinkTwigExtension->calendarLink() (line 79 of modules/contrib/calendar_link/src/Twig/CalendarLinkTwigExtension.php).This worked on my local machine (mac, running php8.1), but does not work on RHEL7 running php8.1. Sure hope someone figures this out... It leads to showing nothing but a WSOD with error message.
- 🇺🇸United States wells Seattle, WA
@jayvolk what does your deploy process look like? Are you installing composer dependencies on the RHEL7 machine or committing and deployed vendor assets? Or something else?
Just want to establish if this a similar case as the original poster or something else.
- 🇺🇸United States jayvolk
Wells... I am using a composer install on the live server. (even tried rm -rf ing the vendor and modules/contrib folders and reinstalling to see if that would help... it didn't.
- Status changed to Active
over 1 year ago 6:33pm 10 April 2023 - 🇺🇸United States wells Seattle, WA
Hm ok... could you share a list of the steps you took deploying the application? And perhaps an example
composer.json
file?And on the non-working deployment can you confirm if you do indeed have the file
{root}/vendor/spatie/calendar-links/src/Link.php
present? - 🇺🇸United States jayvolk
Yes /vendor/spatie/calendar-links/src/Link.php is present.
and. this is composer.json
{
"name": "drupal/recommended-project",
"description": "Project template for Drupal 9 projects with a relocated document root",
"type": "project",
"license": "GPL-2.0-or-later",
"homepage": " https://www.drupal.org/project/drupal → ",
"support": {
"docs": " https://www.drupal.org/docs/user_guide/en/index.html → ",
"chat": " https://www.drupal.org/node/314178 → "
},
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
],
"require": {
"composer/installers": "^1.9",
"cweagans/composer-patches": "^1.7",
"drupal/admin_toolbar": "^3.1",
"drupal/allowed_formats": "^1.5",
"drupal/backup_migrate": "^5.0",
"drupal/better_exposed_filters": "^5.2",
"drupal/browsersync": "^2.0",
"drupal/calendar": "^1.0@alpha",
"drupal/calendar_link": "^3.0",
"drupal/cer": "4.x-dev@dev",
"drupal/ckeditor_accordion": "^1.3",
"drupal/components": "^2.4",
"drupal/config_delete": "^1.17",
"drupal/content_lock": "^2.2",
"drupal/context": "^4.1",
"drupal/context_active_trail": "^2.0@RC",
"drupal/context_breadcrumb": "^1.4",
"drupal/core-composer-scaffold": "^9.3",
"drupal/core-project-message": "^9.3",
"drupal/core-recommended": "^9.3",
"drupal/current_page_crumb": "^1.3",
"drupal/custom_breadcrumbs": "1.x-dev@dev",
"drupal/devel": "^4.1",
"drupal/double_field": "^4.1",
"drupal/editor_advanced_link": "^2.0",
"drupal/entity_browser": "^2.6",
"drupal/entity_usage": "^2.0@beta",
"drupal/entityreference_filter": "^1.4",
"drupal/feeds": "3.x-dev@dev",
"drupal/feeds_tamper": "^2.0@beta",
"drupal/field_group": "^3.2",
"drupal/focal_point": "^1.5",
"drupal/gin": "^3.0@beta",
"drupal/google_analytics": "^4.0",
"drupal/improve_line_breaks_filter": "^1.3",
"drupal/link_attributes": "^1.11",
"drupal/menu_block": "^1.8",
"drupal/menu_item_extras": "^2.17",
"drupal/menu_link_attributes": "^1.2",
"drupal/metatag": "^1.19",
"drupal/migrate_process_skip": "^2.0",
"drupal/module_filter": "^3.2",
"drupal/paragraphs": "^1.13",
"drupal/password_policy": "^3.2",
"drupal/password_strength": "2.x-dev@dev",
"drupal/pathauto": "^1.10",
"drupal/redirect": "^1.8",
"drupal/responsive_menus": "^1.0@alpha",
"drupal/selective_better_exposed_filters": "^2.0@beta",
"drupal/sitemap": "^2.0@beta",
"drupal/smart_trim": "^1.3",
"drupal/smtp": "^1.2",
"drupal/svg_image": "^1.16",
"drupal/tablefield": "^2.2",
"drupal/tamper": "^1.0@alpha",
"drupal/term_condition": "^2.0",
"drupal/tfa": "1.x-dev@dev",
"drupal/token": "^1.10",
"drupal/twig_tweak": "^3.1",
"drupal/view_modes_display": "^2.3",
"drupal/viewfield": "^3.0@beta",
"drupal/views_bulk_edit": "^2.6",
"drupal/views_bulk_operations": "^4.1",
"drupal/views_conditional": "^1.5",
"drupal/views_data_export": "^1.1",
"drupal/views_ical": "^1.0@alpha",
"drupal/views_templates": "^1.1",
"drupal/webform": "^6.1",
"drupal/webp": "^1.0@beta",
"drupal/xmlsitemap": "^1.3",
"drupal/yearonly": "^9.0",
"drush/drush": "^11.2",
"spatie/calendar-links": "^1.8"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true,
"cweagans/composer-patches": true
}
},
"extra": {
"drupal-scaffold": {
"locations": {
"web-root": "web/"
}
},
"patches": {
"drupal/ckeditor_accordion": {
"maybe this works": " https://www.drupal.org/files/issues/2020-09-24/ckeditor_accordion-provid... → "
},
"drupal/migrate_process_inline_images": {
"Issue # 3182162 - core_version_requirement issue": " https://www.drupal.org/files/issues/2020-11-12/core_version_requirement_... → "
},
"drupal/better_exposed_filters": {
"Issue # 3182162 - core_version_requirement issue": " https://www.drupal.org/files/issues/2022-10-27/auto-submit-textfield-foc... → "
}
},
"installer-paths": {
"web/core": [
"type:drupal-core"
],
"web/libraries/{$name}": [
"type:drupal-library"
],
"web/modules/contrib/{$name}": [
"type:drupal-module"
],
"web/profiles/contrib/{$name}": [
"type:drupal-profile"
],
"web/themes/contrib/{$name}": [
"type:drupal-theme"
],
"drush/Commands/contrib/{$name}": [
"type:drupal-drush"
],
"web/modules/custom/{$name}": [
"type:drupal-custom-module"
],
"web/profiles/custom/{$name}": [
"type:drupal-custom-profile"
],
"web/themes/custom/{$name}": [
"type:drupal-custom-theme"
]
},
"drupal-core-project-message": {
"include-keys": [
"homepage",
"support"
],
"post-create-project-cmd-message": [
" ",
" Congratulations, you’ve installed the Drupal codebase ",
" from the drupal/recommended-project template! ",
" ",
"",
"Next steps:",
" * Install the site: https://www.drupal.org/docs/8/install → ",
" * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html → ",
" * Get support: https://www.drupal.org/support → ",
" * Get involved with the Drupal community:",
" https://www.drupal.org/getting-involved → ",
" * Remove the plugin that prints this message:",
" composer remove drupal/core-project-message"
]
}
}
} - 🇺🇸United States wells Seattle, WA
I was able to start an instance in Lando using that composer file and generate links without issue.
Could you share the contents of your
vendor/composer/autoload_psr4.php
from the host? - 🇺🇸United States jayvolk
Sure, but before that does anything within this module "dial out" to the internet? If so, that could be the problem as we're behind a proxy on this server.
- 🇺🇸United States wells Seattle, WA
Nothing in the module but composer certainly does to get packages. Sound like you have the expected file though. The class that the error message says you are missing is in that file and should be autoloaded and ready to go.
- 🇺🇸United States jayvolk
My local version of that file and the remote version are identical.
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);return array(
'enshrined\\svgSanitize\\' => array($vendorDir . '/enshrined/svg-sanitize/src'),
'cweagans\\Composer\\' => array($vendorDir . '/cweagans/composer-patches/src'),
'chillerlan\\Settings\\' => array($vendorDir . '/chillerlan/php-settings-container/src'),
'chillerlan\\QRCode\\' => array($vendorDir . '/chillerlan/php-qrcode/src'),
'ZxcvbnPhp\\' => array($vendorDir . '/bjeavons/zxcvbn-php/src'),
'Twig\\' => array($vendorDir . '/twig/twig/src'),
'TYPO3\\PharStreamWrapper\\' => array($vendorDir . '/typo3/phar-stream-wrapper/src'),
'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'),
'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'),
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'),
'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'),
'Symfony\\Polyfill\\Intl\\Grapheme\\' => array($vendorDir . '/symfony/polyfill-intl-grapheme'),
'Symfony\\Polyfill\\Iconv\\' => array($vendorDir . '/symfony/polyfill-iconv'),
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
'Symfony\\Contracts\\Translation\\' => array($vendorDir . '/symfony/translation-contracts'),
'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'),
'Symfony\\Contracts\\HttpClient\\' => array($vendorDir . '/symfony/http-client-contracts'),
'Symfony\\Contracts\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher-contracts'),
'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'),
'Symfony\\Component\\Validator\\' => array($vendorDir . '/symfony/validator'),
'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'),
'Symfony\\Component\\String\\' => array($vendorDir . '/symfony/string'),
'Symfony\\Component\\Serializer\\' => array($vendorDir . '/symfony/serializer'),
'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'),
'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'),
'Symfony\\Component\\Mime\\' => array($vendorDir . '/symfony/mime'),
'Symfony\\Component\\HttpKernel\\' => array($vendorDir . '/symfony/http-kernel'),
'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'),
'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'),
'Symfony\\Component\\Filesystem\\' => array($vendorDir . '/symfony/filesystem'),
'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),
'Symfony\\Component\\ErrorHandler\\' => array($vendorDir . '/symfony/error-handler'),
'Symfony\\Component\\DependencyInjection\\' => array($vendorDir . '/symfony/dependency-injection'),
'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'),
'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'),
'Symfony\\Cmf\\Component\\Routing\\' => array($vendorDir . '/symfony-cmf/routing/src'),
'Symfony\\Bridge\\PsrHttpMessage\\' => array($vendorDir . '/symfony/psr-http-message-bridge'),
'Spatie\\CalendarLinks\\' => array($vendorDir . '/spatie/calendar-links/src'),
'SelfUpdate\\' => array($vendorDir . '/consolidation/self-update/src'),
'Robo\\' => array($vendorDir . '/consolidation/robo/src'),
'Psy\\' => array($vendorDir . '/psy/psysh/src'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'),
'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'),
'ParagonIE\\ConstantTime\\' => array($vendorDir . '/paragonie/constant_time_encoding/src'),
'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'),
'Otp\\' => array($vendorDir . '/christian-riesen/otp/src'),
'Masterminds\\' => array($vendorDir . '/masterminds/html5/src'),
'League\\Csv\\' => array($vendorDir . '/league/csv/src'),
'League\\Container\\' => array($vendorDir . '/league/container/src'),
'Laminas\\Stdlib\\' => array($vendorDir . '/laminas/laminas-stdlib/src'),
'Laminas\\Feed\\' => array($vendorDir . '/laminas/laminas-feed/src'),
'Laminas\\Escaper\\' => array($vendorDir . '/laminas/laminas-escaper/src'),
'Laminas\\Diactoros\\' => array($vendorDir . '/laminas/laminas-diactoros/src'),
'Html2Text\\' => array($vendorDir . '/html2text/html2text/src', $vendorDir . '/html2text/html2text/test'),
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
'Grasmash\\Expander\\' => array($vendorDir . '/grasmash/expander/src'),
'Enlightn\\SecurityChecker\\' => array($vendorDir . '/enlightn/security-checker/src'),
'Eluceo\\iCal\\' => array($vendorDir . '/eluceo/ical/src'),
'Egulias\\EmailValidator\\' => array($vendorDir . '/egulias/email-validator/src'),
'Drush\\' => array($vendorDir . '/drush/drush/src'),
'Drupal\\Driver\\' => array($baseDir . '/web/drivers/lib/Drupal/Driver'),
'Drupal\\Core\\' => array($baseDir . '/web/core/lib/Drupal/Core'),
'Drupal\\Composer\\Plugin\\Scaffold\\' => array($vendorDir . '/drupal/core-composer-scaffold'),
'Drupal\\Composer\\Plugin\\ProjectMessage\\' => array($vendorDir . '/drupal/core-project-message'),
'Drupal\\Component\\' => array($baseDir . '/web/core/lib/Drupal/Component'),
'DrupalCodeGenerator\\' => array($vendorDir . '/chi-teck/drupal-code-generator/src'),
'Doctrine\\Persistence\\' => array($vendorDir . '/doctrine/persistence/lib/Doctrine/Persistence'),
'Doctrine\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector'),
'Doctrine\\Deprecations\\' => array($vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations'),
'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib/Doctrine/Common/Lexer'),
'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Common/Inflector'),
'Doctrine\\Common\\Collections\\' => array($vendorDir . '/doctrine/collections/lib/Doctrine/Common/Collections'),
'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache'),
'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations'),
'Doctrine\\Common\\' => array($vendorDir . '/doctrine/common/lib/Doctrine/Common', $vendorDir . '/doctrine/event-manager/src', $vendorDir . '/doctrine/persistence/lib/Doctrine/Common', $vendorDir . '/doctrine/reflection/lib/Doctrine/Common'),
'Dflydev\\DotAccessData\\' => array($vendorDir . '/dflydev/dot-access-data/src'),
'Consolidation\\SiteProcess\\' => array($vendorDir . '/consolidation/site-process/src'),
'Consolidation\\SiteAlias\\' => array($vendorDir . '/consolidation/site-alias/src'),
'Consolidation\\OutputFormatters\\' => array($vendorDir . '/consolidation/output-formatters/src'),
'Consolidation\\Log\\' => array($vendorDir . '/consolidation/log/src'),
'Consolidation\\Filter\\' => array($vendorDir . '/consolidation/filter-via-dot-access-data/src'),
'Consolidation\\Config\\' => array($vendorDir . '/consolidation/config/src'),
'Consolidation\\AnnotatedCommand\\' => array($vendorDir . '/consolidation/annotated-command/src'),
'Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'),
'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
'Asm89\\Stack\\' => array($vendorDir . '/asm89/stack-cors/src/Asm89/Stack'),
); - 🇺🇸United States wells Seattle, WA
And it has the expected
'Spatie\\CalendarLinks\\' => array($vendorDir . '/spatie/calendar-links/src')
line.Ok. Can you share your twig template calling one of the module functions and a full backtrace of the error? Tracing twig errors is always a nightmare but maybe we'll get something I can see or reproduce...
- 🇺🇸United States jayvolk
{% set link = calendar_link('google', node.title, node.field_start_date, node.field_end_date, '', content.body|render, node.field_talk_title, content.field_room.0|render ~ ' ' ~ content.field_building.0|render) %}
Add event to Google
{% set link = calendar_link('ics', node.title, node.field_start_date, node.field_end_date, '', content.body|render, node.field_talk_title, content.field_room.0|render ~ ' ' ~ content.field_building.0|render) %}
Add event to iCal - Status changed to Postponed: needs info
over 1 year ago 9:27pm 13 April 2023 - 🇺🇸United States wells Seattle, WA
I'm not able to reproduce this using the provided configuration and example (in Lando, anyway) but I'll leave this open as needs more info for now in case anyone else has the issue and/or is able to determine what the source is. The only thing I can think is something specific to RHEL but that seems pretty unlikely...
- 🇺🇸United States jayvolk
Yes, I suspect that it's related to the proxy server not allowing something in to be downloaded. Thanks for digging tho'
- Status changed to Closed: works as designed
about 1 year ago 10:34pm 2 November 2023