Comments

heykarthikwithu created an issue. See original summary.

heykarthikwithu’s picture

Assigned: heykarthikwithu » Unassigned
Status: Active » Needs review
StatusFileSize
new4.39 KB

Status: Needs review » Needs work

The last submitted patch, 2: 2681001-2.patch, failed testing.

naveenvalecha’s picture

These are already existing failures in the branch. So leave those.
Thanks for the patch.

  1. +++ b/src/Form/SharethisConfigurationForm.php
    @@ -53,7 +53,7 @@ class SharethisConfigurationForm extends ConfigFormBase {
    +  public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, EntityTypeManagerInterface $entity_manager, SharethisManagerInterface $sharethis_manager) {
    

    The $entity_manager should be $entitytype_manager
    also update the protected property name.

  2. +++ b/src/SharethisManager.php
    @@ -244,7 +244,7 @@ class SharethisManager implements SharethisManagerInterface {
    +      $st_spans .= \Drupal::service('renderer')->render($meta_generator);
    

    Inject the Renderer service

heykarthikwithu’s picture

Assigned: Unassigned » heykarthikwithu
heykarthikwithu’s picture

Assigned: heykarthikwithu » Unassigned
Status: Needs work » Needs review
StatusFileSize
new7.11 KB
new4.02 KB

1. updated the protected property name.
2. injected the renderer service.

Status: Needs review » Needs work

The last submitted patch, 6: 2681001-6.patch, failed testing.

naveenvalecha’s picture

Thanks for sticking to this. We are near to fix, few more nitpicks that need to do before fixing

  1. +++ b/src/Form/SharethisConfigurationForm.php
    @@ -50,14 +50,16 @@ class SharethisConfigurationForm extends ConfigFormBase {
    +    $this->entityTypeManager = $entity_type_manager;
    

    you also need to update the public static function create(ContainerInterface $container) method as well and use the entityTypeManager there.

  2. +++ b/src/Form/SharethisConfigurationForm.php
    @@ -375,9 +377,9 @@ class SharethisConfigurationForm extends ConfigFormBase {
    +    $entity_info = \Drupal::entityTypeManager()->getAllBundleInfo('node');
    

    Use DI here. $this->entityTypeManager

  3. +++ b/src/Plugin/Block/SharethisWidgetBlock.php
    @@ -135,7 +135,7 @@ class SharethisWidgetBlock extends BlockBase implements ContainerFactoryPluginIn
           else {
    

    Inject the config service in this block and use the DI to replace \Drupal::config('system.site')

  4. +++ b/src/Plugin/Views/field/SharethisNode.php
    @@ -34,7 +34,7 @@ class SharethisNode extends FieldPluginBase {
         $sharethis_manager = \Drupal::service('sharethis.manager');
    

    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...

  5. +++ b/src/SharethisManager.php
    @@ -34,16 +35,26 @@ class SharethisManager implements SharethisManagerInterface {
        * Constructs an SharethisManager object.
    

    Also inject the current_route_match service and use it for \Drupal::routeMatch()->getRouteName()

heykarthikwithu’s picture

Assigned: Unassigned » heykarthikwithu
heykarthikwithu’s picture

Assigned: heykarthikwithu » Unassigned
Status: Needs work » Needs review
StatusFileSize
new12.53 KB
new7.12 KB

1. updated the public static function create(ContainerInterface $container) method, with the entityTypeManager.
2. used DI here. $this->entityTypeManager
3. injected the config service in SharethisWidgetBlock.php block.
4. injected the sharethis.manager service and used the DI instead of \Drupal class functions in SharethisNode.php.
5. injected the current_route_match service and used it for \Drupal::routeMatch()->getRouteName()

Status: Needs review » Needs work

The last submitted patch, 10: 2681001-10.patch, failed testing.

heykarthikwithu’s picture

Status: Needs work » Needs review
naveenvalecha’s picture

StatusFileSize
new15.11 KB
new11.13 KB

Used the right services for the replacement of entity.manager service. See more about it https://www.drupal.org/node/2549139

Status: Needs review » Needs work

The last submitted patch, 13: 2681001-13.patch, failed testing.

naveenvalecha’s picture

Status: Needs work » Needs review
StatusFileSize
new15.53 KB
new1.08 KB

Status: Needs review » Needs work

The last submitted patch, 15: 2681001-15.patch, failed testing.

naveenvalecha’s picture

Status: Needs work » Needs review
StatusFileSize
new15.43 KB
new914 bytes

fixing the failures

Status: Needs review » Needs work

The last submitted patch, 17: 2681001-16.patch, failed testing.

naveenvalecha’s picture

Status: Needs work » Fixed

Committed and pushed to 8.x-2.x-dev
Thanks!

  • naveenvalecha committed c1985c6 on 8.x-2.x
    Issue #2681001 by naveenvalecha, heykarthikwithu: Remove depreciated...

Status: Fixed » Closed (fixed)

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