• Resolved masterida

    (@masterida)


    It seems that the import from spreadsheet function is not working anymore.

    Please check Functions/Update_Admin_Databases.php line 198 (Changeset 2348570). I don’t think that you should sql escape the values string, as there are single quotes in this string. They would be escaped and then the sql query fails.

    Possible workaround:

    
    		$ValuesString = implode("','", esc_sql($Values));
    		$wpdb->query(
    			$wpdb->prepare("INSERT INTO $ewd_feup_user_table_name (" . esc_sql( $FieldsString ) . ", User_Date_Created) VALUES ('" .  $ValuesString . "','%s')", $Today)
    		);
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support jaysupport

    (@jaysupport)

    Hi ida,

    I just tested the import in the newest version of the plugin and it is working correctly.

    Could you please try using the following example sheet?

    https://www.etoilewebdesign.com/Screenshots/feup_import.xlsx

    Just make sure you first have Username is Email disabled and that you have fields for First Name, Last Name and Email.

    If that still doesn’t work, then could you please share your spreadsheet with me?

    Thanks!

    Thread Starter masterida

    (@masterida)

    Your file does work indeed. But as soon as I add a new column with the label “Password”, then the import fails. The problem I guess is not in custom fields. It just happens if you add “core user info” like password, level, email confirmed and so on.

    The message I get from wordpress is

    
    WordPress-Database-Error: [Column count doesn't match value count at row 1]
    INSERT INTO wp6_EWD_FEUP_Users (Username,User_Password, User_Date_Created) VALUES ('jandoe\',\'$2y$13$a8e75601ef03f1cc5df34OvtJe2i/PMqB6A43cZrpk5LcAruk65Zi','2022-06-22 06:13:00')
    

    There is an extra escape-character before the trailing single quote of the username and before the leading single quote of the password hash. I think, that they should not be escaped though.

    • This reply was modified 2 years, 9 months ago by masterida.
    Plugin Support jaysupport

    (@jaysupport)

    Hi ida,

    We’ve released an update that corrects this issue.

    Thanks for your help!

    Thread Starter masterida

    (@masterida)

    You’re welcome.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Import from spreadsheet, bug?’ is closed to new replies.