Upload users + htmleditor

Upload users + htmleditor

Tim Bahula發表於
Number of replies: 6

Good day.

We're running Moodle 3.5.3+ (Build: 20181120).

We're trying to manage a switch over from TinyMCE to Atto and were hoping the manage the transition by updating user preferences by using the optional user field 'htmleditor' in Upload users. However, Upload users appears to disregard this field.

I tried putting the htmleditor field as the last column in my CSV file; Upload users reports "User up-to-date".

I tried putting the htmleditor field in the middle of my CSV file; Upload users reports "Invalid data detected for user xxx and it has been automatically cleaned."

Can anyone tell me if the htmleditor field is still supported? The documentation on it is lacking.

評比平均分數: -
In reply to Tim Bahula

Re: Upload users + htmleditor

Justin Hunt發表於
Particularly helpful Moodlers的相片 Plugin developers的相片

I just tried this, and I also could not get it to work. 

Its probably something you considered but, shouldn't just changing the default editor site wide achieve your desired goal?  

Because almost everyone's preference will be "Site default" unless they had already opted away from TinyMCE.  So if you change the Site default, then only the ones still using TinyMCE will be affected and those are the ones you want to move on to Atto. Right?

To do that you just move Atto to the top at: Site administration -> Plugins -. Text Editors -> Manage editors

評比平均分數:Useful (2)
In reply to Justin Hunt

Re: Upload users + htmleditor

Tim Bahula發表於

Thanks for confirming the problem, Justin.

The workaround you suggested won't produce the desired result, unfortunately. We want to leave most of the users on TinyMCE for now and switch some to Atto. Changing the default would produce the opposite effect by switching most to Atto while leaving some on TinyMCE.

In reply to Tim Bahula

Re: Upload users + htmleditor

Justin Hunt發表於
Particularly helpful Moodlers的相片 Plugin developers的相片

I think its a bug. I had a look at the code and it doesn't seem to be there at all. I am not sure if you have access to the database, but its relatively easy to just set the values directly. Though its yukky to do it that way.

If its just a few you could use the "log in as" feature from the user's profile page and set them that way. Hopefully its not 500 users.  If its that many an email with instructions on how to do it for themselves would make sense.

評比平均分數:Useful (1)
In reply to Justin Hunt

Re: Upload users + htmleditor

John Provasnik發表於
Particularly helpful Moodlers的相片 Testers的相片

Actually, you don't have to log in as the user / as an admin just go to their preferences and make the change and save. I do this a lot with teacher accounts  when they have not switched to atto 

評比平均分數:Useful (2)
In reply to John Provasnik

Re: Upload users + htmleditor

Tim Bahula發表於

Thanks, Justin & John.

I don't have access to the database. I did discover that I could just update preferences from the profile (as John suggested). I did that for about 10 users.

However, we need to switch another 500 or so users. I've decided that we'll switch the default. It's not the desired outcome but will be good enough.

In reply to Tim Bahula

Re: Upload users + htmleditor

AL Rachels發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片

Hi All,

The htmleditor setting is a preference and is NOT kept in the mdl_user table of your Moodle database, which is why the CSV file does not support changing the htmleditor. Instead, the editor preference is kept in the mdl_user_preferences table of your Moodle database.

@Tim - Since you say you do not have access to the database, are you able to install plugins? If so, install the adminer plugin, and use it to get to the table.

If you can get adminer installed, you can use it to export JUST the mdl_user_preferences table of your Moodle database as an SQL file. Also use adminer to look for and get the id number for the '500' users you want to change. Edit the exported mdl_user_preferences sql file and add a row for each of  the 500 users with the preference set to atto. Import your altered file. When those users next edit something, the editor will be atto.

I have tested this and it works. Note: I used a copy of the original exported file, so I could put the table back like it WAS, if things went haywire! I used LibreOffice and copied and pasted as "text" to get the correct format. When adding the new entries to the end of the sql file, make sure that the original last row ends with a comma, along with each new row, and your new last row ends with a semi colon. Make sure each new line has a unique, one digit greater, id number. Import your new file with adminer and verify your results are correct.

Another note: When I was making my new rows, I did it in LO Calc so I could use the drag and copy function to auto increment my new row numbers and user id's. Just had to make sure the first row was set to the correct beginning numbers.

HTH

AL

評比平均分數:Useful (1)