Drupal 10 compatibility updates

Created on 12 March 2023, over 1 year ago
Updated 6 November 2023, 8 months ago

The module needs some updates to be compatible with D10.

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

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

Comments & Activities

  • Issue created by @DamienMcKenna
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    From drupal-check:

    
     ------ --------------------------------------------------------------------- 
      Line   commerce_product_restriction.module                                  
     ------ --------------------------------------------------------------------- 
      26     Variable $selected_variation_id in empty() always exists and is not  
             falsy.                                                               
      52     Call to an undefined method                                          
             Drupal\Core\Entity\EntityInterface::getItems().                      
      120    Call to an undefined method                                          
             Drupal\commerce_product_restriction\AvailabilityChecker::check().    
      126    Call to an undefined method                                          
             Drupal\commerce_product_restriction\AvailabilityChecker::check().    
     ------ --------------------------------------------------------------------- 
    
     ------ ----------------------------------------------------------- 
      Line   src/AvailabilityChecker.php                                
     ------ ----------------------------------------------------------- 
      54     Call to an undefined method                                
             Drupal\commerce\PurchasableEntityInterface::getProduct().  
     ------ ----------------------------------------------------------- 
    
     ------ ---------------------------------------------- 
      Line   src/Element/Restrictions.php                  
     ------ ---------------------------------------------- 
      122    Call to an undefined method                   
             Drupal\Core\Form\FormInterface::getEntity().  
     ------ ---------------------------------------------- 
    
     ------ ----------------------------------------------------------------------- 
      Line   src/Plugin/Commerce/ProductRestriction/DatesRestriction.php            
     ------ ----------------------------------------------------------------------- 
      154    Method                                                                 
             Drupal\commerce_product_restriction\Plugin\Commerce\ProductRestrictio  
             n\DatesRestriction::accessErrorMessage() has invalid return type       
             Drupal\commerce_product_restriction\Plugin\TranslatableMarkup.         
     ------ ----------------------------------------------------------------------- 
    
     ------ ----------------------------------------------------------------------- 
      Line   src/Plugin/Commerce/ProductRestriction/PasswordRestriction.php         
     ------ ----------------------------------------------------------------------- 
      72     Call to an undefined method                                            
             Drupal\Core\Form\FormInterface::getEntity().                           
      116    Call to an undefined method                                            
             Drupal\Core\Form\FormInterface::getEntity().                           
      140    Call to an undefined method                                            
             Drupal\Core\Entity\EntityInterface::getPurchasedEntity().              
      159    Method                                                                 
             Drupal\commerce_product_restriction\Plugin\Commerce\ProductRestrictio  
             n\PasswordRestriction::accessErrorMessage() has invalid return type    
             Drupal\commerce_product_restriction\Plugin\TranslatableMarkup.         
     ------ ----------------------------------------------------------------------- 
    
     ------ ----------------------------------------------------------------------- 
      Line   src/Plugin/Commerce/ProductRestriction/PurchaseQuantityRestriction.ph  
             p                                                                      
     ------ ----------------------------------------------------------------------- 
      74     Call to an undefined method                                            
             Drupal\Core\Entity\EntityInterface::getProduct().                      
      127    Method                                                                 
             Drupal\commerce_product_restriction\Plugin\Commerce\ProductRestrictio  
             n\PurchaseQuantityRestriction::accessErrorMessage() has invalid        
             return type                                                            
             Drupal\commerce_product_restriction\Plugin\TranslatableMarkup.         
     ------ ----------------------------------------------------------------------- 
    
     ------ ----------------------------------------------------------------------- 
      Line   src/Plugin/Commerce/ProductRestriction/UserRestriction.php             
     ------ ----------------------------------------------------------------------- 
      83     Method                                                                 
             Drupal\commerce_product_restriction\Plugin\Commerce\ProductRestrictio  
             n\UserRestriction::accessErrorMessage() has invalid return type        
             Drupal\commerce_product_restriction\Plugin\TranslatableMarkup.         
     ------ ----------------------------------------------------------------------- 
    
     ------ ----------------------------------------------------------------------- 
      Line   src/Plugin/Commerce/ProductRestriction/UserRoleRestriction.php         
     ------ ----------------------------------------------------------------------- 
      74     Method                                                                 
             Drupal\commerce_product_restriction\Plugin\Commerce\ProductRestrictio  
             n\UserRoleRestriction::accessErrorMessage() has invalid return type    
             Drupal\commerce_product_restriction\Plugin\TranslatableMarkup.         
     ------ ----------------------------------------------------------------------- 
    
     ------ ----------------------------------------------------------------------- 
      Line   src/Plugin/ProductRestrictionPluginBase.php                            
     ------ ----------------------------------------------------------------------- 
      69     Method                                                                 
             Drupal\commerce_product_restriction\Plugin\ProductRestrictionPluginBa  
             se::accessErrorMessage() has invalid return type                       
             Drupal\commerce_product_restriction\Plugin\TranslatableMarkup.         
     ------ ----------------------------------------------------------------------- 
    
     ------ ----------------------------------------------------------------------- 
      Line   src/Plugin/ProductRestrictionPluginInterface.php                       
     ------ ----------------------------------------------------------------------- 
      19     Method                                                                 
             Drupal\commerce_product_restriction\Plugin\ProductRestrictionPluginIn  
             terface::accessErrorMessage() has invalid return type                  
             Drupal\commerce_product_restriction\Plugin\TranslatableMarkup.         
     ------ ----------------------------------------------------------------------- 
    
     [ERROR] Found 17 errors                                                        
    
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    This resolves many of the issues, now it's down to:

     ------ ------------------------------------------------------------------- 
      Line   commerce_product_restriction.module                                
     ------ ------------------------------------------------------------------- 
      121    Call to an undefined method                                        
             Drupal\commerce_product_restriction\AvailabilityChecker::check().  
      127    Call to an undefined method                                        
             Drupal\commerce_product_restriction\AvailabilityChecker::check().  
     ------ ------------------------------------------------------------------- 
    
     ------ ----------------------------------------------------------- 
      Line   src/AvailabilityChecker.php                                
     ------ ----------------------------------------------------------- 
      54     Call to an undefined method                                
             Drupal\commerce\PurchasableEntityInterface::getProduct().  
     ------ ----------------------------------------------------------- 
    
     ------ ---------------------------------------------- 
      Line   src/Element/Restrictions.php                  
     ------ ---------------------------------------------- 
      122    Call to an undefined method                   
             Drupal\Core\Form\FormInterface::getEntity().  
     ------ ---------------------------------------------- 
    
     ------ ---------------------------------------------------------------- 
      Line   src/Plugin/Commerce/ProductRestriction/PasswordRestriction.php  
     ------ ---------------------------------------------------------------- 
      72     Call to an undefined method                                     
             Drupal\Core\Form\FormInterface::getEntity().                    
      117    Call to an undefined method                                     
             Drupal\Core\Form\FormInterface::getEntity().                    
      120    Call to an undefined method                                     
             Drupal\commerce\PurchasableEntityInterface::getProduct().       
     ------ ---------------------------------------------------------------- 
    
     ------ ----------------------------------------------------------------------- 
      Line   src/Plugin/Commerce/ProductRestriction/PurchaseQuantityRestriction.ph  
             p                                                                      
     ------ ----------------------------------------------------------------------- 
      74     Call to an undefined method                                            
             Drupal\Core\Entity\EntityInterface::getProduct().                      
     ------ ----------------------------------------------------------------------- 
    
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Note - most of the changes reported by drupal-check are code cleanliness issues, rather than D10 bugs, the only actual compatibility issues seem to be the info file.

  • πŸ‡«πŸ‡·France Mitsuko

    Hi maxwellkeeble,

    First, thanks to share this module. It's very useful !

    I wanted to know if you were planning an update to the development branch for Drupal 10 in the more or less near future ?

    Thanks a lot for your response

  • Hi, I've incorporated the changes from the patch and some other minor bug changes and done a D10 release. Let me know if any issues.

  • Status changed to Fixed 8 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024