Author: jfthomps
Date: Wed Apr 1 13:22:46 2015
New Revision: 1670641
URL: http://svn.apache.org/r1670641
Log:
VCL-763 - Add missing constraints to database tables
statistics.php: modified addToStatGraphCache: added code to set $affilid and
$provid to 'NULL' when they are passed in as 0 so that NULL is used in the
insert query instead of 0 to prevent a foreign key constraint error
Modified:
vcl/trunk/web/.ht-inc/statistics.php
Modified: vcl/trunk/web/.ht-inc/statistics.php
URL:
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/statistics.php?rev=1670641&r1=1670640&r2=1670641&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/statistics.php (original)
+++ vcl/trunk/web/.ht-inc/statistics.php Wed Apr 1 13:22:46 2015
@@ -1396,6 +1396,10 @@ function getStatGraphConVMUserData($star
function addToStatGraphCache($type, $addcache, $affilid, $provid) {
$nosave = time() - SECINDAY;
$values = array();
+ if($affilid == 0)
+ $affilid = 'NULL';
+ if($provid == 0)
+ $provid = 'NULL';
foreach($addcache as $date => $value) {
$startts = datetimeToUnix($date);
if($startts < $nosave) {