Bug Reports · Legacy archive

Comment deleting and voting error on sub?

Started by Silveressa May 22, 2012 8 posts Locked

  1. Comment deleting and voting error on sub?

    #1
    When I attempt to delete my extra comment on Cheka's 30 Tavern Wenches ( http://strolen.com/viewing/6728 ) which I also cannot vote on for some weird reason btw, I get the following error message:  :?

    A PHP Error was encountered

    Severity: Notice

    Message: Undefined property: stdClass::$comment_id

    Filename: models/mcomment.php

    Line Number: 412

    A Database Error Occurred
    Error Number: 1054

    Unknown column 'Kassy' in 'where clause'

    UPDATE lockmor_user SET XP = XP + 4 WHERE author_id = Kassy

    Filename: /home/strolen/public_html/models/mcomment.php

    Line Number: 448
  2. Re: Comment deleting and voting error on sub?

    #2
    There is something wrong at that sub, it is registering 2 votes with a composite of 5.25. Pretty impressive considering 5.00 is the max score. There are also at least four votes judging by the comments section.

  3. Re: Comment deleting and voting error on sub?

    #3
    Boils.
  4. Re: Comment deleting and voting error on sub?

    #4
    I am almost positive it boiled down to the contributors added to the submission. For some reason, for the past 15 subs or so, people started putting text names of authors instead of the numeric id. It only accepts numeric. I had to remove all the text and null it out.

    I did add some javascript to only accept numbers and commas and added a very obvious warning so hopefully that shouldn't happen again.

    Very odd and hard to troubleshoot when it such a random event. Let me know if you see any more issues!!

    Both errors stem from the same issue so deletion and adding should both be good now.

    ((Coder Code: NEVER EVER TRUST THE USER. Always validate. :) ))
  5. Re: Comment deleting and voting error on sub?

    #5

    ((Coder Code: NEVER EVER TRUST THE USER. Always validate. :) ))


    I don't remember where I heard this but it never fails to give me a chuckle:

    A good programmer looks both ways before crossing a one-way street.


    Words to live by.
  6. Re: Comment deleting and voting error on sub?

    #6

    ((Coder Code: NEVER EVER TRUST THE USER. Always validate. :) ))


    No sh*t, sherlock. :P Even if they aren't malicious, users are idiots, and can easily frag the delicate assumptions of the database internals. ALWAYS validate. And sanitize. And have reasonable defaults in case something explodes.
  7. Re: Comment deleting and voting error on sub?

    #7
    Problem is, the use of the text names is the most logical choice. If people are using the system, then they should not be forced into an abstraction such as a numeric ID.


    I know this is a lot more programming then entering the key.  Ideally there would be autocomplete as you typed in the username populated by the database.

  8. Re: Comment deleting and voting error on sub?

    #8
    Ideally. :)

    Yes, it went on the list. I actually redid the autocomplete search (if you noticed) and will update the submission page as well.

Bug Reports · All categories · Guildhall