Menu

Smack Talk missing field?

Help
cnyballer
2010-03-12
2013-03-27
  • cnyballer

    cnyballer - 2010-03-12

    I only see 2 fields to complete for smack talk: From and Comment

    When I hi submit, I get the following error: "Field 'subject' doesn't have a default value"

    Is the subject field missing from view.php in 1.5.3?

     
  • cnyballer

    cnyballer - 2010-03-14

    No one else has this issue?

     
  • Matt Clark

    Matt Clark - 2010-03-14

    Nope… working fine for me.  I don't see a subject line either -just a from box and comment box.

     
  • cnyballer

    cnyballer - 2010-03-14

    What version are you running? i've tried fresh installs of 1.5.3 and 1.5.3.1 and still get the error.  Not sure where to look to troubleshoot it.

     
  • Rob J

    Rob J - 2010-03-14

    Working fine for me. Using latest trunk. The comments table has a subject column. It might be that your database doesnt allow fields without a default value? I dont think the column is used, right now

     
  • cnyballer

    cnyballer - 2010-03-14

    Looks like it must be a db requirement on mine.  I tried setting a default value but it gave an error.  Instead I deleted the field in the table and now it works fine.  Thanks!

     
  • Rob J

    Rob J - 2010-03-14

    what version mysql are you using?

     
  • cnyballer

    cnyballer - 2010-03-14

    5.1.41

     
  • bigworm

    bigworm - 2010-03-18

    I have this problem also…I think it is related to running mysql on windows?

     
  • bigworm

    bigworm - 2010-03-18

    SQL query:
    ALTER TABLE comments CHANGE subject subject TINYTEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'Smack'
    MySQL said: Documentation
    #1101 - BLOB/TEXT column 'subject' can't have a default value

     
  • bigworm

    bigworm - 2010-03-18

    Fixed this by looking at old version from last year…

    In addcomment.php around line 11

    Replace

    $query = "INSERT INTO `comments` (`bracket`,`from`,`content`) VALUES ('$bracket','$from','$comment')";
    

    with

    $query = "INSERT INTO `comments` (`bracket`,`from`,`subject`,`content`) VALUES ('$bracket','$from','$subject','$comment')";
    
     
  • John Holder

    John Holder - 2010-03-18

    You're correct, the database creation scripts ask that subject be NOT NULL.  Since $subject is not populated, and we don't use it, i checked in the following instead:

    $query = "INSERT INTO `comments` (`bracket`,`from`,`subject`,`content`) VALUES ('$bracket','$from',' ','$comment')";
    
     

Log in to post a comment.