Page MenuHomePhabricator

Poll owner field exists with no default value
Closed, ResolvedPublic

Description

SecurePoll's database schema includes a field el_owner defined as a non-null integer with no default value. In practice, it is never assigned a value by the poll creation page either. Running grep owner * -r on the code indicates it is never used anywhere really. In practice, it is always assigned the value 0 if the database is not using strict mode. If the DB is using strict mode, CreatePage will throw a DB exception because el_owner doesn't have a default value; this means you cannot even create a poll in strict mode.

The el_owner field should instead be populated with the user ID of the user who creates the poll. That way we won't have issues with strict mode either.

Event Timeline

Change 315320 had a related patch set uploaded (by Huji):
Poll owner field exists with no default value

https://gerrit.wikimedia.org/r/315320

Huji triaged this task as Lowest priority.Oct 11 2016, 6:09 PM
Huji raised the priority of this task from Lowest to Medium.Oct 11 2016, 7:59 PM

@Huji wrote:

The el_owner field should instead be populated with the user ID of the user who creates the poll. That way we won't have issues with strict mode either.

This seems like a great solution to me.

Change 315320 merged by jenkins-bot:
Poll owner field exists with no default value

https://gerrit.wikimedia.org/r/315320

Huji removed a project: Patch-For-Review.