Bug (closed)

EffortPersonRole caused error

Summary

closed
Apr 20, 2007
100%
May 29, 2007
Apr 20, 2007 / pixtur
Aug 5, 2009 / rafael.dalpra
burger
 

Attached files

No files uploaded
 
Error 20070420130209 NOTICE: listslist_effortsperson.inc.php : 129 Undefined offset:  -1
Error 20070420130209 listslist_effortsperson.inc.php :  89 -> ListBlock::render_trow(*Effort)
Error 20070420130209 listslist_effortsperson.inc.php :  70 -> ListBlock_effortsPerson::renderListHtml([1])
Error 20070420130209 listslist_effortsperson.inc.php :  57 -> ListBlock_effortsPerson::render_list([1])
Error 20070420130209    pagesproject_more.inc.php :1632 -> ListBlock_effortsPerson::print_automatic()
Error 20070420130209 stdclass_pagehandler.inc.php : 719 -> ProjViewEfforts()
Error 20070420130209 stdclass_pagehandler.inc.php : 620 -> PageHandler::show("projViewEfforts", [2])
Error 20070420130209          pageseffort.inc.php : 746 -> PageHandler::showFromPage()
Error 20070420130209 stdclass_pagehandler.inc.php : 719 -> effortEditSubmit()
Error 20070420130209                     index.php : 206 -> PageHandler::show("effortEditSubmit")
Error 20070420130209 
Error 20070420130209      Variables in render_trow():
Error 20070420130209                           obj = OBJECT
Error 20070420130209                         style = NULL
Error 20070420130209          g_user_profile_names = Array
Error 20070420130209                       project = OBJECT
Error 20070420130209                            pp = Array
Error 20070420130209    v0.07972, projViewEfforts, from 127.0.0.1,  uri:/streber/index.php

this seems to be related with...

from list_effortperson.inc.php line 127

		if($project = Project::getVisibleById($obj->project)){
			if($pp = $project->getProjectPersons(array('person_id'=>$obj->person))){
				$role = $g_user_profile_names[intval($pp[0]->role)];
			}
			else{
				$role = '';
			}
			
		}

looks like $pp[0]->role is -1 ...

Any idea

Issue report

Minor
Have not tried
PHP 5.2.X
Streber 0.07972
2007-01-14 16:41
 

7 Comments

burger:I think ...

11 years ago (2. update 11 years ago)

... the problem is that in database at the 'streb_projectperson' table the attribute 'role' can be NULL. I think that could be the reason why the error occurs. Maybe we should change the attribute in the db to '0' as default value.
I didn't get this error because we don't have entries in the 'streb_projectperson' table with NULL in the 'role' attribute.
Sorry.

pixtur:you are right...

11 years ago

Can you adjust the definition of the db-field and add the default value 0 ?

burger:Just changed ...

11 years ago

... and committed.

pixtur:don't forget...

11 years ago

You also need to update this field:

from conf.inc.php line 53ff

    /**
    * - the database version is stored in the db-table inside the row with updated=NULL
    * - this version is checked on installation and before logging in (if no cookie provided)
    *
    * - additionally the current db-version is set by DB_VERSION in _settings/db_settings.inc
    */
    'DB_VERSION_REQUIRED'   => '0.07972',

Otherwise other people will not be prompted to upgrade.



burger:Sorry ...

11 years ago

I was really confused what I have to change because in the version before mine there were three different 'version-numbers'. Therfore I wasn't sure anymore what to change.

pixtur:no problem...

11 years ago

The version number stuff is stupid, I know.

Some clarification:


STREBER_VERSION is displayed at the bottom and is the version of the "php code"

DB_CREATE_VERSION is the version of the database that is created after upgrading / installation

DB_VERSION_REQUIRED is the required version of the database and is checked on login and probably refering to upgrade page.

DB_CREATE_STREBER_VERSION_REQUIRED is useless. It makes sure that the version of the php-code is sufficient. But this is always the case...

Maybe we should refactor this stuff.

pixtur:I guess we can close this??

11 years ago