Problem/Motivation

source : [git] https://git.drupal.org/project/embed fcc97638807dd981207175d027d0f2ea7a8bbc41

Results from Drupal Check:

 ------ ------------------------------------------------------------------------------- 
  Line   src/Entity/EmbedButton.php                                                     
 ------ ------------------------------------------------------------------------------- 
  118    Call to deprecated method entityManager() of class Drupal\Core\Entity\Entity.  
  141    Call to deprecated method entityManager() of class Drupal\Core\Entity\Entity.  
 ------ ------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------- 
  Line   src/Form/EmbedButtonForm.php                                                      
 ------ ---------------------------------------------------------------------------------- 
  105    Call to deprecated function drupal_set_message().                                 
  122    Call to deprecated function drupal_set_message().                                 
  199    Call to deprecated function drupal_set_message().                                 
  202    Call to deprecated function drupal_set_message().                                 
  203    Call to deprecated method link() of class Drupal\Core\Entity\EntityInterface.     
  207    Call to deprecated method urlInfo() of class Drupal\Core\Entity\EntityInterface.  
 ------ ---------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------- 
  Line   tests/embed_test/src/Plugin/EmbedType/Aircraft.php  
 ------ ---------------------------------------------------- 
  62     Call to deprecated function drupal_set_message().   
 ------ ---------------------------------------------------- 

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

oheller created an issue. See original summary.

sergiu stici’s picture

Status: Active » Needs review
StatusFileSize
new6.38 KB

Here is the patch, please review.

Status: Needs review » Needs work

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

mohammad-fayoumi’s picture

StatusFileSize
new3.69 KB
mohammad-fayoumi’s picture

Status: Needs work » Needs review
joegraduate’s picture

Issue tags: +badcamp2019
StatusFileSize
new3.7 KB
new1.16 KB

Attached patch is a modified version of #4 which should hopefully fix the failing tests.

FWIW, it looks like it might actually be preferable to replace EntityManager::loadEntityByUuid with EntityRepositoryInterface::loadEntityByUuid() (like was started in #2).

BADcamp info: Blue Queen of Clubs

Status: Needs review » Needs work

The last submitted patch, 6: 3042596-6.patch, failed testing. View results

joegraduate’s picture

StatusFileSize
new4.41 KB
new1.87 KB

Attached patch adds EntityRepositoryInterface as a dependency and replaces EntityManager::loadEntityByUuid() with EntityRepositoryInterface::loadEntityByUuid() instead of using EntityStorageInterface::loadByProperties(), similar to #2 but it also includes a \Drupal::service() fallback.

Hopefully this fixes the failing tests better than #6.

BADcamp info: Blue Queen of Clubs

joegraduate’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 8: 3042596-7.patch, failed testing. View results

joegraduate’s picture

Status: Needs work » Needs review
StatusFileSize
new4.42 KB
new747 bytes

Made EntityRepositoryInterface dependency optional.

BADcamp info: Blue Queen of Clubs

Status: Needs review » Needs work

The last submitted patch, 11: 3042596-8.patch, failed testing. View results

joegraduate’s picture

I believe the remaining test that is failing, Drupal\Tests\embed\Kernel\IconFileUsageTest::testEmbedButtonIconUsage, is actually failing due to this core change: https://www.drupal.org/node/2891902 and may no longer be valid.

joegraduate’s picture

Status: Needs work » Needs review
StatusFileSize
new1.27 KB
new5.19 KB

Added fix for failing test from #3002291: IconFileUsageTest fails after change in Drupal 8.4 and fixed docblock for EmbedButton::__contstruct().

joegraduate’s picture

StatusFileSize
new2.41 KB
new4.69 KB

Made the code for loading the EntityRepository service more like the existing service-loading methods on the EmbedButton class. This is now ready for serious review IMHO.

sharique’s picture

StatusFileSize
new5.51 KB
new890 bytes

There one more deprecation.

  embed git:(8.x-1.x) ✗ drupal-check .
 28/28 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ---------------------------------------------------------------------------------------------------------------------------------------
  Line   src/EmbedType/EmbedTypeInterface.php
 ------ ---------------------------------------------------------------------------------------------------------------------------------------
  14     Interface Drupal\embed\EmbedType\EmbedTypeInterface extends deprecated interface Drupal\Component\Plugin\ConfigurablePluginInterface:
         Drupal\Component\Plugin\ConfigurablePluginInterface is deprecated
         in Drupal 8.7.0 and will be removed before Drupal 9.0.0. You should implement
         ConfigurableInterface and/or DependentPluginInterface directly as needed. If
         you implement ConfigurableInterface you may choose to implement
         ConfigurablePluginInterface in Drupal 8 as well for maximum compatibility,
         however this must be removed prior to Drupal 9.
 ------ 

 [ERROR] Found 1 error

I updated patch to address it.

joshi.rohit100’s picture

Status: Needs review » Needs work

After applying the patch in #16, I still see deprecation errors -

 28/28 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ------------------------------------------------------------------------------------------------
  Line   src/Tests/EmbedTestBase.php
 ------ ------------------------------------------------------------------------------------------------
  13     Class Drupal\embed\Tests\EmbedTestBase extends deprecated class Drupal\simpletest\WebTestBase:
         in drupal:8.8.0 and is removed from drupal:9.0.0. Instead,
         use \Drupal\Tests\BrowserTestBase. See https://www.drupal.org/node/3030340.
  46     Call to method setUp() of deprecated class Drupal\simpletest\WebTestBase:
         in drupal:8.8.0 and is removed from drupal:9.0.0. Instead,
         use \Drupal\Tests\BrowserTestBase. See https://www.drupal.org/node/3030340.
 ------ ------------------------------------------------------------------------------------------------


 [ERROR] Found 2 errors

andreyjan’s picture

Status: Needs work » Needs review

Regarding to #17, I've created a separate issue to convert SimpleTest tests to FunctionalJavascript https://www.drupal.org/project/embed/issues/3096857, so moving this to needs review back,

joshi.rohit100’s picture

Status: Needs review » Reviewed & tested by the community
dave reid’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new11.31 KB

This was missing the DependentPluginInterface on EmbedTypeInterface. I also cleaned up a few more things and made the modules installable by default on Drupal 9.

Dave Reid credited oknate.

dave reid’s picture

StatusFileSize
new10.7 KB

Re-rolled now that the blockers were merged.

dave reid’s picture

StatusFileSize
new10.73 KB

Should resolve the test now.

  • Dave Reid committed a7004dc on 8.x-1.x
    Issue #3042596 by joegraduate, Dave Reid, Sharique, Mohammad Fayoumi,...
dave reid’s picture

Status: Needs review » Fixed

Committed #24 to 8.x-1.x. Thanks all!

Status: Fixed » Closed (fixed)

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