Nagvis update to 1.9.6


#1

After upgrading from Nagvis 1.8.5 to 1.9.6 I get the following PHP error when I open a map:

Error: (0) Trying to get property of non-object
URL: /nagvis/server/core/ajax_handler.php?mod=Map&act=getMapObjects&show=MAP1&header_menu=1&hover_menu=1&context_menu=1&zoom=100&_ajaxid=1521815375
 File: /usr/local/nagvis/share/server/core/classes/objects/NagVisObject.php
 Line: 492

#0 /usr/local/nagvis/share/server/core/classes/objects/NagVisObject.php(492): nagvisExceptionErrorHandler(8, 'Trying to get p...', '/usr/local/nagv...', 492, Array)
 #1 /usr/local/nagvis/share/server/core/classes/objects/NagVisObject.php(498): NagVisObject::sortObjectsByState(0, 'normal', 0, 'normal', 'asc')
 #2 [internal function]: NagVisObject->sortObjectsByState(Object(NagVisService), Object(NagVisService))
 #3 /usr/local/nagvis/share/server/core/classes/objects/NagVisObject.php(328): usort(Array, Array)
 #4 /usr/local/nagvis/share/server/core/classes/objects/NagVisObject.php(299): NagVisObject->getSortedObjectMembers()
 #5 /usr/local/nagvis/share/server/core/classes/objects/NagVisObject.php(386): NagVisObject->getObjectInformation()
 #6 /usr/local/nagvis/share/server/core/classes/objects/NagVisStatefulObject.php(425): NagVisObject->parseJson()
 #7 /usr/local/nagvis/share/server/core/classes/NagVisMap.php(106): NagVisStatefulObject->parseJson()
 #8 /usr/local/nagvis/share/server/core/classes/CoreModMap.php(322): NagVisMap->parseObjectsJson()
 #9 /usr/local/nagvis/share/server/core/classes/CoreModMap.php(105): CoreModMap->getMapObjects()
 #10 /usr/local/nagvis/share/server/core/functions/index.php(120): CoreModMap->handleAction()
 #11 /usr/local/nagvis/share/server/core/ajax_handler.php(59): require('/usr/local/nagv...')
 #12 {main}

I’ve checked all permissions, but can’t find the problem.
Nagvis ver 1.9.6
Linux 2.6.32-696.3.1.el6.x86_64
Apache ver 2.2.15
PHP ver 5.3.3


#2

Hmmmm, reading the git commits for 1.9.6 I’d say this is a regression.

Try editing share/server/core/classes/objects/NagVisObject.php and apply this PR (have not tested it, but it looks obvious to me).


#3

The one line change was the fix. Thanks for the help!


#4

I am also getting same error in NagVis 1.9.6.

Can you let me know what need to be change in NagVisObject.php file ?


#5

Lars already released 1.9.7 if It read Git correctly. The changes are described above, should be straight forward to apply them.


#6

On line 498 change from:

return NagVisObject::sortObjectsByState($state1, $subState1, $state2, $subState2, self::$sSortOrder);

to:

return NagVisObject::sortStatesByStateValues($state1, $subState1, $state2, $subState2, self::$sSortOrder);


#7

Thanks for your help. I am able to fix the issue.