Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chaitanya17 created an issue. See original summary.

chaitanya17’s picture

Please check attached working patch file.

chaitanya17’s picture

Status: Active » Needs review

Status: Needs review » Needs work

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

chaitanya17’s picture

Corrected patch uploaded.

chaitanya17’s picture

Status: Needs work » Needs review
willzyx’s picture

Category: Bug report » Task
Status: Needs review » Needs work

@chaitanya17 thanks for the patch!
Seems that the deprecated entityManger is used in other place in devel module

drush/phpstorm.drush.inc:67:  foreach (\Drupal::entityManager()->getDefinitions() as $type => $definition) {
drush/phpstorm.drush.inc:68:    $class = Drupal::entityManager()->getStorage($type);
drush/phpstorm.drush.inc:69:    $map["\\Drupal::entityManager()->getStorage('')"][$type] = '\\' . get_class($class);
src/Controller/DevelController.php:103:    $bundles = $this->entityManager()->getAllBundleInfo();
src/Controller/DevelController.php:129:    $types = $this->entityManager()->getEntityTypeLabels();
src/Controller/DevelController.php:133:      $definition = $this->entityManager()->getDefinition($type);
src/Controller/DevelController.php:304:      elseif ($this->entityManager()->hasHandler($entity_type_id, 'view_builder')) {
src/Controller/DevelController.php:305:        $build = $this->entityManager()->getViewBuilder($entity_type_id)->view($entity);
src/Plugin/Derivative/DevelLocalTask.php:6:use Drupal\Core\Entity\EntityManagerInterface;
src/Plugin/Derivative/DevelLocalTask.php:22:   * @var \Drupal\Core\Entity\EntityManagerInterface
src/Plugin/Derivative/DevelLocalTask.php:24:  protected $entityManager;
src/Plugin/Derivative/DevelLocalTask.php:29:   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
src/Plugin/Derivative/DevelLocalTask.php:34:  public function __construct(EntityManagerInterface $entity_manager, TranslationInterface $string_translation) {
src/Plugin/Derivative/DevelLocalTask.php:35:    $this->entityManager = $entity_manager;
src/Plugin/Derivative/DevelLocalTask.php:55:    foreach ($this->entityManager->getDefinitions() as $entity_type_id => $entity_type) {
tests/modules/devel_entity_test/devel_entity_test.module:12:  $entity_info = \Drupal::entityManager()->getDefinitions();

Note: the usage of entityManger in DevelController is some case is needed :P

chaitanya17’s picture

hi @willzyx,

I will verify and re-create the patch.

Thanks,

chaitanya17’s picture

Status: Needs work » Needs review
FileSize
3.46 KB

Hi @willzyx,

I have verified all and created patch. Please check attachment.

Regards,
Chaitanya

willzyx’s picture

  • willzyx committed d06f753 on 8.x-1.x
    Issue #2783055 by chaitanya17, willzyx: Deprecated \Drupal::...
willzyx’s picture

Status: Needs review » Fixed

Committed and pushed to 8.x. Thanks

Status: Fixed » Closed (fixed)

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