wordpress import form doesn't honor validation errors on last step of form

gwen - June 10, 2009 - 02:41
Project:Wordpress Import
Version:6.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:yrocq
Status:closed
Description

I am importing a wordpress blog with non unique email addresses for users. The last page of the form looks like it should check to make sure that the email addresses are unique, but when I went through the form, I successfully got the "success" page with the "User with mail already exists" error. What I expect is to get the last page of the form reloaded with the error.

After poking around, I think it's happening b/c of this chunk of code:

85   // Skip user creation if not necessary
86
87   if ($form_state['storage']['step'] == 3 && !wordpress_import_must_create_users(wordpr    ess_import_apply_default_user_mapping($form_state['values']['users_map'], $form_state['    values']['default_user_mapping']))) { 88     $form_state['storage']['step']++;
89   }

Since the user map from step 2 with the "create new user" info has already been processed, the user map for step 3 does not contain "create_new_user", so the step is advanced. Some extra logic is needed to make sure that a failed step 3 case is honored.

I'm still poking around and will post a patch when I make some headway.

#1

gwen - June 10, 2009 - 02:54
Status:active» needs review

Okay, it turns out this was easier to fix that I thought. It looks like different values are stored depending on which step, so I put in an extra conditional to check if $form_state['values']['users_map'] is not empty. The patch is attached.

AttachmentSize
wordpress_import.patch 1.1 KB

#2

yrocq - October 12, 2009 - 21:09
Assigned to:Anonymous» yrocq
Status:needs review» fixed

Fixed in DRUPAL-6--1. Thanks !

#3

System Message - October 26, 2009 - 21:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.