View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - API Bug in function jsonDumpObj - ProjeQtOr
 
 

API Bug in function jsonDumpObj

More
28 Aug 2014 17:29 #1 by mamath
Hi,

I use the API for getting information from ProjeQtOr, and if i try too retrieve information from object "Assignment", an error is log in projeQtOr log :

2014-08-28 17:18:18 ***** ERROR ***** Exception-[42S22] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'name' in 'field list'
2014-08-28 17:18:18 ***** ERROR ***** For query : select id as id, name as name from l_assignment where (1=1 ) order by l_assignment.name
2014-08-28 17:18:18 ***** ERROR ***** Strack trace :
2014-08-28 17:18:18 ***** ERROR ***** #0 Sql->query called at [D:\www\peps_dev_web\model\persistence\SqlList.php:93]
2014-08-28 17:18:18 ***** ERROR ***** #1 SqlList->fetchList called at [D:\www\peps_dev_web\model\persistence\SqlList.php:45]
2014-08-28 17:18:18 ***** ERROR ***** #2 SqlList->getListNotTranslated called at [D:\www\peps_dev_web\model\persistence\SqlList.php:222]
2014-08-28 17:18:18 ***** ERROR ***** #3 SqlList->getFieldFromId called at [D:\www\peps_dev_web\model\persistence\SqlList.php:214]
2014-08-28 17:18:18 ***** ERROR ***** #4 SqlList->getNameFromId called at [D:\www\peps_dev_web\api\index.php:291]
2014-08-28 17:18:18 ***** ERROR ***** #5 jsonDumpObj called at [D:\www\peps_dev_web\api\index.php:176


The bug is not blocking at all because the Assignment object good, and i have found the origin :
too correct just change the following line in
function jsonDumpObj($obj, $included=false)
of api/index.php

Change :
if (strtoupper(substr($idclass,0,1))==substr($idclass,0,1)) {
		  		$res.=", ";
		  		$res.='"name' . $idclass . '":"' . htmlEncodeJson(SqlList::getNameFromId($idclass, $val)) . '"';
		  	}

to
if (strtoupper(substr($idclass,0,1))==substr($idclass,0,1) && 
				property_exists($idclass, 'name') ) {
		  		$res.=", ";
		  		$res.='"name' . $idclass . '":"' . htmlEncodeJson(SqlList::getNameFromId($idclass, $val)) . '"';
		  	}

Bye

Please Log in or Create an account to join the conversation.

More
28 Aug 2014 19:33 #2 by babynus
Thanks for reporting the issue of providing the fix.

Will be included in next version.

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.033 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.