Problem/Motivation

Hello project maintainers,

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

To read more about this effort by the Drupal Association, please read: The project update bot is being refreshed to support Drupal 10 readiness of contributed projects

Patches will periodically be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches 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 "ProjectUpdateBotD10" tag from the issue to stop the bot from posting updates.

The patches 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 patches 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 "ProjectUpdateBotD10" tag is left on this issue, new patches 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 patches 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 patches. The bot will still post new patches then if there is a change in the new generated patch compared to the patch that the bot posted last. Those changes are then up to humans to integrate.

  2. Leave open but stop new automated patches.

    If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated patches, remove the "ProjectUpdateBotD10" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated patches again, add back the "ProjectUpdateBotD10" 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 patches will be posted here.

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

    If you are using another issue(s) to work on Drupal 10 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.

Providing feedback

If there are problems with one of the patches 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.

Comments

Project Update Bot created an issue. See original summary.

project update bot’s picture

Status: Active » Needs review
StatusFileSize
new6.68 KB

This is an automated patch generated by Drupal Rector. Please see the issue summary for more details.

It is important that any automated tests available are run with this patch and that you manually test this patch.

Drupal 10 Compatibility

According to the Upgrade Status module, even with this patch, this module is not yet compatible with Drupal 10.

Currently Drupal Rector, version 0.13.0, cannot fix all Drupal 10 compatibility problems.

This patch does not update the info.yml file for Drupal 10 compatibility.

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

Debug info

Bot run #139

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 1.1.24
  2. palantirnet/drupal-rector: 0.13.0
fathima.asmat’s picture

Issue summary: View changes
StatusFileSize
new24.1 KB

I have tested the rector patch on D9.4 an dD10-alpha6 and it doesn't resolve all the compatibility issues. It also just replaces deprecated methods with static service methods instead of using dependency injections where relevant.

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 59   Call to deprecated method assertRaw() of class              
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use                          
                    $this->assertSession()->responseContains() instead.         
--------------------------------------------------------------------------------
Check manually 60   Call to deprecated method assertRaw() of class              
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use                          
                    $this->assertSession()->responseContains() instead.         
--------------------------------------------------------------------------------
Check manually 63   Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 66   Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 69   Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 70   Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 73   Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 74   Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 77   Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 80   Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 81   Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 82   Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 97   Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 98   Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 102  Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------
Check manually 105  Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 106  Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 120  Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 121  Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 125  Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------
Check manually 128  Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 129  Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 145  Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------
Check manually 148  Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 156  Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------
Check manually 160  Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------
Check manually 163  Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 164  Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 171  Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 175  Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------
Check manually 178  Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------
Check manually 179  Call to deprecated method assertText() of class             
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and
                    is removed from drupal:10.0.0. Use -                        
                    $this->assertSession()->responseContains() for non-HTML     
                    responses, like XML or Json. -                              
                    $this->assertSession()->pageTextContains() for HTML         
                    responses. Unlike the deprecated assertText(), the passed   
                    text should be HTML decoded, exactly as a human sees it in  
                    the browser.                                                
--------------------------------------------------------------------------------

FILE:
web/modules/contrib/site_settings/tests/modules/site_settings_sample_data/site_s
ettings_sample_data.install

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Fix later      105  Call to deprecated function file_save_data(). Deprecated in 
                    drupal:9.3.0 and is removed from drupal:10.0.0. Use         
                    Drupal\file\FileRepositoryInterface::writeData() instead.   
--------------------------------------------------------------------------------
Fix later      143  Call to deprecated function file_save_data(). Deprecated in 
                    drupal:9.3.0 and is removed from drupal:10.0.0. Use         
                    Drupal\file\FileRepositoryInterface::writeData() instead.   
--------------------------------------------------------------------------------

FILE: web/modules/contrib/site_settings/src/Tests/SiteSettingsLoaderTest.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 61   The 'site_settings_sample_data/test_site_settings_loader'   
                    library is not defined because the defining extension is not
                    installed. Cannot decide if it is deprecated or not.        
--------------------------------------------------------------------------------

FILE: web/modules/contrib/site_settings/site_settings.info.yml

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 0    Value of core_version_requirement: ^8 || ^9 is not          
                    compatible with the next major version of Drupal core. See  
                    https://drupal.org/node/3070687.                            
--------------------------------------------------------------------------------

FILE:
web/modules/contrib/site_settings/modules/site_settings_type_permissions/site_se
ttings_type_permissions.info.yml

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 0    Value of core_version_requirement: ^8 || ^9 is not          
                    compatible with the next major version of Drupal core. See  
                    https://drupal.org/node/3070687.                            
--------------------------------------------------------------------------------

FILE:
web/modules/contrib/site_settings/tests/modules/site_settings_sample_data/site_s
ettings_sample_data.info.yml

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 0    Value of core_version_requirement: ^8 || ^9 is not          
                    compatible with the next major version of Drupal core. See  
                    https://drupal.org/node/3070687.                            
--------------------------------------------------------------------------------

The attached patch resolves all those issues. The module is enabled successfully on both D9.4 and D10-alpha6 without any issues and is working as expected.

fathima.asmat’s picture

Issue tags: +Drupal 10 porting day
fathima.asmat’s picture

StatusFileSize
new23.9 KB
new518 bytes

Removed unused class FileRepositoryInterface.

atul_ghate’s picture

Assigned: Unassigned » atul_ghate

Hi,
i will review this patch.

atul_ghate’s picture

Assigned: atul_ghate » Unassigned
StatusFileSize
new118.09 KB

Hi @fathima.asmat
I am unable to apply this patch ,I am getting some error messages see imge.
what i did
1 clone the branch 8.x-1.x
2 apply patch using "git apply "

fathima.asmat’s picture

Thanks for checking Atul. It seems like composer require -W drupal/site_settings:@dev (as given in https://www.drupal.org/community-initiatives/contribution-events-initiat...) has got 8.x-1.x-dev which seems like outdated and not up-to-date with latest stable. The patch was based on the dev release as per the porting instructions. I'll update the patch using the stable version. soon.

project update bot’s picture

This is an automated patch generated by Drupal Rector. Please see the issue summary for more details.

It is important that any automated tests available are run with this patch and that you manually test this patch.

Drupal 10 Compatibility

According to the Upgrade Status module, even with this patch, this module is not yet compatible with Drupal 10.

Currently Drupal Rector, version 0.13.1, cannot fix all Drupal 10 compatibility problems.

This patch does not update the info.yml file for Drupal 10 compatibility.

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

Debug info

Bot run #145

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 1.1.25
  2. palantirnet/drupal-rector: 0.13.1
project update bot’s picture

fathima.asmat’s picture

  • Tested Rector patch from #9 and couldn't apply due to missing info yml changes.
  • Amended the patch to include those changes and patch applied cleanly. Patch attached.
  • Upgrade status doesn't flag any more issues
 [notice] Processing /var/www/html/web/modules/contrib/site_settings.

================================================================================
Site Settings and Labels, --
Scanned on Sat, 11/19/2022 - 13:41

No known issues found.
  • Tested the module manually on both D9 and D10 beta.
  • Could successfully create a site setting with a field set.
  • Could render the site setting successfully on the front-end tempalte.
  • Screenshots of test results attached.
fathima.asmat’s picture

Reworked on D10 porting Day November :)

  • scott_euser committed 8ac1cf2 on 8.x-1.x
    Issue #3298089 by fathima.asmat, Project Update Bot: Automated Drupal 10...
scott_euser’s picture

Status: Needs review » Fixed

Thanks @fathima.asmat , much appreciated!
Scott

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.