Posted: Sun Sep 18, 2005 1:57 pm Post subject: Export Users to DB doesn't give full nuke list
When I export my users, it gets all the way to a certain point and then it stops. The user that it stops changes based on how many users I have in my DB.
For instance, when I delete a user from my nuke database, G2 exports one less user. It reports a number of users exported successfully, but upon review, i notice that there are around 30+ users at the tail end that were not brought over.
Further, when I EMPTied the user table in phpmyadmin, G2 still says they exported successfully, but when I check the table, it's completely empty. Even after several exports.
Does anyone have info on why either of these two things might be happening? Specifically, the first issue.
I wrote: › It reports a number of users exported successfully, but upon review, i notice that there are around 30+ users at the tail end that were not brought over.
No, there are no errors. It reports a complete import of all X users in the Nuke database.
I think I see what's happening. If G2 sees that your Nuke installation has X number of users, it will go and get users (excluding anonymous) and count up to the user who's ID matches the last of the number of users you have and that's what gets imported into your Gallery installation.
The reason this is not a good method of calculating how many users should be pulled into the DB. Someone correct me if I don't get this right. Example: You have 10 users in your Nuke DB. You delete user #3 and are left with 9, right? When your 11th user signs up, he's assigned ID 11, but you have a total of 10 users. If G2 sees you have 10 users, it's only gonna count from ID #1 up to ID #10, which would leave out any whose IDs are above the total number of users.
Is this hypothesis on the right track?
Last edited by ambaxter on Sun Oct 02, 2005 9:44 pm; edited 1 time in total
Posted: Sun Oct 02, 2005 5:41 pm Post subject: Re: Export Users to DB doesn
you got it.
I had the same proble....
but after I had try to reinstall all... and gallery give me one kind of error...one of the a lot. Maybe some problem with user id 905.
So I had try to delete this user... and gallery give me an other kind of error... Maybe some problem ...sounds like exceding data ...with another user.. id 930... and so.
Joined: Mar 03, 2003 Posts: 6274 Location: Washington Township, NJ, USA
Posted: Mon Oct 03, 2005 6:55 am Post subject: Re: Export Users to DB doesn
heeey..good eyes. instead of counting the num_rows for the query, i should have it check the max user_id instead. hmm...but that might foul things up too....
let's take your example...you have user_id's in phpnuke of 1,2,3,4,5,6,8,9,10,11 (skipping user_id 7). using the num_rows result for 1 -> num_rows, it will only go from 1 to 10 (possibly throwing an error on 7, since it's not there), and skipping 11. but, if the max user_id is used, it will go from 1 -> 11, possibly erroring on 7, and then again at the end, since there are really only 10 users. hmm....but this is really the only viable option. to prevent the error when no user of the user_id exists, a simple check can be made...ok, adding this to the todo _________________
Posted: Tue Nov 01, 2005 1:39 pm Post subject: Re: Export Users to DB doesn
This was an easy fix:
Line 167 of /modules/gallery2/admin/index.php
replaced:
$sql = "SELECT max(*) AS ucount FROM ".$user_prefix."_users";
with:
$sql = "SELECT max(user_id) AS ucount FROM ".$user_prefix."_users";
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum