- Issue created by @Anybody
- 🇩🇪Germany Anybody Porta Westfalica
This is the method where the magic should happen:
/** * Loads the Redirects to delete and redirects to the Deletion confirm form. * * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. * * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException * @throws \Drupal\Core\TempStore\TempStoreException * @throws \Drupal\migrate\MigrateException * @throws \League\Csv\Exception */ protected function deleteRedirectData(FormStateInterface $form_state) { $redirects = $this->redirectsToDelete(); $this->privateTempStore->set($this->currentUser->id(), $redirects); $options = [ 'query' => $this->getDestinationArray(), ]; $form_state->setRedirect('entity.redirect.multiple_delete_confirm', [], $options); }
but in my described case (deleting the same records from .csv as imported before)
$redirects = $this->redirectsToDelete();
simply returns an empty array.So I'm redirected back to the redirect form!
- 🇩🇪Germany Anybody Porta Westfalica
I created a core issue to decide if that's something to improve in Core: 🐛 Should UrlHelper::parse() unify the leading slash for local URLs? Active
Still we need to unify it here, as I don't think there will be a related change in core soon.I'll prepare a MR.
- last update
7 months ago Build Successful - last update
7 months ago Build Successful - Status changed to RTBC
7 months ago 10:43am 21 May 2024 - 🇩🇪Germany Anybody Porta Westfalica
Thanks @Grevil!
The root cause should be fixed here: 📌 Public method Redirect::generateHash() should unify path before generating the hash Active (and eventually in core: 🐛 Should UrlHelper::parse() unify the leading slash for local URLs? Active )
Until that, this fix should solve it.
- 🇹🇼Taiwan peterwcm
The "Delete redirects defined in the spreadsheet" option wasn't working as described. I tested and the patch fixed the issue perfectly.