The function system_settings_form() will save variables into the variables table, but there is also a submit handler here that adds additional variables into the variables table (this time with properly prefixed names).

Additionally, what we're doing in the submit handler is validating, changing the values, and if the input isn't accurate, we're changing them back. Instead of doing this in the submit handler, let's add a validation handler instead, and only allow the values to be changed if they are correct.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jenlampton’s picture

Issue summary: View changes
jenlampton’s picture

Status: Active » Needs review
FileSize
2.97 KB
perennial.sky’s picture

It is better to use #element_validate to check particular form element value instead of using form validate.

Here is the patch

Status: Needs review » Needs work

The last submitted patch, 3: login_redirect-settings_form_cleanup-2431147-3.patch, failed testing.

  • akashjain132 committed f395cae on 7.x-1.x
    Issue #2431147 by akashjain132, jenlampton: Cleanup code to save only...
perennial.sky’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.