Jake Vanderwerf
2026-05-31 d7e7d248cbe41cd7a9ef9c2fb022b6c4831f99a3
inc/importers/JaneAppClientImporter.php
@@ -309,7 +309,7 @@
      $last_name = sanitize_text_field($data['Last Name'] ?? '');
      // Generate username from email
      $username = sanitize_user(substr($email, 0, strpos($email, '@')));
      $username = sanitize_user($email);
      // Ensure unique username
      $base_username = $username;
@@ -320,11 +320,11 @@
      }
      // Get the role from options with proper fallback
      $role = $options['default_role'] ?? get_option(BASE . 'client_import_role', JVB_USER);
      $role = $options['default_role'] ?? get_option(BASE . 'client_import_role', BASE.'client');
      // Ensure role exists, fallback to JVB_USER if not
      // Ensure role exists
      if (!get_role($role)) {
         $role = JVB_USER;
         return new WP_Error('invalid_role', 'Invalid role');
      }
      // Create user