So you're saying my own add-on should not be able to return to it's own page?
I don't think you understand so I'll do some fake code to show what I mean...
An extension of actionPostThread:
Code:
public function actionPostThread(ParameterBag $params)
{
if ($this->isPost())
{
.... construct post, and create creator
$thread = $creator->save();
$this->finalizeThreadCreate($creator);
CODE MUST RETURN TO MY PAGE
BUT CAN NOT GET HERE WITHOUT OVER RIDING finalizeThreadCreate
OR EXECUTING MY OWN finalizeThreadCreate EXTENSION BEFORE SOMEONE ELSE'S
AND IF I DO THAT, THE REDIRECT FROM MY EXTENSION WILL MESS UP OTHER ADD-ONS
}
}
I've gotten around the problem. My point is, it's not very friendly and normally would not be expected to redirect from finalizeThreadCreate.
To be honest, I'm not sure what you're getting at either.
The point I think Robust was trying to make is the fact that if you need to run code inside finalizeThreadCreate, you do that with the normal execution order (or a value below 65535, or whatever the maximum is in XF2). Therefore, your code runs before Jaxel's redirect.
What I think
you are trying to say is that if both you and Jaxel need to redirect after posting a thread, only one redirect will occur. If that is indeed what you are saying, then I don't see this as an issue because (presumably) both you and Jaxel will be limiting the redirect code to only run if the thread was created in special circumstances (such as a special URL parameter that would only exist if the thread was being created from inside your mod).
If I am correct in my assumption, then the only way this could possibly conflict, as far as I can tell, is if you add your special URL parameter to
every thread form, so that both your param and Jaxel's param appear on the form at the same time.
If I am not correct, then in my opinion your fake code is 100% wrong because you're not
extending actionPostThread, you're
replacing it, which would always break compatibility with other modifications anyway, redirect or not.
If I am still missing the point, could you please elaborate?
EDIT: Let's also not forget that the scope of this conflict is very limited - new threads created automatically uses the Thread Creator service, not the form, so that is irrelevant here. Maybe I'm missing something obvious but I'm struggling to see where the major problem is.
Fillip