Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Issue tags: +Drupal 9 compatibility
damienmckenna’s picture

Assigned: Unassigned » damienmckenna

Working on this.

damienmckenna’s picture

Assigned: damienmckenna » Unassigned

Here's what drupal-check currently shows:

 36/36 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ --------------------------------------------------------------------------------------------------------------- 
  Line   src/Plugin/yaml_content/process/File.php                                                                       
 ------ --------------------------------------------------------------------------------------------------------------- 
  48     Call to deprecated constant FILE_CREATE_DIRECTORY: Deprecated in drupal:8.7.0 and is removed from              
         drupal:9.0.0. Use \Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY.                                     
  48     Call to deprecated function file_prepare_directory():                                                          
         in drupal:8.7.0 and is removed from drupal:9.0.0.                                                              
         Use \Drupal\Core\File\FileSystemInterface::prepareDirectory().                                                 
  51     Call to deprecated constant FILE_EXISTS_REPLACE: Deprecated in drupal:8.7.0 and is removed from drupal:9.0.0.  
         Use \Drupal\Core\File\FileSystemInterface::EXISTS_REPLACE.                                                     
 ------ --------------------------------------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------- 
  Line   src/Service/LoadHelper.php                                            
 ------ ---------------------------------------------------------------------- 
  142    Call to deprecated function file_scan_directory():                    
         in drupal:8.8.0 and is removed from drupal:9.0.0.                     
         Use \Drupal\Core\File\FileSystemInterface::scanDirectory() instead.   
  164    Call to deprecated function drupal_set_message():                     
         in drupal:8.5.0 and is removed from drupal:9.0.0.                     
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.  
  174    Call to deprecated function drupal_set_message():                     
         in drupal:8.5.0 and is removed from drupal:9.0.0.                     
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.  
 ------ ---------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------------------------------- 
  Line   tests/src/Functional/Plugin/yaml_content/process/FileTest.php                                              
 ------ ----------------------------------------------------------------------------------------------------------- 
         Class Drupal\Tests\yaml_content\Kernel\Plugin\yaml_content\process\FileTest was not found while trying to  
         analyse it - autoloading is probably not configured properly.                                              
 ------ ----------------------------------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------------- 
  Line   tests/src/Unit/ContentLoader/ContentLoaderTest.php                                    
 ------ -------------------------------------------------------------------------------------- 
  103    Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:  
         in drupal:8.8.0 and is removed from drupal:9.0.0.                                     
         Backward compatibility for PHPUnit 4 will no longer be supported.                     
  115    Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:  
         in drupal:8.8.0 and is removed from drupal:9.0.0.                                     
         Backward compatibility for PHPUnit 4 will no longer be supported.                     
 ------ -------------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------------- 
  Line   tests/src/Unit/Plugin/yaml_content/process/FileTest.php                               
 ------ -------------------------------------------------------------------------------------- 
  51     Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:  
         in drupal:8.8.0 and is removed from drupal:9.0.0.                                     
         Backward compatibility for PHPUnit 4 will no longer be supported.                     
  63     Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:  
         in drupal:8.8.0 and is removed from drupal:9.0.0.                                     
         Backward compatibility for PHPUnit 4 will no longer be supported.                     
 ------ -------------------------------------------------------------------------------------- 


 [ERROR] Found 11 errors                                                                                                
pavnish’s picture

Assigned: Unassigned » pavnish
pavnish’s picture

Assigned: pavnish » Unassigned
Status: Active » Needs review
Issue tags: +Srijancontribution2020
StatusFileSize
new3.75 KB

Patch Added

pavnish’s picture

StatusFileSize
new4.04 KB
damienmckenna’s picture

FYI I've enabled D9 tests for this module, which will make it easier to confirm it all works.

robpowell’s picture

StatusFileSize
new11.73 KB

@pavnish, I think what you loaded was for the wrong module. Here is an attempt at getting yaml_content d9 ready. This includes changes to automated tests for new dependency injection.

damienmckenna’s picture

Maybe it was for the 8.x-2.x branch?

damienmckenna’s picture

I split off the core_version_requirement line into a separate issue so that we can commit it first: #3125818: Update yaml_content.info.yml to be compatible with D9

damienmckenna’s picture

StatusFileSize
new11.42 KB

Rerolled after committing the info file change.

damienmckenna’s picture

The rerolled patch works with D8.8, let's see if it passes with D9.

damienmckenna’s picture

Fixes the two theme variables, let's see if the third item is fixed too.

Status: Needs review » Needs work

The last submitted patch, 14: yaml_content-n3112945-14.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

damienmckenna’s picture

So with the other changes ContentLoaderTest::testMissingContentFile() no longer throws an exception, instead it gives an error.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new1.57 KB
new8.33 KB

