You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While editing some templates my colleagues encountered 500 error. Which I can see in error log: [Wed Jul 26 09:06:38.785085 2023] [php:error] [pid 13250] [client 172.16.1.1:52344] PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'CDUTemplateID' in 'field list' in /var/www/html/classes/CDUTemplate. class.php:218\nStack trace:\n#0 /var/www/html/classes/CDUTemplate.class.php(218): PDO->query()\n#1 /var/www/html/classes/DeviceTemplate.class.php(206): CDUTemplate->DeleteTemplate()\n#2 /var/www/html/device_templates.php(271): DeviceTemplate->UpdateTemp late()\n#3 {main}\n thrown in /var/www/html/classes/CDUTemplate.class.php on line 218, referer: http://dcim.int.bite.lt/device_templates.php?TemplateID=56
Quick grep through code shows that line in ./classes/CDUTemplate.class.php is: $sql="UPDATE fac_PowerDistribution SET CDUTemplateID=0 WHERE TemplateID=$this->TemplateID;";
Should not it be? $sql="UPDATE fac_PowerDistribution SET TemplateID=0 WHERE TemplateID=$this->TemplateID;";
There is no CDUTemplateID column in that table but TemplateID is.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
While editing some templates my colleagues encountered 500 error. Which I can see in error log:
[Wed Jul 26 09:06:38.785085 2023] [php:error] [pid 13250] [client 172.16.1.1:52344] PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'CDUTemplateID' in 'field list' in /var/www/html/classes/CDUTemplate. class.php:218\nStack trace:\n#0 /var/www/html/classes/CDUTemplate.class.php(218): PDO->query()\n#1 /var/www/html/classes/DeviceTemplate.class.php(206): CDUTemplate->DeleteTemplate()\n#2 /var/www/html/device_templates.php(271): DeviceTemplate->UpdateTemp late()\n#3 {main}\n thrown in /var/www/html/classes/CDUTemplate.class.php on line 218, referer: http://dcim.int.bite.lt/device_templates.php?TemplateID=56
Quick grep through code shows that line in ./classes/CDUTemplate.class.php is:
$sql="UPDATE fac_PowerDistribution SET CDUTemplateID=0 WHERE TemplateID=$this->TemplateID;";
Should not it be?
$sql="UPDATE fac_PowerDistribution SET TemplateID=0 WHERE TemplateID=$this->TemplateID;";
There is no CDUTemplateID column in that table but TemplateID is.
Beta Was this translation helpful? Give feedback.
All reactions