Problem/Motivation
Steps to replicate:
1. Create a node
2. Go to the node's full view page, say /node/1
3. Expand the contextual filter, and click Delete
4. Confirm the deletion process in the confirmation screen
5. You will see page not found error
The contextual filter takes the current path as destination which causes the problem.
Proposed resolution
1. Disable delete operation in the contextual filter in node's full view page
I don't like approach 1 though, because it is very much specific about the type of operation.
Remaining tasks
TBD
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
TBD
Comments
Comment #2
subhojit777Comment #3
sumit-k commentedComment #4
rkostov commented'destination' parameter comes from function initContextual() in file core/modules/contextual/js/contextual.js
my approach to solve this problem is by skipping the 'destination' parameter for links with pattern 'node/%/delete'
Comment #6
sumit-k commentedPatch works for me.
Comment #7
sumit-k commentedComment #11
ranjith_kumar_k_u commentedRe-rolled #4 for 9.4
Comment #12
ambikahirode commented#11 working for me on local 9.4.Tested and Verified.refer Screenshot.
Comment #13
ambikahirode commentedComment #15
smustgrave commentedI can confirm this issue still exists in 10.1
This will need some tests to make sure it's fixed.
Comment #16
_utsavsharma commentedRerolled for 10.1.x.
But the issue on #15 still needs to be addressed.
Comment #18
ranjith_kumar_k_u commentedComment #19
ranjith_kumar_k_u commentedComment #20
ranjith_kumar_k_u commentedComment #21
larowlanI think we can use built in PHP APIs to be a bit more precise here.
Something like this
Unfortunately, we can't hardcode node specific logic in contextual module.
What happens if another module has a delete contextual link (e.g. media) and we want similar logic.
So I think we need to go back to the drawing board here.
We need an API to allow an individual link to override its destination.
Firstly, I think we replace the string based concatenation of URL params in contextual.js with UrlSearchParams which is now available in D10 because we don't support IE anymore.
Then I think we should check if the destination is already set before we blindly add it.
Then I think the node contextual link should declare 'options' for the delete plugin, which would be
['query' => ['destination' => '/']]Something like that anyway. We might take a few iterations to get to a workable API
Comment #23
sumit-k commentedComment #25
mortona2k commentedThese seem related.