Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

[GitHub #1630] Bug ? Incorrect integer value: '' for column 'Archived' at row 1*

cocomangcocomang New
edited January 2014 in Vanilla 2.0 - 2.8

I have just installed a new version of vanilla.
In the dashboard/forum/categories/Organize Categories/Edit/This category has custom permissions

when I press on save I get the following error:

Fatal Error in Gdn_Database.Query(); Incorrect integer value: '' for column 'Archived' at row 1
update GDN_Category Category set UrlCode = :UrlCode, Archived = :Archived, Name = :Name, Description = :Description, UpdateUserID = :UpdateUserID, DateUpdated = :DateUpdated, AllowDiscussions = :AllowDiscussions where CategoryID = :CategoryID
The error occurred on or near: C:\inetpub\wwwroot\vanilla\library\database\class.database.php

snip

Comments

  • Options
    UnderDogUnderDog MVP
    edited January 2014

    Just follow this bug number on github. Don't think we have a solution for the moment unless you find something in the search. There's multiple discussions about this problem. https://github.com/vanillaforums/Garden/issues/1630
    If you look at 'homepage' in your dashboard, what's the setting? 'Categories'?, 'tables'? 'Mixed'?
    Just a guess on the version number of Vanilla : Is it 2.0.18.10?

    There was an error rendering this rich post.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Although it looks different, I suppose it is the same error as your last one. You are using MySQL in strict mode, right? Vanilla doesn't support it.
    If you do not change that setting, you might have more errors like that. See strict mode = false as a software requirement.
    Giving you a workaround for that error is easy (look at the save function of category model and insert an if statement to test in the parameter for '' and replace it with 0). That workarounds will never make it into the official version, though, so you are lost on each version upgrade.
    My advice is to get the requirements for vanilla and start from there

  • Options

    Ohh, didn't realize it was the same user. @cocomang also search for 'Archived' on the github issue list. There's more issues reported regarding Strict mode and this error. (and a possible solution of course).
    Next time please post that you had strict mode on and that you changed that of course

    There was an error rendering this rich post.

  • Options

    @R_J said:
    Although it looks different, I suppose it is the same error as your last one. You are using MySQL in strict mode, right? Vanilla doesn't support it.
    If you do not change that setting, you might have more errors like that. See strict mode = false as a software requirement.
    Giving you a workaround for that error is easy (look at the save function of category model and insert an if statement to test in the parameter for '' and replace it with 0). That workarounds will never make it into the official version, though, so you are lost on each version upgrade.
    My advice is to get the requirements for vanilla and start from there

    Thanks for your answer.
    I have already tried all the solutions around removing the strict mode, this is impossible to do!
    MySql is installed by default with strict mode and it totally ignores all my request to remove the strict mode from the my.ini file.
    In fact, it looks like removing strict mode works, but first operation in vanilla is automatically resetting to strict mode!?

    By the way I have tried the workaround replacing directly the value in the code. it does not solve the problem:

    in class.settingscontroller.php around line 400;

    if I force the value to 1 like this: $Category['Archived'] = '1'; it does not crash anymore but the Category is archived which is not what I want.
    if I force the value to 0 like this: $Category['Archived'] = '0'; it produce the same fatal error:
    Fatal Error in Gdn_DatabaseDebug.Query(); Incorrect integer value: '' for column 'Archived' at row 1

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Look in class.categorymodel.php for the function "Save" and the first $Fields =.... Add something like that below that line:

    if ($Fields['Archieved'] = '')
       $Fields['Archieved'] = 0;
    

    But again: that's ugly as hell.
    I'd strongly recommend searching for help because of your strict mode problem in any MySQL forum. A quick search gave me this (but you might have tried that already):

  • Options

    For your information I solved this problem by adding this line in config.php

    @GLOBAL.sql_mode=\'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,TRADITIONAL\'';

Sign In or Register to comment.