Skip to content
Browse files

Fix issues saving options for non-"direct" filesystem type.

In the case that the filesystem type is detected as non-"direct," the
options from the lightbox when first installing the plugin are
attempted to be saved on the next page load. However, some of the
conditional checks here had incorrect $_POST variable name checks, as
well as the check_admin_referer string. So if you were in this
situation, you get the lightbox popping up repeatedly on every page
load on the admin, until you decide to fix the issue and send a pull
request.
  • Loading branch information...
1 parent d6b3dbb commit a79987b76112e20b70194d571d86cdc60d51cc87 @ericandrewlewis ericandrewlewis committed Sep 7, 2012
Showing with 3 additions and 8 deletions.
  1. +3 −8 developer.php
View
11 developer.php
@@ -164,7 +164,6 @@ public function admin_init() {
register_setting( self::OPTION, self::OPTION, array( $this, 'settings_validate' ) );
-
wp_register_script( 'a8c-developer', plugins_url( 'developer.js', __FILE__ ), array( 'jquery' ), self::VERSION );
$strings = array(
'settings_slug' => self::PAGE_SLUG,
@@ -184,14 +183,10 @@ public function admin_init() {
wp_register_style( 'a8c-developer', plugins_url( 'developer.css', __FILE__ ), array(), self::VERSION );
-
// Handle the submission of the lightbox form if step 2 won't be shown
- if ( ! empty( $_POST['a8c_developer_action'] ) ) {
- if ( 'lightbox_step_1' == $_POST['a8c_developer_action'] && ! empty( $_POST['a8c_developer_project_type'] ) && check_admin_referer( 'a8c_developer_action_lightbox_step_1' ) ) {
- $this->save_project_type( $_POST['a8c_developer_project_type'] );
-
- add_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'updated' );
- }
+ if ( ! empty( $_POST['action'] ) && 'a8c_developer_lightbox_step_1' == $_POST['action'] && ! empty( $_POST['a8c_developer_project_type'] ) && check_admin_referer( 'a8c_developer_lightbox_step_1' ) ) {
+ $this->save_project_type( $_POST['a8c_developer_project_type'] );
+ add_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'updated' );
}
if ( ! get_option( self::OPTION ) ) {

0 comments on commit a79987b

Please sign in to comment.
Something went wrong with that request. Please try again.