I think I am(/was) just frustrated, but it's not the behavior I was expecting.
I guess I was expecting calling setParam with a null value to error out, or throw an exception or something.. I guess just really discourage its mis-use ("set"-ing something shouldn't "unset" it, in my opinion), and instead encourage the use of an "unsetParam" function, or similar.
The problem probably doesn't lie in Zend, per-se, but Magento (seeing as everything worked as expected until further into the request...). I'll have to try and take a closer look at why the parameters were being repopulated.
Michael
@Michael
Best posts made by Michael
Latest posts made by Michael
-
RE: NULL means "unset"?
-
RE: NULL means "unset"?
Probably. I didn't bother checking... Perhaps I should.
What was odd is that when I was debugging it I could tell the variable was unset, and I could call getParams() and it would function as expected until my observer was finished, then that parameter would reappear with the original value.
I was so fed up with Magento and ZF (and PHP in general) at this point, and my problem could have been solved just by redirecting and calling exit (which I didn't really want to do at first) that I just opted for that solution.
I just don't understand under what circumstances a NULL means "unset"? Why not just make an "unsetParam" function? -
NULL means "unset"?
I know PHP is low-hanging fruit, but I recently needed to create a Magento extension to unset a request parameter and ran into this:
Okay, fine, I should be able to work with that, right?
So, if I understand correctly when I try to set a parameter to null, I'm effectively doing nothing as long as that parameter is still in $_GET, or $_POST?
Am I misunderstanding something?I didn't bother digging into Magento after I found this in ZF, but my observer would properly unset the variable, only for it to magically reincarnate in the action following.