opendcim / openDCIM

An open source (GPL v3) Data Center Inventory Management (DCIM) application.
http://opendcim.org
305 stars 204 forks source link

v.23.04 - bulk_container.php incorrect column name on count parameter causing 500 error #1519

Open dgrazier1 opened 6 months ago

dgrazier1 commented 6 months ago

Describe the bug bulk import of containers generating http 500 error due to incorrect column specification on count() (v.23.04)

Code in the file as it originally existed: $st = $dbh->prepare( "select count(RowID) as TotalMatches, CabRowID from fac_CabRow where DataCenterID=:DataCenterID and ZoneID=:ZoneID and ucase(Name)=ucase(:Name)" );

Count should be CabRowID. After manually making change to the bulk_container.php file, the problem was fixed.

To Reproduce Steps to reproduce the behavior:

  1. Create and save .xlsx file with the following: DataCenter Container Zone Row
    A1 A A1-1 A1-1-R1
    A1 A A1-2 A1-1-R2
    B1 B B1-1 B1-1-R1
    B1 B B1-2 B1-1-R2
  2. Go to '...' : Bulk Importer -> Import Container/Datacenter/Zone/Row
  3. Choose .xlsx file and Click Upload
  4. Click Process
  5. See error

Were you able to reproduce this on the dev or demo sites?

Expected behavior A clear and concise description of what you expected to happen. Expected it to import the values in the file without error

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Changing the line to the following fixed the issue $st = $dbh->prepare( "select count(CabRowID) as TotalMatches, CabRowID from fac_CabRow where DataCenterID=:DataCenterID and ZoneID=:ZoneID and ucase(Name)=ucase(:Name)" );

MathisICDC commented 1 month ago

I also have a problem importing the network link mass on this same version. Unfortunately, I still don't have the solution. Mathis