Problem/Motivation

drupal-check results on commit hash:
source : [git] https://git.drupal.org/project/stage_file_proxy 4c3fa8d12703d8665032719ac002529d6d3a1c70
source : http://cgit.drupalcode.org/stage_file_proxy


 ------ --------------------------------------------- 
  Line   src/EventSubscriber/ProxySubscriber.php      
 ------ --------------------------------------------- 
  82     Call to deprecated method substr() of class  
         Drupal\Component\Utility\Unicode.            
  107    Call to deprecated method strlen() of class  
         Drupal\Component\Utility\Unicode.            
  107    Call to deprecated method substr() of class  
         Drupal\Component\Utility\Unicode.            
 ------ --------------------------------------------- 

 ------ --------------------------------------------------- 
  Line   src/Form/SettingsForm.php                          
 ------ --------------------------------------------------- 
  97     Call to deprecated method substr() of class        
         Drupal\Component\Utility\Unicode.                  
  120    Call to deprecated function drupal_set_message().  
 ------ --------------------------------------------------- 

 ------ --------------------------------------------------- 
  Line   stage_file_proxy.drush.inc                         
 ------ --------------------------------------------------- 
  33     Call to deprecated function drupal_set_message().  
  66     Call to deprecated method strlen() of class        
         Drupal\Component\Utility\Unicode.                  
  66     Call to deprecated method substr() of class        
         Drupal\Component\Utility\Unicode.                  
  90     Call to deprecated function drupal_set_message().  
  98     Call to deprecated function drupal_set_message().  
  109    Call to deprecated function drupal_set_message().  
 ------ --------------------------------------------------- 

 ------ --------------------------------------------------------- 
  Line   src/FetchManager.php                                     
 ------ --------------------------------------------------------- 
  60     Call to deprecated function file_prepare_directory().    
  168    Call to deprecated function file_unmanaged_save_data().  
 ------ --------------------------------------------------------- 

 [ERROR] Found 13 errors                                                    

 

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mcdwayne created an issue. See original summary.

Sergiu Stici’s picture

Status: Active » Needs review
FileSize
3.89 KB

Here is the patch, please review.

Status: Needs review » Needs work

The last submitted patch, 2: drupal_9_deprecated_code-3042934-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Sergiu Stici’s picture

Status: Needs work » Needs review
FileSize
4.32 KB

Corrected codesniffer.

Status: Needs review » Needs work

The last submitted patch, 4: drupal_9_deprecated_code-3042934-4.patch, failed testing. View results

JeroenT’s picture

Patch looks good!

Since Drupal 8.7 there are 2 new calls to deprecated functions in this module:

 ------ --------------------------------------------------------- 
  Line   src/FetchManager.php                                     
 ------ --------------------------------------------------------- 
  60     Call to deprecated function file_prepare_directory().    
  168    Call to deprecated function file_unmanaged_save_data().  
 ------ --------------------------------------------------------- 
JeroenT’s picture

Issue summary: View changes
Sergiu Stici’s picture

I updated the patch, please review.

Status: Needs review » Needs work

The last submitted patch, 8: drupal_9_deprecated_code-3042934-8.patch, failed testing. View results

JeroenT’s picture

Status: Needs work » Reviewed & tested by the community

Looks good!

JeroenT’s picture

There are still some calls to \Drupal in the classes. Created #3054293: Remove \Drupal calls in classes. Use dependency injection instead as a follow-up.

BarisW’s picture

Thanks for the patch and the review. It needed a re-roll, and the constants FILE_MODIFY_PERMISSIONS and FILE_CREATE_DIRECTORY needed to be replaced as well.

  • BarisW committed 77880c3 on 8.x-1.x authored by Sergiu Stici
    Issue #3042934 by Sergiu Stici, JeroenT, mcdwayne, BarisW: Drupal 9...
BarisW’s picture

Status: Reviewed & tested by the community » Fixed
mfernea’s picture

#6 makes the module incompatible with versions lower than 8.7 of Drupal core. I raised an issue here #3084611: prepareDirectory vs file_prepare_directory breaks with core <8.7.

Status: Fixed » Closed (fixed)

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