localgovdrupal / localgov_directories

Searchable, filterable, directories of information, and locations.
1 stars 3 forks source link

Code Deprecation errors #335

Open stephen-cox opened 9 months ago

stephen-cox commented 9 months ago

Error: Usage of deprecated trait Drupal\Tests\field\Traits\EntityReferenceTestTrait in class Drupal\Tests\localgov_directories\Functional\ChannelFacetsWidgetAdminTest:
in drupal:10.2.0 and is removed from drupal:11.0.0. Use
   \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait instead.
Error: Usage of deprecated trait Drupal\Tests\field\Traits\EntityReferenceTestTrait in class Drupal\Tests\localgov_directories\FunctionalJavascript\EntityReferenceFacetsWidgetTest:
in drupal:10.2.0 and is removed from drupal:11.0.0. Use
   \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait instead.
Error: Usage of deprecated trait Drupal\Tests\field\Traits\EntityReferenceTestTrait in class Drupal\Tests\localgov_directories\Kernel\EntityReferenceChannelsSelectionTest:
in drupal:10.2.0 and is removed from drupal:11.0.0. Use
   \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait instead.
Error: Usage of deprecated trait Drupal\Tests\field\Traits\EntityReferenceTestTrait in class Drupal\Tests\localgov_directories\Kernel\EntityReferenceDirectoryEntryTypesTest:
in drupal:10.2.0 and is removed from drupal:11.0.0. Use
   \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait instead.
Error: Usage of deprecated trait Drupal\Tests\field\Traits\EntityReferenceTestTrait in class Drupal\Tests\localgov_directories\Kernel\FacetIndexFieldSetupTest:
in drupal:10.2.0 and is removed from drupal:11.0.0. Use
   \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait instead.
Error: Usage of deprecated trait Drupal\Tests\field\Traits\EntityReferenceTestTrait in class Drupal\Tests\localgov_directories\Kernel\IndexTitleSortTest:
in drupal:10.2.0 and is removed from drupal:11.0.0. Use
   \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait instead.
 ------ ---------------------------------------------------------------------------- 
  Line   tests/src/Functional/ChannelFacetsWidgetAdminTest.php                       
 ------ ---------------------------------------------------------------------------- 
  21     Usage of deprecated trait                                                   
         Drupal\Tests\field\Traits\EntityReferenceTestTrait in class                 
         Drupal\Tests\localgov_directories\Functional\ChannelFacetsWidgetAdminTest:  
         in drupal:10.2.0 and is removed from drupal:11.0.0. Use                     
            \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait             
         instead.                                                                    
 ------ ---------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------------- 
  Line   tests/src/FunctionalJavascript/EntityReferenceFacetsWidgetTest.php                       
 ------ ----------------------------------------------------------------------------------------- 
  23     Usage of deprecated trait                                                                
         Drupal\Tests\field\Traits\EntityReferenceTestTrait in class                              
         Drupal\Tests\localgov_directories\FunctionalJavascript\EntityReferenceFacetsWidgetTest:  
         in drupal:10.2.0 and is removed from drupal:11.0.0. Use                                  
            \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait                          
         instead.                                                                                 
 ------ ----------------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------- 
  Line   tests/src/Kernel/EntityReferenceChannelsSelectionTest.php                       
 ------ -------------------------------------------------------------------------------- 
  19     Usage of deprecated trait                                                       
         Drupal\Tests\field\Traits\EntityReferenceTestTrait in class                     
         Drupal\Tests\localgov_directories\Kernel\EntityReferenceChannelsSelectionTest:  
         in drupal:10.2.0 and is removed from drupal:11.0.0. Use                         
            \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait                 
         instead.                                                                        
 ------ -------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------- 
  Line   tests/src/Kernel/EntityReferenceDirectoryEntryTypesTest.php                       
 ------ ---------------------------------------------------------------------------------- 
  18     Usage of deprecated trait                                                         
         Drupal\Tests\field\Traits\EntityReferenceTestTrait in class                       
         Drupal\Tests\localgov_directories\Kernel\EntityReferenceDirectoryEntryTypesTest:  
         in drupal:10.2.0 and is removed from drupal:11.0.0. Use                           
            \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait                   
         instead.                                                                          
 ------ ---------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------- 
  Line   tests/src/Kernel/FacetIndexFieldSetupTest.php                       
 ------ -------------------------------------------------------------------- 
  20     Usage of deprecated trait                                           
         Drupal\Tests\field\Traits\EntityReferenceTestTrait in class         
         Drupal\Tests\localgov_directories\Kernel\FacetIndexFieldSetupTest:  
         in drupal:10.2.0 and is removed from drupal:11.0.0. Use             
            \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait     
         instead.                                                            
 ------ -------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------- 
  Line   tests/src/Kernel/IndexTitleSortTest.php                          
 ------ ----------------------------------------------------------------- 
  25     Usage of deprecated trait                                        
         Drupal\Tests\field\Traits\EntityReferenceTestTrait in class      
         Drupal\Tests\localgov_directories\Kernel\IndexTitleSortTest:     
         in drupal:10.2.0 and is removed from drupal:11.0.0. Use          
            \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait  
         instead.                                                         
 ------ ----------------------------------------------------------------- 
