Closed (fixed)
Project:
ShareThis
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
4 Mar 2016 at 11:09 UTC
Updated:
24 Mar 2016 at 07:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
heykarthikwithuComment #4
naveenvalechaThese are already existing failures in the branch. So leave those.
Thanks for the patch.
The $entity_manager should be $entitytype_manager
also update the protected property name.
Inject the Renderer service
Comment #5
heykarthikwithuComment #6
heykarthikwithu1. updated the protected property name.
2. injected the renderer service.
Comment #8
naveenvalechaThanks for sticking to this. We are near to fix, few more nitpicks that need to do before fixing
you also need to update the public static function create(ContainerInterface $container) method as well and use the entityTypeManager there.
Use DI here. $this->entityTypeManager
Inject the config service in this block and use the DI to replace \Drupal::config('system.site')
Inject the sharethis.manager service and use the DI instead of \Drupal class functions. See example here https://api.drupal.org/api/drupal/core%21modules%21user%21src%21Plugin%2...
Also inject the current_route_match service and use it for \Drupal::routeMatch()->getRouteName()
Comment #9
heykarthikwithuComment #10
heykarthikwithu1. updated the public static function
create(ContainerInterface $container)method, with theentityTypeManager.2. used DI here.
$this->entityTypeManager3. injected the
configservice inSharethisWidgetBlock.phpblock.4. injected the
sharethis.managerservice and used the DI instead of\Drupalclass functions inSharethisNode.php.5. injected the
current_route_matchservice and used it for\Drupal::routeMatch()->getRouteName()Comment #12
heykarthikwithuComment #13
naveenvalechaUsed the right services for the replacement of entity.manager service. See more about it https://www.drupal.org/node/2549139
Comment #15
naveenvalechaComment #17
naveenvalechafixing the failures
Comment #19
naveenvalechaCommitted and pushed to 8.x-2.x-dev
Thanks!