5/5 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ -------------------------------------------------------------------------- 
  Line   src/Form/EditorImagePopupDialog.php                                       
 ------ -------------------------------------------------------------------------- 
  95     Call to deprecated function file_upload_max_size():                       
         in Drupal 8.7.0 and will be removed before Drupal 9.0.0.                  
         Use \Drupal\Component\Utility\Environment::getUploadMaxSize() instead.    
  97     Call to deprecated method entityManager() of class Drupal:                
         in Drupal 8.0.0 and will be removed before Drupal 9.0.0.                  
         Use \Drupal::entityTypeManager() instead in most cases. If the needed     
         method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see the  
         deprecated \Drupal\Core\Entity\EntityManager to find the                  
         correct interface or service.                                             
 ------ -------------------------------------------------------------------------- 

                                                                                                                        
 [ERROR] Found 2 errors                                                                                                 
                                                                                                                        

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sahana _N created an issue. See original summary.

Sahana _N’s picture

Status: Active » Needs review
FileSize
1.14 KB

I have removed the deprecated code, please review the patch.

Ramya Balasubramanian’s picture

Hi @sahana,

In the above patch, I think there is a typo error in this line

$max_filesize = min(Bytes::toInt($image_upload['max_size']), Environment::getUploadMaxSiz());

Ramya Balasubramanian’s picture

Assigned: Unassigned » Ramya Balasubramanian
Issue tags: +Drupal 9 porting weekend, +DIACWMay2020
Ramya Balasubramanian’s picture

Status: Needs review » Needs work
Ramya Balasubramanian’s picture

Status: Needs work » Needs review
FileSize
1.14 KB

Hi,
Please review this patch.

HarishST’s picture

Assigned: Ramya Balasubramanian » HarishST
Status: Needs review » Needs work

Changing status to Needs Work. Since there are some issues found as below.
Patch available in the duplicate issue Drupal 9 readiness.
Need to add Core Version Requirement to make it compatible.


CUSTOM PROJECTS
--------------------------------------------------------------------------------
Image Popup Formatter
Scanned on Sat, 05/23/2020 - 15:42.

2 errors found. 1 warning found.

C:\wamp64\www\d9-readiness\web\modules\contrib\image_popup\src\Form\EditorImageP
opupDialog.php:
┌─────────┬──────┬──────────────────────────────────────────────────────────────┐
│ STATUS  │ LINE │                           MESSAGE                            │
├─────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Fix now │ 45   │ Call to deprecated method getStorage() of class              │
│         │      │ Drupal\Core\Entity\EntityManager. Deprecated in drupal:8.0.0 │
│         │      │ and is removed from drupal:9.0.0. Use                        │
│         │      │ Drupal\Core\Entity\EntityTypeManagerInterface::getStorage()  │
│         │      │ instead.                                                     │
│         │      │                                                              │
└─────────┴──────┴──────────────────────────────────────────────────────────────┘

C:\wamp64\www\d9-readiness\web\modules\contrib\image_popup\src\Plugin\Field\Fiel
dFormatter\ImagePopupFieldFormatter.php:
┌─────────┬──────┬──────────────────────────────────────────────────────────────┐
│ STATUS  │ LINE │                           MESSAGE                            │
├─────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Fix now │ 98   │ Call to deprecated method getStorage() of class              │
│         │      │ Drupal\Core\Entity\EntityManager. Deprecated in drupal:8.0.0 │
│         │      │ and is removed from drupal:9.0.0. Use                        │
│         │      │ Drupal\Core\Entity\EntityTypeManagerInterface::getStorage()  │
│         │      │ instead.                                                     │
│         │      │                                                              │
└─────────┴──────┴──────────────────────────────────────────────────────────────┘

modules/contrib/image_popup/image_popup.info.yml:
┌──────────┬──────┬────────────────────────────────────────────────────────┐
│  STATUS  │ LINE │                        MESSAGE                         │
├──────────┼──────┼────────────────────────────────────────────────────────┤
│ Check    │ 0    │ Add core_version_requirement: ^8 || ^9 to │
│ manually │      │ image_popup.info.yml to designate that the module is   │
│          │      │ compatible with Drupal 9. See                          │
│          │      │ https://drupal.org/node/3070687.                       │
│          │      │                                                        │
└──────────┴──────┴────────────────────────────────────────────────────────┘
HarishST’s picture

