Closed andresteves closed 6 years ago
If you want to preserve a particular value in a request from $_POST or $_GET you can always add it to $_SESSION to hold onto it across subsequent page loads.
Hi @montymxb,
Thanks for helping but I really want to keep the url unchanged after destroying an object.
Before destroy
/contentTrigger.php?id=VsgvdzkEOh
After destroy
/contentTrigger.php
And it does not happen after an object save()
.
@andresteves paste here the var_dump before and after, please.
@davidtavarez var_dump of what variable?
@andresteves can you share a code to reproduce the issue?
If the user just refreshes the page (without changing the url) the same GET params will be present. I imagine that's not your case otherwise you wouldn't have this issue. If you're reloading the page from code you can append the same ?objectID=asfd to keep your GET vars.
But I'm not entirely sure how you're reloading the page, or if this a user causing a page load instead without your GET vars? Some details on what's happening would help regarding that.
You can also cheat if you want by modifying $_GET to contain the values you expect it to (like from $_SESSION). This is cutting corners a bit though and may get you into trouble if you really expect the key/values to come from the url in the first place.
@andresteves any progress with this one?
@montymxb I ended up following your suggestion of $_SESSION.
Issue Description
Hi, I have a form with a POST action
After that the page refresh but lost the url value. Wanted to destroy without deleting the url value like the
save()
methodSteps to reproduce
~~ Please provide the necessary steps here to reproduce this when possible ~~
Environment Details
Logs/Traces
~~ Include any relevant logs/traces here ~~