Automated Drupal 11 compatibility fixes for tome

Created on 25 March 2024, 10 months ago

Problem/Motivation

Hello project maintainers,

This is an automated issue to help make this module compatible with Drupal 11.

Changes will periodically be added to this issue that remove deprecated API uses. To stop further changes from being posted, change the status to anything other than Active, Needs review, Needs work or Reviewed and tested by the community. Alternatively, you can remove the "ProjectUpdateBotD11" tag from the issue to stop the bot from posting updates.

The changes will be posted by the Project Update Bot official user account. This account will not receive any issue credit contributions for itself or any company.

Proposed resolution

You have a few options for how to use this issue:

  1. Accept automated changes until this issue is closed

    If this issue is left open (status of Active, Needs review, Needs work or Reviewed and tested by the community) and the "ProjectUpdateBotD11" tag is left on this issue, new changes will be posted periodically if new deprecation fixes are needed.

    As the Drupal Rector project improves and is able to fix more deprecated API uses, the changes posted here will cover more of the deprecated API uses in the module.

    Patches and/or merge requests posted by others are ignored by the bot, and general human interactions in the issue do not stop the bot from posting updates, so feel free to use this issue to refine bot changes. The bot will still post new changes then if there is a change in the new generated patch compared to the changes that the bot posted last. Those changes are then up to humans to integrate.

  2. Leave open but stop new automated changes.

    If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated changes, remove the "ProjectUpdateBotD11" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated changes again, add back the "ProjectUpdateBotD11" tag.

  3. Close it and don't use it

    If the maintainers of this project don't find this issue useful, they can close this issue (any status besides Active, Needs review, Needs work and Reviewed and tested by the community) and no more automated changes will be posted here.

    If the issue is reopened, then new automated changes will be posted.

    If you are using another issue(s) to work on Drupal 11 compatibility it would be very useful to other contributors to add those issues as "Related issues" when closing this issue.

Remaining tasks

Using the patches

  1. Apply the latest patch in the comments by Project Update Bot or human contributors that made it better.
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
  3. Provide feedback about how the testing went. If you can improve the patch, post an updated patch here.

Using the merge request

  1. Review the merge request and test it.
  2. Thoroughly test the changes. These changes are automatically generated so they haven't been tested manually or automatically.
  3. Provide feedback about how the testing went. If you can improve the merge request, create a new branch and merge request and work from there.

Warning: The 'project-update-bot-only' branch will always be overwritten. Do not work in that branch!

Providing feedback

If there are problems with one of the changes posted by the Project Update Bot , such as it does not correctly replace a deprecation, you can file an issue in the Drupal Rector issue queue . For other issues with the bot, for instance if the issue summary created by the bot is unclear, use the Project analysis issue queue .

📌 Task
Status

Needs review

Version

1.12

Component

Code

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

Merge Requests

