PHP Fatal error: Trait "Drupal\simple_sitemap\Manager\VariantSetterTrait"

Created on 3 November 2023, over 1 year ago

PHP Fatal error: Trait "Drupal\simple_sitemap\Manager\VariantSetterTrait" not found in /Applications/MAMP/htdocs/acquia_cms/docroot/modules/contrib/acquia_cms_common/src/Facade/SitemapFacade.php on line 21

🐛 Bug report
Status

Active

Version

4.1

Component

Code

Created by

🇮🇳India rajeshreeputra Pune

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

Merge Requests

Comments & Activities

  • Issue created by @rajeshreeputra
  • Assigned to chetan 11
  • Issue was unassigned.
  • 🇮🇳India chetan 11

    HI @Rajeshreeputra,
    Can you share the reproduce steps that, how you get this error.
    I have installed the module on my local, but i'm not getting the fatal error.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.2 & MySQL 8
    last update over 1 year ago
    Composer require failure
  • Status changed to Needs review over 1 year ago
  • 🇩🇪Germany gbyte Berlin

    FYI: VariantSetterTrait was removed in favor of \Drupal\simple_sitemap\Manager\SitemapGetterTrait in 4.1.7. You'll have to adjust this code. This trait was not meant for external use, but nevertheless sorry for the inconvenience.

  • 🇮🇳India rajeshreeputra Pune

    Thank you! got it, @gbyte could you please review this MR once and let us know if this approach is okay in favor of removal of \Drupal\simple_sitemap\Manager\SitemapGetterTrait in 4.1.7. Do you think anything else that we should consider?

  • 🇬🇧United Kingdom alex_sansom

    Probably obvious to those with more familiarity to the product, but, this seems to break installing (and being able to evaluate) Acquia CMS (low-code) starter kit?

    Should this raise the issue's "priority" level, up from "Normal"?

    Having tried to follow the documentation [1], and running "./vendor/bin/acms acms:install", I get:

    ...
    Enabling modules for the starter-kit:
    -------------------------------------
    > './vendor/bin/drush' 'en' '--yes' 'acquia_cms_site_studio' 'acquia_cms_page' 'acquia_cms_search' 'acquia_cms_tour' 'acquia_cms_toolbar' 'acquia_cms_article' 'acquia_cms_event' '--uri=default'
    The following module(s) will be enabled: acquia_cms_site_studio, acquia_cms_page, acquia_cms_search, acquia_cms_tour, acquia_cms_toolbar, acquia_cms_article, acquia_cms_event, acquia_cms_common, acquia_purge, purge, purge_queuer_coretags, config_ignore, config_rewrite, diff, ckeditor5, editor, file, config, config_translation, locale, language, content_moderation, workflows, content_translation, media, image, menu_ui, menu_link_content, link, taxonomy, entity_clone, metatag_open_graph, metatag, token, metatag_twitter_cards, moderation_dashboard, views, layout_builder, layout_discovery, contextual, moderation_sidebar, password_policy_character_types, password_policy, datetime, password_policy_length, password_policy_username, pathauto, path, redirect, scheduler_content_moderation_integration, options, scheduler, schema_article, schema_metatag, schema_person, schema_place, simple_sitemap, seckit, smart_trim, username_enumeration_prevention, workbench_email, cohesion, imce, entity_reference_revisions, rest, serialization, jquery_ui, cohesion_base_styles, cohesion_custom_styles, cohesion_elements, cohesion_templates, cohesion_style_helpers, cohesion_sync, cohesion_website_settings, collapsiblock, node_revision_delete, sitestudio_page_builder, responsive_preview, acquia_cms_image, media_library, field_group, focal_point, crop, facets, facets_pretty_paths, search_api_autocomplete, search_api, search_api_db, admin_toolbar, toolbar, breakpoint, admin_toolbar_tools, acquia_cms_person, acquia_cms_place, address, telephone, geocoder_address, geocoder_field, geocoder, geocoder_geofield, geofield, schema_event
    
     // Do you want to continue?: yes.
    
     [notice] user.settings rewritten by acquia_cms_common
     [notice] system.performance rewritten by acquia_cms_common
     [notice] node.settings rewritten by acquia_cms_common
    PHP Fatal error:  Trait "Drupal\simple_sitemap\Manager\VariantSetterTrait" not found in /app/docroot/modules/contrib/acquia_cms_common/src/Facade/SitemapFacade.php on line 21
    
    Fatal error: Trait "Drupal\simple_sitemap\Manager\VariantSetterTrait" not found in /app/docroot/modules/contrib/acquia_cms_common/src/Facade/SitemapFacade.php on line 21
     [warning] Drush command terminated abnormally.
    
    In CommandBase.php line 140:
    
      The command "'./vendor/bin/drush' 'en' '--yes' 'acquia_cms_site_studio' 'acquia_cms_page' 'acquia_cms_search' 'acquia_cms_tour' 'acquia_cms_toolbar' 'acquia_cms_article' 'acquia_cms_event' '--uri=default'" failed.
    
      Exit Code: 1(General error)
    
      Working directory: /app
    
    
    site:install [--db-url [DB-URL]] [--db-prefix [DB-PREFIX]] [--db-su [DB-SU]] [--db-su-pw [DB-SU-PW]] [--account-name [ACCOUNT-NAME]] [--account-mail [ACCOUNT-MAIL]] [--site-mail [SITE-MAIL]] [--account-pass [ACCOUNT-PASS]] [--locale [LOCALE]] [--site-name [SITE-NAME]] [--site-pass [SITE-PASS]] [--sites-subdir [SITES-SUBDIR]] [--existing-config ] [-l|--uri [URI]] [-y|--yes] [--no] [-hide|--hide-command] [-d|--display-command] [-wpi|--without-product-info] [--] [<profile>...]
    
    
    In CommandBase.php line 140:
    
      The command "'./vendor/bin/acms' 'site:install' '--without-product-info' '--uri=default'" failed.
    
      Exit Code: 1(General error)
    
      Working directory: /app
    
    
    acms:install [-l|--uri [URI]] [--] [<name>]
    

    [1] https://docs.acquia.com/acquia-cms/install-cms/#install-acquia-cms-local...

  • 🇩🇪Germany gbyte Berlin

    Thank you! got it, @gbyte could you please review this MR once and let us know if this approach is okay in favor of removal of \Drupal\simple_sitemap\Manager\SitemapGetterTrait in 4.1.7. Do you think anything else that we should consider?

    @Rajeshreeputra

    It looks right but I can't test it as I don't use acquia cms, hence not changing the issue status.

    FYI you can also check $sitemap->isEnabled(), but I am not sure if in your use case you need that for setting bundle settings. Probably not.

    Also please be aware that we are moving away from the name 'sitemap variant' and instead we are now using 'sitemap'. You might want to reflect that in your code.

  • Status changed to RTBC over 1 year ago
  • 🇮🇳India anwar_max

    I have tested this and working as expected.
    Changing status from Needs Review to RTBC

  • Status changed to Fixed 5 days ago
  • Pipeline finished with Failed
    5 days ago
    Total: 153s
    #512310
Production build 0.71.5 2024