------ ------------------------------------------------------------------------------
  Line   src\Plugin\Block\JuicerEmbedFeedBlock.php
 ------ ------------------------------------------------------------------------------
  140    \Drupal calls should be avoided in classes, use dependency injection instead
  142    \Drupal calls should be avoided in classes, use dependency injection instead
 ------ ------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------
  Line   src\Plugin\Derivative\JuicerEmbedFeedBlockDerivative.php
 ------ ------------------------------------------------------------------------------
  26     \Drupal calls should be avoided in classes, use dependency injection instead
 ------ ------------------------------------------------------------------------------

 [ERROR] Found 3 errors

Issue fork juicerio-3086282

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ilchovuchkov created an issue. See original summary.

amateichuk’s picture

Status: Active » Needs review
StatusFileSize
new4.14 KB

Please check

vuil’s picture

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

Status: Reviewed & tested by the community » Needs work

There is an issue which can be easy reproduced with the following steps:

  • After #2 patch
  • Enable the juicerio module
  • Try to add a block - it is not possible and receive the following /dblog error:

ArgumentCountError: Too few arguments to function Drupal\juicerio\Plugin\Block\JuicerEmbedFeedBlock::__construct(), 3 passed in /var/www/html/web/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php on line 25 and exactly 4 expected in Drupal\juicerio\Plugin\Block\JuicerEmbedFeedBlock->__construct() (line 42 of /var/www/html/web/modules/juicerio/src/Plugin/Block/JuicerEmbedFeedBlock.php) #0 /var/www/html/web/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(25): Drupal\juicerio\Plugin\Block\JuicerEmbedFeedBlock->__construct(Array, 'juicerio:juicer...', Array) #1 /var/www/html/web/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(76): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('juicerio:juicer...', Array) #2 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(62): Drupal\Component\Plugin\PluginManagerBase->createInstance('juicerio:juicer...', Array) #3 /var/www/html/web/core/modules/block/src/BlockPluginCollection.php(57): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->initializePlugin('juicerio:juicer...') #4 /var/www/html/web/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(80): Drupal\block\BlockPluginCollection->initializePlugin('juicerio:juicer...') #5 /var/www/html/web/core/modules/block/src/BlockPluginCollection.php(45): Drupal\Component\Plugin\LazyPluginCollection->get('juicerio:juicer...') #6 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(83): Drupal\block\BlockPluginCollection->get('juicerio:juicer...') #7 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(99): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->setConfiguration(Array) #8 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(55): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->addInstanceId('juicerio:juicer...', Array) #9 /var/www/html/web/core/modules/block/src/BlockPluginCollection.php(34): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->__construct(Object(Drupal\Core\Block\BlockManager), 'juicerio:juicer...', Array) #10 /var/www/html/web/core/modules/block/src/Entity/Block.php(156): Drupal\block\BlockPluginCollection->__construct(Object(Drupal\Core\Block\BlockManager), 'juicerio:juicer...', Array, NULL) #11 /var/www/html/web/core/modules/block/src/Entity/Block.php(145): Drupal\block\Entity\Block->getPluginCollection() #12 /var/www/html/web/core/modules/block/src/BlockForm.php(134): Drupal\block\Entity\Block->getPlugin() #13 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityForm.php(117): Drupal\block\BlockForm->form(Array, Object(Drupal\Core\Form\FormState)) #14 [internal function]: Drupal\Core\Entity\EntityForm->buildForm(Array, Object(Drupal\Core\Form\FormState)) #15 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(519): call_user_func_array(Array, Array) #16 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(276): Drupal\Core\Form\FormBuilder->retrieveForm('block_form', Object(Drupal\Core\Form\FormState)) #17 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityFormBuilder.php(61): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\block\BlockForm), Object(Drupal\Core\Form\FormState)) #18 /var/www/html/web/core/modules/block/src/Controller/BlockAddController.php(27): Drupal\Core\Entity\EntityFormBuilder->getForm(Object(Drupal\block\Entity\Block)) #19 [internal function]: Drupal\block\Controller\BlockAddController->blockAddConfigureForm('juicerio:juicer...', 'bartik') #20 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #21 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #22 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #23 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #24 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #25 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #26 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #27 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #28 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #29 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #30 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #31 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #32 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #33 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #34 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #35 {main}.

amateichuk’s picture

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

Fixed this problem. Please check

vuil’s picture

Status: Needs review » Reviewed & tested by the community

#5 works. Well done!

  • vuil committed 247484d on 8.x-1.x authored by Tolyan4ik
    Issue #3086282 by Tolyan4ik, vuil: Test for Drupal 9 deprecations
    
vuil’s picture

Status: Reviewed & tested by the community » Fixed

I set the issue status to Closed (Fixed).

Status: Fixed » Closed (fixed)

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

vuil’s picture

Status: Closed (fixed) » Needs work

Needs more work:

  • Update tests
  • Additional issues mentioned in drupal-check execution (below):
drupal-check -ad web/modules/juicerio      vuil@Ilchos-MacBook-Pro
 7/7 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ------------------------------------------------------------------------------ 
  Line   src/Plugin/Block/JuicerEmbedFeedBlock.php                                     
 ------ ------------------------------------------------------------------------------ 
  185    \Drupal calls should be avoided in classes, use dependency injection instead  
 ------ ------------------------------------------------------------------------------ 

 ------ ------------------------------------------------------------------------------------------------------ 
  Line   src/Tests/JuicerSimpleTest.php                                                                        
 ------ ------------------------------------------------------------------------------------------------------ 
  27     Class Drupal\juicerio\Tests\JuicerSimpleTest 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.                           
 ------ ------------------------------------------------------------------------------------------------------ 

 ------ ------------------------------------------------------------------------- 
  Line   tests/src/Functional/LoadTest.php                                        
 ------ ------------------------------------------------------------------------- 
         Class PHPUnit\Framework\TestCase not found and could not be autoloaded.  
 ------ -------------------------------------------------------------------------
swatichouhan012’s picture

Status: Needs work » Needs review
Issue tags: +VbContribution2020
StatusFileSize
new2.37 KB

I have created a patch to fix remaining deprecated method, direct call kindly review.

  • vuil committed 24dfe31 on 8.x-1.x authored by swatichouhan012
    Issue #3086282 by Tolyan4ik, swatichouhan012, vuil: Test for Drupal 9...
vuil’s picture

StatusFileSize
new1.72 KB

  • vuil committed 3747b19 on 8.x-1.x
    Issue #3086282 by Tolyan4ik, vuil, swatichouhan012: Test for Drupal 9...
vuil’s picture

StatusFileSize
new369 bytes

Also add in .info.yml file:

core_version_requirement: ^8 || ^9

  • vuil committed 8b307b8 on 8.x-1.x
    Issue #3086282 by vuil, Tolyan4ik, swatichouhan012: Test for Drupal 9...
vuil’s picture

Status: Needs review » Fixed

I close the issue as Fixed. Thanks to everyone!

Status: Fixed » Closed (fixed)

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

interactivex made their first commit to this issue’s fork.