HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Another Import Bug
MrCaspan
✭
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
0
Comments
I have submitted this bug to GitHub
https://github.com/vanilla/vanilla/issues/10303