stephen-cox commented 9 months ago

Also when running PHPUnit tests:

There were 2 errors:

1) Drupal\Tests\localgov_directories\Functional\FacetsTest::testFacetsGroupFilters
Exception: Deprecated function: Creation of dynamic property Drupal\facets\Result\Result::$transliterateDisplayValue is deprecated
Drupal\facets\Plugin\facets\processor\DisplayValueWidgetOrderProcessor->sortResults()() (Line: 72)

/var/www/html/web/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:55
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:209
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:158
/var/www/html/vendor/guzzlehttp/promises/src/TaskQueue.php:52
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:251
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:227
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:272
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:229
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:69
/var/www/html/vendor/guzzlehttp/guzzle/src/Client.php:189
/var/www/html/web/core/tests/Drupal/Tests/DrupalTestBrowser.php:137
/var/www/html/vendor/symfony/browser-kit/AbstractBrowser.php:385
/var/www/html/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php:122
/var/www/html/vendor/behat/mink/src/Session.php:175
/var/www/html/web/core/tests/Drupal/Tests/UiHelperTrait.php:238
/var/www/html/web/modules/contrib/localgov_directories/tests/src/Functional/FacetsTest.php:253
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

2) Drupal\Tests\localgov_directories\Functional\FacetsTest::testFacetSearchShowsAccessibleFacet
Exception: Deprecated function: Creation of dynamic property Drupal\facets\Result\Result::$transliterateDisplayValue is deprecated
Drupal\facets\Plugin\facets\processor\DisplayValueWidgetOrderProcessor->sortResults()() (Line: 72)

/var/www/html/web/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:55
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:209
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:158
/var/www/html/vendor/guzzlehttp/promises/src/TaskQueue.php:52
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:251
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:227
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:272
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:229
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:69
/var/www/html/vendor/guzzlehttp/guzzle/src/Client.php:189
/var/www/html/web/core/tests/Drupal/Tests/DrupalTestBrowser.php:137
/var/www/html/vendor/symfony/browser-kit/AbstractBrowser.php:385
/var/www/html/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php:122
/var/www/html/vendor/behat/mink/src/Session.php:175
/var/www/html/web/core/tests/Drupal/Tests/UiHelperTrait.php:238
/var/www/html/web/modules/contrib/localgov_directories/tests/src/Functional/FacetsTest.php:425
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

FAILURES!                             
ekes commented 9 months ago

How we dealing with patches from branches https://www.drupal.org/project/facets/issues/3336646 fixes the Facets dynamic property error, but it's two commits on a branch, and I don't want to add a .diff or a MR as anyone can push to that.

Ignore me it's not it's one commit https://git.drupalcode.org/project/facets/-/commit/834e05169a282f83604cf00db94ffd7458c1ab9c?merge_request_iid=129

ekes commented 9 months ago

Seems to be there https://github.com/localgovdrupal/localgov_directories/commit/5517c81d8015d717a062df29bb691e720c3c805c but not applying? Well it's not applied to my composer install, and it is there in the composer file.

finnlewis commented 8 months ago

Still an issue https://github.com/localgovdrupal/localgov_project/actions/runs/7829907369/job/22029486252?pr=151#step:4:37