I am experimenting with moodle and I created several student accounts and posted to a forum and the next day could no longer see those posts.
I used the phpadmin mod for moodle to look at the databases and saw that in mdl_user some records seemed corrupted. For example, instead of the username appearing in the correct field, the email address was there (in the username field), followed by a long number.
Then I thought I'd try deleting the user accounts and starting over. I used the admin page to delete all users (except me, the admin). But when I looked at the table (mdl_users) I see all those user records are still there. There is a "1" in the delete column, but how can I permanently strip those user accounts?
I have some experience with dbase and foxpro and those programs had a "pack" command, used to permanently remove records that were "marked" for deletion. Do I need such an account for mysql?
I appreciate any assistance you can give me.
Problems with users (lost posts to forums and cannot delete users)
by Paula Edmiston -
Number of replies: 8
In reply to Paula Edmiston
Re: Problems with users (lost posts to forums and cannot delete users)
by Martin Dougiamas -
That's not corruption, that's normal.
User accounts are never deleted, they just get marked deleted. The username field gets changed to something unique so that that username is freed up to be used again.
The reason we keep the user data is that other data (like forum posts) may still exist throughout in your installation that references that user. For example, it would be impossible to show the name of the person who made a forum post if the user record was missing.
Now the problem of the dissappearing posts in a forum is something else - that just shouldn't happen. Is it possible that some of your experimenting might have accidentally caused it?
The reason we keep the user data is that other data (like forum posts) may still exist throughout in your installation that references that user. For example, it would be impossible to show the name of the person who made a forum post if the user record was missing.
Now the problem of the dissappearing posts in a forum is something else - that just shouldn't happen. Is it possible that some of your experimenting might have accidentally caused it?
In reply to Martin Dougiamas
Re: Problems with users (lost posts to forums and cannot delete users)
by Paula Edmiston -
I can't explain why posts disappeared. They were they when I shut down for the night, and gone when I got upin the morning.
It's very disturbing to me that deleted users aren't removed form the table(s). On the one hand I am beginning to grasp the complexities of a user's existance being threaded throughout forums. But onthe other hand doen't the tables grow impossibly large and bloated with users marked as deleted?
I appreciate your helping me to understand these concepts very much.
It's very disturbing to me that deleted users aren't removed form the table(s). On the one hand I am beginning to grasp the complexities of a user's existance being threaded throughout forums. But onthe other hand doen't the tables grow impossibly large and bloated with users marked as deleted?
I appreciate your helping me to understand these concepts very much.
In reply to Paula Edmiston
Re: Problems with users (lost posts to forums and cannot delete users)
by Martin Dougiamas -
Come to think of it, deleting the user record entirely would have exactly that effect - the posts would disappear from the forums.
"Impossibly large and bloated"?
Databases can generally cope with hundreds of thousands of records. How many users are you planning on deleting?
At some point there will be more database-cleaning - there's a bug filed on it, I think.
"Impossibly large and bloated"?
At some point there will be more database-cleaning - there's a bug filed on it, I think.
In reply to Martin Dougiamas
Re: Problems with users (lost posts to forums and cannot delete users)
by Paula Edmiston -
I just had a thought ... can I use the moodle phpadmin to go back restore the deleted users? I could edit the rows to change the delete flag "1" back to "0"?
thanks
thanks
In reply to Paula Edmiston
Re: Problems with users (lost posts to forums and cannot delete users)
by Martin Dougiamas -
Yes, as long as you also restore the email and username fields.
In reply to Martin Dougiamas
Re: Problems with users (lost posts to forums and cannot delete users)
by Paula Edmiston -
I tried restoring one deleted user record and it doesn't seem to work. That user had been assigned as a "teacher" in two classes and when I logged in as that user, she no longer was listed as a teacher in the classes.
I guess I should reinstall everything and just try working with one class until I understand things better (I'd created three classes so I could see the different class structures (weekly, topical and social)
thanks again.
I guess I should reinstall everything and just try working with one class until I understand things better (I'd created three classes so I could see the different class structures (weekly, topical and social)
thanks again.
In reply to Paula Edmiston
Re: Problems with users (lost posts to forums and cannot delete users)
by Martin Dougiamas -
Yes, users get all their privileges stripped when they get deleted (no-one wants a dead person at the wheel!).
All you need to do is use "assign teacher" again.
All you need to do is use "assign teacher" again.
In reply to Paula Edmiston
It was an empty field Re: Problems with .. lost posts and users
by Paula Edmiston -
I just want to make sure to note this problem cleared up when I edited the mdl_users record for this user (because of the hyper loop problem discussed elsewhere). When I created the account (for experimentation purposes) I didn't include a last name.
I saw the 'guest' account doesn't have a last name and so I thought I'd do an account with no last name. I cheated the Edit Profile by placing a blank space in the lastname field. I guess that's where my problems began.
When I edited the record and inserted text in the lastname field both this and the hyperlooping window cleared right up.
thanks for all the help. I learned a lot of lessons.
paula (computers and the taxman: can't cheat them for long)
I saw the 'guest' account doesn't have a last name and so I thought I'd do an account with no last name. I cheated the Edit Profile by placing a blank space in the lastname field. I guess that's where my problems began.
When I edited the record and inserted text in the lastname field both this and the hyperlooping window cleared right up.
thanks for all the help. I learned a lot of lessons.
paula (computers and the taxman: can't cheat them for long)