howardjones / network-weathermap

Network Weathermap draws diagrams from data
http://www.network-weathermap.com/
MIT License
425 stars 94 forks source link

Unable to open any of my previusly designed map in editor on SVN: 1143 #86

Closed ikorzha closed 7 years ago

ikorzha commented 7 years ago

Howie, I' unable to open any of the previously made maps on the latest SVN build 1143 (database-refactor).

Errors from the editor are below, I have PM you a sample map for testing thru Cacti forum. Thank you in advance for your attention to this issue. My environment CentOS 6.5, PHP Version 5.3.3, Cacti Version 0.8.8a

Fatal error: Uncaught exception 'WeathermapInternalFail' with message 'No Bounding Box until points are added' in /var/www/html/plugins/weathermap/lib/WMBoundingBox.class.php:58 Stack trace: #0 /var/www/html/plugins/weathermap/lib/WeatherMapNode.class.php(324): WMBoundingBox->getBoundingRectangle() #1 /var/www/html/plugins/weathermap/lib/Weathermap.class.php(1074): WeatherMapNode->pre_render(Resource id #127, Object(WeatherMap)) #2 /var/www/html/plugins/weathermap/editor.php(1011): WeatherMap->DrawMap('null') #3 /var/www/html/plugins/weathermap/weathermap-cacti88-plugin-editor.php(22): require_once('/var/www/html/p...') #4 {main} thrown in /var/www/html/plugins/weathermap/lib/WMBoundingBox.class.php on line 58

howardjones commented 7 years ago

I think I see why (haven't tested yet, as I'll need to edit the map to use fonts and images that I actually have) - all these nodes have no label, and a ICON that is calculated from a scale tag. The icon will not be loaded in the editor, as it will resolve to images/port_[UNKNOWN].png and so there is effectively no element drawn for the node (label or icon). That's what the error is complaining about - it is trying to find the size of the icon/label/icon+label to calculate the positions of the node edges, and getting confused.

It shouldn't just kill the editor like that though, so I'll rethink what to do in that situation.

ikorzha commented 7 years ago

Thank you so much for your detailed explanation, I will be looking forward to test any potential fix you might implement. I just to add to add that I have no issues with opening and editing the map using an old build SVN 684 from which I'm trying to migrate off once I move onto Cacti 1.x.x

ikorzha commented 7 years ago

Thank you I have tested the fix, the editor is now functioning with my maps. With your permission, I will be closing this issue.