Assigned: HarishST » Unassigned
Status: Needs work » Needs review
FileSize
2.52 KB

This patch fixes all the issues. Please review and verify! Thank you.

Kristen Pol’s picture

@HarishST it's good to provide an interdiff when updating patches. https://www.drupal.org/documentation/git/interdiff

HarishST’s picture

Assigned: Unassigned » HarishST
Status: Needs review » Needs work

Sure @Kristen. Will add the interdiff along with the patch.

HarishST’s picture

Assigned: HarishST » Unassigned
Status: Needs work » Needs review
FileSize
1.58 KB
2.52 KB

I have added the interdiff along with the patch. @Kristen I have followed the procedure from the link you shared. Can you please verify the interdiff is fine and valid.

rakesh.gectcr’s picture

Needs work, upgrade status giving

Avoid some manual work by using drupal-rector to fix issues automatically or Upgrade Rector to generate patches.
File name	Line	Error
web/modules/contrib/image_popup/src/Form/EditorImagePopupDialog.php	97	Call to deprecated method entityManager() of class Drupal. Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use Drupal::entityTypeManager() instead in most cases. If the needed method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see the deprecated \Drupal\Core\Entity\EntityManager to find the correct interface or service.
Fix now manually
It does not seem like these are covered by automation yet. Contribute to drupal-rector to provide coverage. Fix manually in the meantime.
File name	Line	Error
web/modules/contrib/image_popup/src/Form/EditorImagePopupDialog.php	44	Call to deprecated method getStorage() of class Drupal\Core\Entity\EntityManager. Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() instead.
web/modules/contrib/image_popup/src/Form/EditorImagePopupDialog.php	95	Call to deprecated function file_upload_max_size(). Deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. Use Drupal\Component\Utility\Environment::getUploadMaxSize() instead.
web/modules/contrib/image_popup/src/Plugin/Field/FieldFormatter/ImagePopupFieldFormatter.php	108	Call to deprecated method getStorage() of class Drupal\Core\Entity\EntityManager. Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() instead.
Check manually
Errors without Drupal source version numbers including parse errors and use of APIs from dependencies.
File name	Line	Error
web/modules/contrib/image_popup/image_popup.info.yml	0	Add core_version_requirement: ^8 || ^9 to image_popup.info.yml to designate that the module is compatible with Drupal 9. See https://drupal.org/node/3070687.
rakesh.gectcr’s picture

Title: Remove deprecated code » Drupal 9 readiness
rakesh.gectcr’s picture

rakesh.gectcr’s picture

Assigned: Unassigned » rakesh.gectcr
Status: Needs review » Needs work
Issue tags: -DIACWMay2020 +Drupal 9 compatibilityDrupal 9 porting weekendDIACWMay2020
HarishST’s picture

Issue tags: -Drupal 9 compatibilityDrupal 9 porting weekendDIACWMay2020 +Drupal 9 compatibility, +DIACWMay2020
FileSize
1.66 MB

@Rakesh I haven't found any issue on Upgrade Status after applying the patch. Am I missing something? I new in here, can you guide?

Also, Fixing Issue Tags.

vebrovski’s picture

Status: Needs work » Needs review

Hi, I applied patch #11 and I don't see any issues in upgrade status or Rector.

BalajiDS’s picture

patch #11 works fine.
Thanks,
@HarishST

HarishST’s picture

@BalajiDS, please change the status to 'Reviewed & tested by community', if the patch works for you. Thank you!

Manav’s picture

Assigned: rakesh.gectcr » Manav
Status: Needs review » Reviewed & tested by the community
FileSize
35.87 KB
37.28 KB

@HarishST: After appling the #11 patch. I didn't find issue.
Everything is wroking as exptected.
I have tested it with drupal_check and upgrade_status.
Attaching screen-shots.

Patch is working as expected.

RTBC

Manav’s picture

Assigned: Manav » Unassigned
JayKandari’s picture

Version: 8.x-1.x-dev » 2.x-dev
Issue tags: +DIACWSep2020

  • JayKandari committed 2d6b8c2 on 2.x authored by HarishST
    Issue #3120749 by HarishST, Ramya Balasubramanian, Sahana _N, Manav,...
JayKandari’s picture


Tested the patch #11 on a Drupal 9.1.x instance

Merged & Pushed to 2.x branch. Will create a new D9 compatible release shortly.

Thank you all for your contributions.

JayKandari’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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