Backing Up New User Fields

Backing Up New User Fields

by Mike Churchward -
Number of replies: 1
Picture of Core developers Picture of Plugin developers Picture of Testers

Hi -

I modified the user table with some 'extra' fields needed for my installation. I've placed those fields in the appropriate place in 'backuplib.php' in the 'backup_user_info' function. I can see that the data is contained in the 'user_data' structure sent to 'fwrite'.

BUT - when I look at the XML file generated by the backup procedure, I have two different results, depending on where I do the backup.

Issue 1 - Backing up the Site Course:
- the new XML tags are there, but no data. I checked the data going into the 'fwrite', and it was there.

Issue 2 - Backing up another Course:
- not even the new XML tags are there.

Is there another function that intervenes somewhere that would remove this data? I'm confused.

mike

Average of ratings: -
In reply to Mike Churchward

Re: Backing Up New User Fields

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Mike,

I suppose that you've added some lines like this:

fwrite ($bf,full_tag("FIELDNAME",4,false,$user_data->fieldname));

isn't it?

and you say that you've checked that

echo full_tag("FIELDNAME",4,false,$user_data->fieldname)

return some valid info and it isn't saved to file (at a different levels depending of the course)?

Sounds very strange!!

Can you send me a copy of your backuplib.php file? And a copy of your users table (privately)? Then I'll test it....

Ciao smile