Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database Error 1364 Field 'narrative'
07-19-2017, 11:59 PM, (This post was last modified: 07-20-2017, 12:48 AM by sunshinelock.)
#1
Database Error 1364 Field 'narrative'
Well, I guess my host upgraded MySQL and now I'm popping up errors here and there.

If I go into an inventory item and click "Quantity Adjustments" and enter the usual things that need adjusting, after several seconds I get the following error:



Database Error 1364 : CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE: The stock movement record cannot be inserted because
Field 'narrative' doesn't have a default value
Database SQL Failure : The following SQL to insert the stock movement record was used
INSERT INTO stockmoves (stockid, type, transno, loccode, trandate, userid, prd, reference, qty, newqoh, standardcost) VALUES ('SAMPLESTOCKCODE', 17, '4347', 'SAMPLELOCATION', '2017-07-19', 'USERNAME', '131', 'Counted and missing', '-1', '0', '1.105')
Database Rollback Due to Error Above : Rolling Back Transaction OK

Running 4.13.1
Problem fixed...

I had to log into phpMyAdmin (MySQL backend) and in table "stockmoves" I clicked on "narrative" and changed the default from "None" to "NULL". Seems to be working now.
Reply
07-20-2017, 06:20 AM,
#2
RE: Database Error 1364 Field 'narrative'
Your fix works, but to fix the sql the query at Line 213 should be:

$SQL = "INSERT INTO stockmoves (stockid,
type,
transno,
loccode,
trandate,
userid,
prd,
reference,
qty,
newqoh,
standardcost,
narrative)
VALUES ('" . $_SESSION['Adjustment' . $identifier]->StockID . "',
17,
'" . $AdjustmentNumber . "',
'" . $_SESSION['Adjustment' . $identifier]->StockLocation . "',
'" . $SQLAdjustmentDate . "',
'" . $_SESSION['UserID'] . "',
'" . $PeriodNo . "',
'" . $_SESSION['Adjustment' . $identifier]->Narrative ."',
'" . $_SESSION['Adjustment' . $identifier]->Quantity . "',
'" . ($QtyOnHandPrior + $_SESSION['Adjustment' . $identifier]->Quantity) . "',
'" . $_SESSION['Adjustment' . $identifier]->StandardCost . "',
'')";

This is caused by the sql_mode issue I mentioned in answer to your other post.

Tim
Reply
08-07-2017, 12:20 AM,
#3
RE: Database Error 1364 Field 'narrative'
This fix still hasn't been applied to SVN

Tim
Reply
08-11-2017, 11:00 AM, (This post was last modified: 08-11-2017, 11:02 AM by TurboPT.)
#4
RE: Database Error 1364 Field 'narrative'
Tim's change committed to SVN: revision 7813
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)