#4 Error Reporting Problems

closed-out-of-date
5
2004-10-28
2004-10-27
Kentaro
No

I recently installed Kwotes on my website
(http://hiddenstrength.net/kwotes/kwotes.pl?) and one
of the very first problems I ran into was that it was
reporting a failed quote addition when in fact it
succeeded.

Looking at the code, it looks like it wasn't returning
the quote uid properly in a variable, thus causing the
script to fail. I had to edit the code in such a way
that the error page looked like a success page instead.

Granted, I'm not an experienced coder, so my guess
could be wrong. Any fixes or suggestions would be most
appreciated.

Discussion

  • Brian C. Dilley

    Brian C. Dilley - 2004-10-27

    Logged In: YES
    user_id=829345

    I made a similar change recently, can you post the line of
    code (or a few of them) that you changed?

     
  • Brian C. Dilley

    Brian C. Dilley - 2004-10-27
    • assigned_to: nobody --> briandilley
    • status: open --> pending
     
  • Kentaro

    Kentaro - 2004-10-27
    • status: pending --> open
     
  • Kentaro

    Kentaro - 2004-10-27

    Logged In: YES
    user_id=1147052

    # action: doadd (add the kwote to the db)
    } elsif ($action eq "doadd") {

    if ($FORM{"content"} eq "") {
    $vars{TITLE} = "Clandestine Kwotes System: An Error Occured";
    $vars{ERROR_MESSAGE} = "No text entered";
    $main_content =
    wrap_template("html/content-error.html",%vars);

    } else {

    # add the kwote
    my $dbh = get_db_connection();
    my $kid = add_kwote($dbh, $FORM{"content"},
    $ENV{"REMOTE_ADDR"});

    # wtf? errors? in my code? noooo.
    if (!defined($kid)) {
    $vars{TITLE} = "Clandestine Kwotes System: Kwote Added";
    $vars{ERROR_MESSAGE} = "Thanks for submitting your quote!";
    $main_content =
    wrap_template("html/content-error.html",%vars);

    # all was good
    } else {
    $vars{TITLE} = "Clandestine Kwotes System: Kwote Added";
    $vars{KWOTE_ID} = $kid;
    $main_content =
    wrap_template("html/content-addform-thanks.html", %vars);

    }
    }

    Essentially, all I did was just change a few strings to make
    it look as if it succeeded to the user.

    Also of note is that the footer of the page doesn't add 1 to
    the total count of quotes until you go to a new page. Might
    that be related?

     
  • Brian C. Dilley

    Brian C. Dilley - 2004-10-28
    • status: open --> closed-out-of-date
     
  • Brian C. Dilley

    Brian C. Dilley - 2004-10-28

    Logged In: YES
    user_id=829345

    Ok, the code i'm looking for would be in kwotes-lib.pl. But
    no matter, i'm sure the fix that I implemented a few days
    ago fixed your problem (I was seeing the same thing). I'll
    be releasing a new release tonight with a lot more
    features... you should pick it up.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks