• Resolved Pablovp

    (@pablovp)


    Do you know what could be the error?

    Processing Category: ****** ===> found 18 posts....
    
    Catchable fatal error: Object of class WP_Error could not be converted to string in C:\xampp\htdocs\****\wp-includes\formatting.php on line 2773
Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Pablovp

    (@pablovp)

    Ok, I have found where is the mistake in my side, but I don’t understand why.

    I’m not just migrating the system, I’m also modifying the database, so I have checked the plugin step by step and there is no problems with the modifications that I’m making to the categories in the tables jos_categories and jos_content.

    But there is a problem when I’m adding authors to jos_users in the way:
    INSERT INTO jos_users (name, username, usertype, gid) VALUES ('Pablo', 'Pablo', 'Author', '19');
    and updating later jos_content like:
    UPDATE jos_content SET created_by = 70 WHERE created_by_alias = 'Pablo';

    For some reason I guess the plugin doesn’t migrate all this new users added by hand, and then throw that exception.

    What do you think? Thanks.

    Thread Starter Pablovp

    (@pablovp)

    And definitely the mistake is that he plugin is not migrating the new users, just the first five original users and the first one added by hand, but not the other 37 users.

    Checking your code I can’t find anything wrong, seems that the function j2wp_mig_users() should work perfectly and insert all the new users to WordPress with the wp_create_user().

    Thread Starter Pablovp

    (@pablovp)

    But is the function wp_insert_user($userdata) the one who is returning this WP_Error as for some reason is not able to create the new users.

    Thread Starter Pablovp

    (@pablovp)

    And finally solved adding mail accounts to all this new users, which doesn’t have to much sense as this user’s email is an optional parameter in the function wp_create_user($username, $password, $email = ”).

    ¡Happy 2011!

    Plugin Author christian_gnoth

    (@christian_gnoth)

    thanks for the hints and work – i will create a new release which checks if the email is empty.

    Thread Starter Pablovp

    (@pablovp)

    I have looked more into the WordPress code and the problem is that the function wp_insert_user($userdata) check if the email exists with the function email_exists($user_email), so in this case as already exist one user with empty email doesn’t add any of the other users.

    So as this shouldn’t be usual (more than one user with the same email or more than one user with empty email), I guess you just have to check in $ret = wp_create_user( $joomla_user['username'], $random_password, $joomla_user['email'] ); that we are really adding the user and not getting WP_Error.

    Thanks to you for the plugin.

    Plugin Author christian_gnoth

    (@christian_gnoth)

    thanks for the hints.

    I will add a check for duplicate email addresses.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Joomla/Mambo To WordPress Migrator] Catchable fatal error: Object of class WP_Error could n’ is closed to new replies.