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.
Can't get nested categories to work (SQL Error)
First I could not get it to work on my test upgrade, so I tried a new install.
Tried 2.0.17.8 connected to a blank database schema. Created a new category c1. Created a new category c1.1.
Tried to place c1.1 under c1.
It tries to run
update GDN_Category Category set
TreeLeft = :TreeLeft,
TreeRight = :TreeRight,
Depth = :Depth,
Sort = :Sort,
ParentCategoryID = :ParentCategoryID,
PermissionCategoryID = :PermissionCategoryID
where CategoryID = :CategoryID
with the data
_NamedParameters Array [7]
:TreeLeft 1
:TreeRight 8
:Depth 0
:Sort 1
:ParentCategoryID none
:PermissionCategoryID -1
:CategoryID -1
and returns a
Incorrect integer value: 'none' for column 'ParentCategoryID' at row 1|Gdn_Database|Query|update GDN_Category Category set
TreeLeft = :TreeLeft,
TreeRight = :TreeRight,
Depth = :Depth,
Sort = :Sort,
ParentCategoryID = :ParentCategoryID,
PermissionCategoryID = :PermissionCategoryID
where CategoryID = :CategoryID
Bug or am I doing something wrong?
Tried 2.0.17.8 connected to a blank database schema. Created a new category c1. Created a new category c1.1.
Tried to place c1.1 under c1.
It tries to run
update GDN_Category Category set
TreeLeft = :TreeLeft,
TreeRight = :TreeRight,
Depth = :Depth,
Sort = :Sort,
ParentCategoryID = :ParentCategoryID,
PermissionCategoryID = :PermissionCategoryID
where CategoryID = :CategoryID
with the data
_NamedParameters Array [7]
:TreeLeft 1
:TreeRight 8
:Depth 0
:Sort 1
:ParentCategoryID none
:PermissionCategoryID -1
:CategoryID -1
and returns a
Incorrect integer value: 'none' for column 'ParentCategoryID' at row 1|Gdn_Database|Query|update GDN_Category Category set
TreeLeft = :TreeLeft,
TreeRight = :TreeRight,
Depth = :Depth,
Sort = :Sort,
ParentCategoryID = :ParentCategoryID,
PermissionCategoryID = :PermissionCategoryID
where CategoryID = :CategoryID
Bug or am I doing something wrong?
0
Comments
There was an error rendering this rich post.
Added a pull request with the addition to the category model at line 456
else if ($ParentCategoryID == 'none')
$ParentCategoryID = null;