Database Error 1364 Field 'narrative' - Printable Version +- webERP Forum (http://www.weberp.org/forum) +-- Forum: webERP Discussion (http://www.weberp.org/forum/forumdisplay.php?fid=1) +--- Forum: Problems / Bugs? (http://www.weberp.org/forum/forumdisplay.php?fid=8) +--- Thread: Database Error 1364 Field 'narrative' (/showthread.php?tid=4440) |
Database Error 1364 Field 'narrative' - sunshinelock - 07-19-2017 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. RE: Database Error 1364 Field 'narrative' - TimSchofield - 07-20-2017 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 RE: Database Error 1364 Field 'narrative' - TimSchofield - 08-07-2017 This fix still hasn't been applied to SVN Tim RE: Database Error 1364 Field 'narrative' - TurboPT - 08-11-2017 Tim's change committed to SVN: revision 7813 |