The classes Drupal\user\PrivateTempStore and Drupal\user\PrivateTempStoreFactory are deprecated.
We should switch to Drupal\core\PrivateTempStore and Drupal\core\PrivateTempStoreFactory

Comments

T-lo created an issue. See original summary.

t-lo’s picture

Status: Active » Needs review
StatusFileSize
new2.34 KB

Patched

t-lo’s picture

Assigned: t-lo » Unassigned

Status: Needs review » Needs work

The last submitted patch, 2: feeds-use-core-privateTempStore-3012342-2.patch, failed testing. View results

t-lo’s picture

StatusFileSize
new2.44 KB

Corrected capitalisation and re-alphabetised use statements

megachriz’s picture

@T-lo
Thanks for working on this. It appears that it needs more work than just changing the use statements though. Without having looked at where in the code this private temp store is used, I say that it's likely that a different service needs to be passed around.

idebr’s picture

Status: Needs work » Needs review
StatusFileSize
new1.89 KB
new3.55 KB

Fixed the dependency injection in \Drupal\feeds\Plugin\Action\DeleteFeed

megachriz’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

I get an error when trying to delete a feed when using the action "Delete selected feeds" on admin/content/feed.

This is because DeleteMultiple::create() still passes the service 'user.private_tempstore'. It would be cool if we had test coverage for this action.

The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to Drupal\feeds\Form\DeleteMultiple::__construct() must be an instance of Drupal\Core\PrivateTempStoreFactory, instance of Drupal\user\PrivateTempStoreFactory given, called in /Websites/drupal/drupalsites/drupal8/modules/wip/feeds8/feeds/src/Form/DeleteMultiple.php on line 71 in Drupal\feeds\Form\DeleteMultiple->__construct() (line 58 of modules/wip/feeds8/feeds/src/Form/DeleteMultiple.php).

Drupal\feeds\Form\DeleteMultiple->__construct(Object, Object, Object) (Line: 71)
Drupal\feeds\Form\DeleteMultiple::create(Object) (Line: 28)
Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('Drupal\feeds\Form\DeleteMultiple') (Line: 48)
Drupal\Core\Controller\HtmlFormController->getFormObject(Object, 'Drupal\feeds\Form\DeleteMultiple') (Line: 78)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 665)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

megachriz’s picture

Opened #3030879: Add test coverage for "feeds_feed_delete_action" for adding test coverage for the action "Delete selected feeds".

megachriz’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new3.49 KB
new548 bytes

Alright, test coverage has now catched the bug introduced by the patch in #7.

New patch to fix that bug.

Status: Needs review » Needs work

The last submitted patch, 10: feeds-use-core-privateTempStore-3012342-10.patch, failed testing. View results

megachriz’s picture

Status: Needs work » Needs review
StatusFileSize
new3.49 KB
new1.21 KB

Correcting namespaces.

  • MegaChriz committed 0e8ed52 on 8.x-3.x authored by idebr
    Issue #3012342 by MegaChriz, T-lo, idebr: Replaced user module...
megachriz’s picture

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

Committed #12.

Status: Fixed » Closed (fixed)

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