sara-nl/racktables-contribs — pull request #2 by dpina000 (2014-09-01 15:01:19+00:00)
Title: csv_import.php addObject function small bug

Added (strlen($ifName ) > 0) as a verification since adding an object without ports would fail otherwise.

When adding a new object, counting the value of $ifName doesn't filter my tests of objects without ports.

--------------- before ------------------------------
example test:
"OBJECT;PATCHPANEL;this is a test entry; this is a test entry"
result:
"Internal error
Argument 'port_type_id' of value '' is invalid (format error)."
----------------------------------------------------

--------------- after------------------------------
After adding the strlen verification it's behaving properly with my test:
"OBJECT;PATCHPANEL;this is a test entry; this is a test entry"
result (the port validation is correct, as I didn't provide any):
"Importing from manual input field
No valid Port information found, skipping port import."
![image](https://cloud.githubusercontent.com/assets/5605776/4109722/c0b68288-31e8-11e4-9fb3-48428d0aa660.png)

----------------------------------------------------