Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#3402 polls broken in css branch

Slash 2.5/3.0
open
Tim Vroom
Other (492)
5
2005-09-27
2005-09-06
shane
No

Sep 05 19:36:58 <tf23> well, i was going to submit a new bug; polls are
broke i
n css branch
Sep 05 19:37:12 <tf23> [Mon Sep 5 23:28:31 2005] [error] /
pollBooth.pl:Slash::
DB::Utility:/usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi/Slash/DB/
Util
ity.pm:982:virtuser='ourops' -- hostinfo='sql0 via TCP/IP' -- Cannot add
or upda
te a child row: a foreign key constraint fails -- INSERT INTO
pollquestions (t
opic,uid,polltype,date,voters,question,primaryskid,autopoll) VALUES(\n
'6',\n
'2',\n 'section',\n '2005-09-05 23:31:14',\n '0',\n 'Do you own a
Sep 05 19:37:12 <tf23> firearm?',\n '1',\n 'no')\n
Sep 05 19:37:12 <tf23> [Mon Sep 5 23:28:31 2005] [error] Which was
called by:S
lash::DB::MySQL:/usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi/
Slash/DB/
MySQL.pm:4029\n
Sep 05 19:37:33 <tf23> click 'poll' in admin menu. try and create a new
one, an
d you get that in your logs

Discussion

  • shane
    shane
    2005-09-08

    Logged In: YES
    user_id=52587

    more info:
    the insert into poll answers works, but the qid is zero.

    looking at the schema for pollquestions, there is a foreign key on the
    discussion id.

    so the problem is when you attempt to create a poll that is not linked to a
    discussion, DB::Mysql::savePollQuestion tries to do this:

    $self->sqlInsert("pollquestions", {
    question => $poll->{question},
    voters => $poll->{voters},
    topic => $poll->{topic},
    primaryskid => $poll->{primaryskid},
    autopoll => $poll->{autopoll},
    uid => getCurrentUser('uid'),
    date => $poll->{date},
    polltype => $poll->{polltype}
    });

    and it fails because a) it's got no discussionid to pass to sqlInsert, and even
    if it did, the code doing the sqlInsert doesn't insert the integer for
    pollquestions.discussion.

    I'm thinking the sqlInsert needs modified, and the FK constraint needs to be
    dropped. Any thoughts?

     
  • Rob Malda
    Rob Malda
    2005-09-27

    • assigned_to: nobody --> tvroom