Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.

Another Import Bug

MrCaspanMrCaspan New
edited March 25 in Vanilla 3.x Help

If you look at the function getCountSQL in /application/dashboard/model/class.importmodel.php

the following line could return NULL

$result = "update :_$parentTable p
    set p.$parentColumnName = (
      select $aggregate(c.$childColumnName)
      from :_$childTable c
      where p.$parentJoinColumn = c.$childJoinColumn)";

If for some reason this returns NULL as in it has no parents (it shoudl but crap happens) it will error out the script

i have replace the code with

    $result = "update :_$parentTable p
         set p.$parentColumnName = (
           select IFNULL($aggregate(c.$childColumnName),0)
           from :_$childTable c
           where p.$parentJoinColumn = c.$childJoinColumn)";

this will test for null and if null will return 0

Comments

Sign In or Register to comment.