montera34 / globalrec

Wordpress theme of the global alliance of waste pickers
http://globalrec.org
GNU General Public License v3.0
0 stars 0 forks source link

Problems in WAW submit form in Spanish #51

Closed numeroteca closed 6 years ago

numeroteca commented 6 years ago

When submitting a new organization in Spanish (http://globalrec.org/es/rem/anade-organizacion/), something is not working and returns "har".

Code available at https://github.com/montera34/globalrec/blob/master/functions.php#L2054

What is the code below doing?

if ( !array_key_exists('globalrec-form-waw-submit', $_POST) ) {
        globalrec_waw_form();
        return;
} elseif ( sanitize_text_field( $_POST['globalrec-form-waw-submit'] ) != 'Send' ) {
        globalrec_waw_form();
        echo "har";
        return;
}
skotperez commented 6 years ago

This code is saying if the form hasn't been sent (first condition), then show the form. And if the submit input field (id globalrec-form-waw-submit) is not equal to "Send" (second condition), then throw an error.

The second condition doesn't work in a multilingual environment. I've removed it. Details in this commit: https://github.com/montera34/globalrec/commit/dfc4bdda0ccf630f2166f146f28651646516c308