View Issue Details

IDProjectCategoryView StatusLast Update
661RackTablesVMs/containerspublic2012-11-10 20:03
Reporterblaza-pl Assigned Toadoom42  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
OSDebian 
Product Version0.20.1 
Target Version0.20.2Fixed in Version0.20.2 
Summary661: Object page not displayed when container without common name
DescriptionAfter upgrading from 0.19.14 to 0.20.1 Object page was not displayed!

When container has no name (example: [Shelf]) and there are some objects contained by it then "Internal error" is displayed when opening Object page. The error message shows "Argument 'text' of value 'NULL' is invalid."

I have included my patch for interface.php which fixes this but it might not be coded the best way ;)
Steps To ReproduceCreate common object without common name (example: [Shelf]) which can hold other objects (container).
Add some other object to this object (they should be listed in "Contains:")
Open Object page - see "Internal error".
TagsNo tags attached.

Activities

blaza-pl

blaza-pl

2012-11-07 14:59

reporter  

interface.php.patch (791 bytes)   
--- /home/bgomoluch/racktables/RackTables-0.20.1/wwwroot/inc/interface.php	2012-10-04 14:06:14.000000000 +0200
+++ ./interface.php	2012-11-06 15:21:23.065324466 +0100
@@ -2068,7 +2068,17 @@
 				echo "<td>${obj['asset_no']}</td>";
 				$places = array();
 				if ($obj['container_id'])
-					$places[] = mkA ($obj['container_name'], 'object', $obj['container_id']);
+				{
+					if($obj['container_name']=='')
+					{
+					    $container = spotEntity('object',$obj['container_id']);
+					    $cname = $container['dname'];
+					}
+					else
+					    $cname = $obj['container_name'];
+					                            
+					$places[] = mkA ($cname, 'object', $obj['container_id']);
+				}
 				elseif (! array_key_exists ($obj['id'], $mountinfo))
 					$places[] = 'Unmounted';
 				else
interface.php.patch (791 bytes)   
infrastation

infrastation

2012-11-09 16:58

administrator   ~0000975

Aaron, this seems to belong to the code you updated last.
adoom42

adoom42

2012-11-10 20:03

administrator   ~0000979

The fix will be available in 0.20.2. I handled it slightly differently than your submitted patch. Thanks for the report.

Issue History

Date Modified Username Field Change
2012-11-07 14:59 blaza-pl New Issue
2012-11-07 14:59 blaza-pl File Added: interface.php.patch
2012-11-09 16:58 infrastation Note Added: 0000975
2012-11-09 16:58 infrastation Assigned To => adoom42
2012-11-09 16:58 infrastation Status new => assigned
2012-11-09 16:58 infrastation Category default => VMs/containers
2012-11-10 20:03 adoom42 Note Added: 0000979
2012-11-10 20:03 adoom42 Status assigned => closed
2012-11-10 20:03 adoom42 Resolution open => fixed
2012-11-10 20:03 adoom42 Fixed in Version => 0.20.2
2012-11-10 20:03 adoom42 Target Version => 0.20.2