Comments & Activities

  • Issue created by @project update bot
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 10 months ago
    Waiting for branch to pass
  • This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

    It is important that any automated tests available are run and that you manually test the changes.

    Drupal 11 Compatibility

    According to the Upgrade Status module , even with these changes, this module is not yet compatible with Drupal 11.

    Currently Drupal Rector, version 0.20.1, cannot fix all Drupal 11 compatibility problems.

    Therefore these changes did not update the info.yml file for Drupal 11 compatibility.

    The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.

    Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.

    Debug information

    Bot run #11-127659

    These packages were used to generate the fixes:

    1. drupal/upgrade_status: 4.1.0
    2. mglaman/phpstan-drupal: 1.2.9
    3. palantirnet/drupal-rector: 0.20.1
  • Merge request !23Automated Project Update Bot fixes → (Merged) created by project update bot
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 10 months ago
    Waiting for branch to pass
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 7 months ago
    Waiting for branch to pass
  • This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

    It is important that any automated tests available are run and that you manually test the changes.

    Drupal 11 Compatibility

    According to the Upgrade Status module , even with these changes, this module is not yet compatible with Drupal 11.

    Currently Drupal Rector, version 0.20.3, cannot fix all Drupal 11 compatibility problems.

    Therefore, these changes did not update the info.yml file for Drupal 11 compatibility.

    The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.

    Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.

    Debug information

    Bot run #11-199781

    These packages were used to generate the fixes:

    1. drupal/upgrade_status: 4.3.2
    2. mglaman/phpstan-drupal: 1.2.11
    3. palantirnet/drupal-rector: 0.20.3
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 7 months ago
    Waiting for branch to pass
  • This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

    It is important that any automated tests available are run and that you manually test the changes.

    Drupal 11 Compatibility

    According to the Upgrade Status module , even with these changes, this module is not yet compatible with Drupal 11.

    Currently Drupal Rector, version 0.20.3, cannot fix all Drupal 11 compatibility problems.

    Therefore, these changes did not update the info.yml file for Drupal 11 compatibility.

    The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.

    Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.

    Debug information

    Bot run #11-217342

    These packages were used to generate the fixes:

    1. drupal/upgrade_status: 4.3.4
    2. mglaman/phpstan-drupal: 1.2.11
    3. palantirnet/drupal-rector: 0.20.3
  • Pipeline finished with Skipped
    7 months ago
    #227276
  • First commit to issue fork.
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Gah I merged that by mistake, E_TOO_MANY_TABS

    Going to revert it and reopen

    • larowlan committed 76e31bbf on 8.x-1.x
      Revert "Issue #3435061: Automated Drupal 11 compatibility fixes for tome...
  • Merge request !27Project update bot only → (Open) created by larowlan
  • First commit to issue fork.
  • 🇦🇺Australia realityloop

    updated .ino.yml and composer.json to allow D11

  • First commit to issue fork.
  • ivnish Kazakhstan

    After applying the path from MR I get

    Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "router.route_provider", path: "options_request_listener -> router.route_provider -> cache_tags.invalidator -> cache.tome_static -> maintenance_mode_subscriber -> url_generator". in Drupal\Component\DependencyInjection\Container->get() (line 147 of core/lib/Drupal/Component/DependencyInjection/Container.php).

    TypeError: Drupal\Core\Cache\DatabaseBackend::__construct(): Argument #4 ($serializer) must be of type Drupal\Component\Serialization\ObjectAwareSerializationInterface, int given, called in /var/www/web/modules/contrib/tome/modules/tome_static/src/StaticCache.php on line 30 in /var/www/web/core/lib/Drupal/Core/Cache/DatabaseBackend.php on line 88 #0 /var/www/web/modules/contrib/tome/modules/tome_static/src/StaticCache.php(30): Drupal\Core\Cache\DatabaseBackend->__construct(Object(Drupal\mysql\Driver\Database\mysql\Connection), Object(Drupal\Core\Cache\DatabaseCacheTagsChecksum), 'tome_static', -1)
    #1 /var/www/web/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Drupal\tome_static\StaticCache->__construct(Object(Drupal\mysql\Driver\Database\mysql\Connection), Object(Drupal\Core\Cache\DatabaseCacheTagsChecksum))

  • Assigned to sourav_paul
  • Status changed to Needs work 3 months ago
  • 🇮🇳India sourav_paul Kolkata

    Even after creating an instance of serializer, as the 4th parameter in the DatabaseBackend::__construct method must be an instance of ObjectAwareSerializationInterface, facing this issue

    ArgumentCountError: Too few arguments to function Drupal\tome_static\StaticCache::__construct(), 2 passed in /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 3 expected in Drupal\tome_static\StaticCache->__construct() (line 33 of /app/web/modules/contrib/tome/modules/tome_static/src/StaticCache.php).

  • First commit to issue fork.
  • 🇸🇰Slovakia mirom

    mirom changed the visibility of the branch tome-3435061-project-update-bot-only to hidden.

  • 🇸🇰Slovakia mirom

    Hi @sourav_paul and @ivnish, can you please share steps to replicate your issues? I installed the module into clean-ish Drupal site and after pushing my fixes, I was able to perform all operations through drush as well as in the UI.

  • 🇦🇺Australia realityloop

    @mirom

    Getting the following error locally, the node in question doesn't have any added fields that are date fields:

    brian@drupal-foundry-web:/var/www/html$ drush tome:install -y
    
     // You are about to DROP all tables in your local database and re-install Tome. Do you want to continue?: yes.         
    
    
    In SiteProcess.php line 214:
                                                                                                                                
      The command "/var/www/html/vendor/bin/drush tome:import --yes --uri=https://drupal-foundry.ddev.site" failed.             
                                                                                                                                
      Exit Code: 1(General error)                                                                                               
                                                                                                                                
      Working directory:                                                                                                        
                                                                                                                                
      Output:                                                                                                                   
      ================                                                                                                          
                                                                                                                                
       [ERROR] Errors encountered when importing content:                                                                       
                                                                                                                                
       [ERROR] Error when running "'/var/www/html/vendor/bin/drush' 'tome:import-content'                                       
               'node.92365dea-5736-4f30-8b0b-c7e6b5585b98'":                                                                    
                  [warning] Undefined array key "end_value" SmartDateNormalizer.php:40                                          
                [error]  Error: Call to a member function getTimestamp() on null in                                             
               Drupal\serialization\Normalizer\TimestampNormalizer->denormalize() (line 39 of                                   
               /var/www/html/web/core/modules/serialization/src/Normalizer/TimestampNormalizer.php) #0                          
               /var/www/html/web/modules/contrib/smart_date/src/Normalizer/SmartDateNormalizer.php(40):                         
               Drupal\serialization\Normalizer\TimestampNormalizer->denormalize()                                               
               #1 /var/www/html/vendor/symfony/serializer/Serializer.php(238):                                                  
               Drupal\smart_date\Normalizer\SmartDateNormalizer->denormalize()                                                  
               #2 /var/www/html/web/modules/contrib/smart_date/src/Normalizer/SmartDateItemNormalizer.php(45):                  
               Symfony\Component\Serializer\Serializer->denormalize()                                                           
               #3 /var/www/html/web/core/modules/serialization/src/Normalizer/FieldItemNormalizer.php(33):                      
               Drupal\smart_date\Normalizer\SmartDateItemNormalizer->constructValue()                                           
               #4 /var/www/html/vendor/symfony/serializer/Serializer.php(238):                                                  
               Drupal\serialization\Normalizer\FieldItemNormalizer->denormalize()                                               
               #5 /var/www/html/web/core/modules/serialization/src/Normalizer/FieldNormalizer.php(47):                          
               Symfony\Component\Serializer\Serializer->denormalize()                                                           
               #6 /var/www/html/vendor/symfony/serializer/Serializer.php(238):                                                  
               Drupal\serialization\Normalizer\FieldNormalizer->denormalize()                                                   
               #7 /var/www/html/web/core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php(152):          
               Symfony\Component\Serializer\Serializer->denormalize()                                                           
               #8 /var/www/html/web/core/modules/serialization/src/Normalizer/EntityNormalizer.php(59):                         
               Drupal\serialization\Normalizer\EntityNormalizer->denormalizeFieldData()                                         
               #9 /var/www/html/vendor/symfony/serializer/Serializer.php(238):                                                  
               Drupal\serialization\Normalizer\EntityNormalizer->denormalize()                                                  
               #10 /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/Importer.php(272):                              
               Symfony\Component\Serializer\Serializer->denormalize()                                                           
               #11 /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/Importer.php(215):                              
               Drupal\tome_sync\Importer->loadEntityFromStorage()                                                               
               #12 /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/Commands/ImportContentCommand.php(34):          
               Drupal\tome_sync\Importer->importContent()                                                                       
               #13 /var/www/html/vendor/symfony/console/Command/Command.php(279):                                               
               Drupal\tome_sync\Commands\ImportContentCommand->execute()                                                        
               #14 /var/www/html/vendor/symfony/console/Application.php(1047):                                                  
               Symfony\Component\Console\Command\Command->run()                                                                 
               #15 /var/www/html/vendor/symfony/console/Application.php(316):                                                   
               Symfony\Component\Console\Application->doRunCommand()                                                            
               #16 /var/www/html/vendor/symfony/console/Application.php(167): Symfony\Component\Console\Application->doRun()    
               #17 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(110):                                               
               Symfony\Component\Console\Application->run()                                                                     
               #18 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()                 
               #19 /var/www/html/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run()                                
               #20 /var/www/html/vendor/drush/drush/drush(4): require('...')                                                    
               #21 /var/www/html/vendor/bin/drush(119): include('...')                                                          
               #22 {main}.                                                                                                      
               Error: Call to a member function getTimestamp() on null in                                                       
               /var/www/html/web/core/modules/serialization/src/Normalizer/TimestampNormalizer.php on line 39 #0                
               /var/www/html/web/modules/contrib/smart_date/src/Normalizer/SmartDateNormalizer.php(40):                         
               Drupal\serialization\Normalizer\TimestampNormalizer->denormalize()                                               
               #1 /var/www/html/vendor/symfony/serializer/Serializer.php(238):                                                  
               Drupal\smart_date\Normalizer\SmartDateNormalizer->denormalize()                                                  
               #2 /var/www/html/web/modules/contrib/smart_date/src/Normalizer/SmartDateItemNormalizer.php(45):                  
               Symfony\Component\Serializer\Serializer->denormalize()                                                           
               #3 /var/www/html/web/core/modules/serialization/src/Normalizer/FieldItemNormalizer.php(33):                      
               Drupal\smart_date\Normalizer\SmartDateItemNormalizer->constructValue()                                           
               #4 /var/www/html/vendor/symfony/serializer/Serializer.php(238):                                                  
               Drupal\serialization\Normalizer\FieldItemNormalizer->denormalize()                                               
               #5 /var/www/html/web/core/modules/serialization/src/Normalizer/FieldNormalizer.php(47):                          
               Symfony\Component\Serializer\Serializer->denormalize()                                                           
               #6 /var/www/html/vendor/symfony/serializer/Serializer.php(238):                                                  
               Drupal\serialization\Normalizer\FieldNormalizer->denormalize()                                                   
               #7 /var/www/html/web/core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php(152):          
               Symfony\Component\Serializer\Serializer->denormalize()                                                           
               #8 /var/www/html/web/core/modules/serialization/src/Normalizer/EntityNormalizer.php(59):                         
               Drupal\serialization\Normalizer\EntityNormalizer->denormalizeFieldData()                                         
               #9 /var/www/html/vendor/symfony/serializer/Serializer.php(238):                                                  
               Drupal\serialization\Normalizer\EntityNormalizer->denormalize()                                                  
               #10 /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/Importer.php(272):                              
               Symfony\Component\Serializer\Serializer->denormalize()                                                           
               #11 /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/Importer.php(215):                              
               Drupal\tome_sync\Importer->loadEntityFromStorage()                                                               
               #12 /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/Commands/ImportContentCommand.php(34):          
               Drupal\tome_sync\Importer->importContent()                                                                       
               #13 /var/www/html/vendor/symfony/console/Command/Command.php(279):                                               
               Drupal\tome_sync\Commands\ImportContentCommand->execute()                                                        
               #14 /var/www/html/vendor/symfony/console/Application.php(1047):                                                  
               Symfony\Component\Console\Command\Command->run()                                                                 
               #15 /var/www/html/vendor/symfony/console/Application.php(316):                                                   
               Symfony\Component\Console\Application->doRunCommand()                                                            
               #16 /var/www/html/vendor/symfony/console/Application.php(167): Symfony\Component\Console\Application->doRun()    
               #17 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(110):                                               
               Symfony\Component\Console\Application->run()                                                                     
               #18 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()                 
               #19 /var/www/html/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run()                                
               #20 /var/www/html/vendor/drush/drush/drush(4): require('...')                                                    
               #21 /var/www/html/vendor/bin/drush(119): include('...')                                                          
               #22 {main}                                                                                                       
                [warning] Drush command terminated abnormally.                                                                  
                                                                                                                                
                                                                                                                                
                                                                                                                                
      Error Output:                                                                                                             
      ================                                                                                                          
                               
    
  • ivnish Kazakhstan

    MR #29 was merged yesterday

  • ivnish Kazakhstan

    8.x-1.13 was created. Should we close this issue?

  • Issue was unassigned.
  • Status changed to Needs review 16 days ago
  • This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

    It is important that any automated tests available are run and that you manually test the changes.

    Drupal 11 Compatibility

    According to the Upgrade Status module , even with these changes, this module is not yet compatible with Drupal 11.

    Currently Drupal Rector, version 0.20.3, cannot fix all Drupal 11 compatibility problems.

    Therefore, these changes did not update the info.yml file for Drupal 11 compatibility.

    The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.

    Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.

    Debug information

    Bot run #11-392907

    These packages were used to generate the fixes:

    1. drupal/upgrade_status: 4.3.6
    2. mglaman/phpstan-drupal: 1.3.2
    3. palantirnet/drupal-rector: 0.20.3
  • Pipeline finished with Failed
    16 days ago
    Total: 310s
    #393539
Production build 0.71.5 2024