Not sure if this is a bug or something else. I haven't noticed anything wrong with the Twitter module operationally, but the Schema module surfaces a warning that reads: "twitter_user.screen_name is part of the primary key but is not specified to be 'not null'"

Anyone seen this before?

Comments

jaydub’s picture

Status: Active » Needs review
StatusFileSize
new715 bytes

This is in fact an issue albeit minor as both MySQL and PostgreSQL force the NOT NULL constraint on the column when creating the table. More details here: http://drupal.org/node/159328

patch simply adds the NOT NULL constraint to the hook_schema implementation.

fumbling’s picture

Thanks, I'm pretty weak on implementing patches. Will this be included in the next release? Otherwise, does the error present any actual vulnerability?

Shai’s picture

StatusFileSize
new6.35 KB

Hi fumbling,

I'm attaching a patched version of the twitter.install file. Note that on the attached file you need to remove the ".txt" and then replace use the new twitter.install as part of an installation. I'm almost certain that in order to test this patch, you need to completely uninstall the Twitter module and check on the db to make sure the Twitter tables are removed. So I wouldn't test this on a production site.

FYI, here is a good page about learning how to patch: http://drupal.org/node/60108
I always do the simple technique. I get the files all in the same directory and then run:
patch < file.patch
If you don't work at the command line... on a Mac it is really easy to start because the built in application "Terminal" is really great. You open it up and you are at the command line. On Windows, the following looks promising, but I absolutely cannot vouch for it: http://unxutils.sourceforge.net/

Best,

Shai
Content2zero

Shai’s picture

Fumbling, one more thing. I'm not a maintainer here so I can't speak about any timelines for fixes getting in to new releases.

But re: process. You should test the patched file and come here and report back, say something like, "+1, used the patched file and, under the same circumstances, the error does not appear." Or obviously, if it isn't working right, report that too.

I haven't tested it, but I can, at least, attest that the patch applied cleanly. I applied the patch in #1 to the current D6 twitter dev version.

best,

Shai

greggles’s picture

Status: Needs review » Needs work

We'll also need a function to fix this for old sites, right?

fumbling’s picture

Thanks for your help, I'll try your solution through the command line

jaydub’s picture

Version: 6.x-2.0 » 6.x-2.3
Assigned: Unassigned » jaydub
Status: Needs work » Needs review
StatusFileSize
new1.54 KB

Re-rolled with an update function to take care of existing installs.

jaydub’s picture

StatusFileSize
new1.91 KB

Re-re-rolled to fix a mistake in the setting of the PRIMARY KEY and also added in changes made to schema in the twitter table that were not applied in an update. See #430442: Schema table mismatches for related issue.

walkah’s picture

Status: Needs review » Fixed

committed, thanks jaydub!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.