#520760: SA-CORE-2009-007 user signature format
This added a 'signature_format' column to the users table. Head2Head needs to add the column, and also make sure that for existing users, it is pre-populated with a text format that makes sense.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 824932_signature_format_followup.patch | 702 bytes | JacobSingh |
| #3 | 824932_signature_format.patch | 1.79 KB | JacobSingh |
| #2 | 824932_signature_format.patch | 1.77 KB | JacobSingh |
Comments
Comment #1
JacobSingh commentedComment #2
JacobSingh commentedAccidentally committed the attached.
Making needs review, but is actually in HEAD.
Comment #3
JacobSingh commentedHeh, just realized the documentation is stupid. :)
Committing a fix and here's a complete patch.
Comment #4
David_Rothstein commentedThis isn't complete because it leaves everyone with '0' in the database table; we need to assign all users (at least those who have an actual signature) a real signature format.
The D6->D7 update does that in http://api.drupal.org/api/function/filter_update_7005/7 (at the bottom of that function) but the problem is that it's not so simple for us, since on an existing D7 install that is already in place, the site no longer has a single default text format.
Seems like there are two things we could do here and I'm not sure which is correct:
Not sure if there are any sites running HEAD to HEAD that have tons of users with preexisting signatures - if so, they would want to run the above code in a batch :(
Comment #5
JacobSingh commentedI think we just go for option 1. This is head2head, so I think it's okay here. In a "real" update function, I'd probably say do #2.
-J
Comment #6
JacobSingh commentedI committed something similar to option #1 because might as well have it in the project since it is less broken then what is there currently.
Attached is the followup diff.
I didn't include all the conditions that @David put in because:
1). We're adding the field so we know there are no values in it yet.
2). If a user has a signature or not, we should be giving them a format I suppose.
Comment #7
David_Rothstein commentedLooks OK to me.
I definitely agree with your first point - since it's unlikely anyone deployed this to a live site between your two commits :)
For your second point, if a user doesn't have a signature yet we probably don't actually need to assign them a format (since the theory is that they haven't had an opportunity to select one yet). As an example, I'm not sure whether it's a bug or by design, but user #1 created by Drupal during installation starts off with 0 as their signature format and that kind of makes sense, since it means they will never have the wrong choice pre-selected when they go to edit their account page for the first time.
For our use cases in Head2Head, it probably doesn't matter a whole lot either way, though.
Comment #8
JacobSingh commentedAh good point...