In my mod_perl2 app, on one page I link to with ?form_field_name=pre_fill_value
tacked onto the URI if I want to pre-fill a particular form field for the user. However, the form itself is just <form method=post>
, which posts back to the current page, GET query and all. I expected that Apache2::Request's param()
routine would serve up either only the POST data, or the POST data first. Instead, it seems the GET data is given precedence, i.e., the prefill is honoured over the manually-user-fixed data.
The easy fix is to add action=
and the current URI without the GET query, but I'm wondering why it was designed this way, and if there's a sneaky way around it, like some mod_perl2 option that would give POST data precedence. However, the easy fix can actually cause problems if un-overridden GET query values are expected to be passed on. So this workaround quickly grows, but why is it even this way in the first place?