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

Upgrading from Vanilla1 > Vanilla 2 error in import process "Column 'CountComments' cannot be null"

rockwaldorockwaldo New
edited February 2011 in Vanilla 2.0 - 2.8
Column 'CountComments' cannot be null|Gdn_Database|Query|update GDN_Category p set p.CountComments = ( select sum(c.CountComments) from GDN_Discussion c where p.CategoryID = c.CategoryID)

I've looked through the old forum data and I can't seem to work out what can be causing it. It looked like it may be a few discussions that had been deleted with no live comments, but even after removing them I still get the error message above at the "recreating Count" step (exact name I cant remember, 3rd from last one)

Any ideas?

Comments

  • Options
    davidE44davidE44 New
    edited September 2014

    Not sure if anyone else is running into this problem but it is caused by trying to migrate empty nodes. For example Category NodeA contains Forum NodeB and Forum NodeC. The forum nodes contain messages but the category node does not. You can fix this by changing applications/dashboard/models/class.importmodel.php : 466

    // Add IFNULL(..., 0) around the inner select statement
    
    $Result = "update :_$ParentTable p
                      set p.$ParentColumnName = IFNULL((
                         select $Aggregate(c.$ChildColumnName)
                         from :_$ChildTable c
                         where p.$ParentJoinColumn = c.$ChildJoinColumn), 0)";
    

    Hope this helps someone.

Sign In or Register to comment.