Commenting out that test for now, I figured we could add it back in again separately.

Status: Needs review » Needs work

The last submitted patch, 17: yaml_content-n3112945-17.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new8.74 KB
new1.91 KB

I think the reason the test failed was that the assertTaxonomy() method should have had an EntityInterface as its first argument, let's see if the tests pass now.

damienmckenna’s picture

StatusFileSize
new505 bytes
new8.73 KB

This should fix the EntityReferenceTestTrait problem.

damienmckenna’s picture

StatusFileSize
new11.05 KB
new4.85 KB

Trying to fix additional deprecated test methods, per https://www.drupal.org/node/3056869.

Status: Needs review » Needs work

The last submitted patch, 21: yaml_content-n3112945-21.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new11.05 KB
new605 bytes

Let's see if this resolves the exceptional problem.

damienmckenna’s picture

The D8.8 tests pass, let's try the D9.0 tests.

damienmckenna’s picture

Ok, replacing @expectedException with $this->expectException().

damienmckenna’s picture

D8.8 still passes, hopefully this will be enough for D9.0.

  • DamienMcKenna committed a4d7b94 on 8.x-1.x
    Issue #3112945 by DamienMcKenna, pavnish, robpowell: Drupal 9...
damienmckenna’s picture

Status: Needs review » Fixed

And the tests pass for D9! Woot! Committed.

damienmckenna’s picture

Status: Fixed » Needs work

I reran drupal-check and it found the following:


 ------ --------------------------------------------------------------------------------------------------------------- 
  Line   src/Plugin/yaml_content/process/File.php                                                                       
 ------ --------------------------------------------------------------------------------------------------------------- 
  48     Call to deprecated constant FILE_CREATE_DIRECTORY: Deprecated in drupal:8.7.0 and is removed from              
         drupal:9.0.0. Use \Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY.                                     
  48     Call to deprecated function file_prepare_directory():                                                          
         in drupal:8.7.0 and is removed from drupal:9.0.0.                                                              
         Use \Drupal\Core\File\FileSystemInterface::prepareDirectory().                                                 
  51     Call to deprecated constant FILE_EXISTS_REPLACE: Deprecated in drupal:8.7.0 and is removed from drupal:9.0.0.  
         Use \Drupal\Core\File\FileSystemInterface::EXISTS_REPLACE.                                                     
 ------ --------------------------------------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------- 
  Line   src/Service/LoadHelper.php                                            
 ------ ---------------------------------------------------------------------- 
  142    Call to deprecated function file_scan_directory():                    
         in drupal:8.8.0 and is removed from drupal:9.0.0.                     
         Use \Drupal\Core\File\FileSystemInterface::scanDirectory() instead.   
  164    Call to deprecated function drupal_set_message():                     
         in drupal:8.5.0 and is removed from drupal:9.0.0.                     
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.  
  174    Call to deprecated function drupal_set_message():                     
         in drupal:8.5.0 and is removed from drupal:9.0.0.                     
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.  
 ------ ---------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------------------------------- 
  Line   tests/src/Functional/Plugin/yaml_content/process/FileTest.php                                              
 ------ ----------------------------------------------------------------------------------------------------------- 
         Class Drupal\Tests\yaml_content\Kernel\Plugin\yaml_content\process\FileTest was not found while trying to  
         analyse it - autoloading is probably not configured properly.                                              
 ------ ----------------------------------------------------------------------------------------------------------- 

Back to needing more work.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new4.9 KB

This covers everything except for the FileTest.php, and I'm not sure why that one isn't being recognized when ReferenceTest.php is.

  • DamienMcKenna committed 7fb3322 on 8.x-1.x
    Issue #3112945 by DamienMcKenna: Additional D9 compatibility fixes.
    
damienmckenna’s picture

Status: Needs review » Fixed

Committed.

I think the warning about FileTest is incorrect, given that it shows in the test results:

11:45:31 Tests to be run:
11:45:31   - Drupal\Tests\yaml_content\Unit\Plugin\yaml_content\process\ReferenceTest
11:45:31   - Drupal\Tests\yaml_content\Unit\Plugin\yaml_content\process\FileTest
[..]
11:45:31 Test summary
11:45:31 ------------
[..]
11:45:32 Drupal\Tests\yaml_content\Unit\Plugin\yaml_content\process\F   2 passes                                      
11:45:32 Drupal\Tests\yaml_content\Unit\Plugin\yaml_content\process\R   3 passes                                      

All done.

damienmckenna’s picture

damienmckenna’s picture

It turned out there are *two* FileTest.php files, I missed the other one and TR pointed out the problem - the namespace was wrong. I moved this into a separate issue as it's a generic problem that isn't strictly D9 related: #3127248

Status: Fixed » Closed (fixed)

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