View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Fix for indicatorable element - ProjeQtOr
 

Fix for indicatorable element

More
26 Feb 2018 16:26 #1 by papjul
Good day,

I have the current issue due to adding Client as Indicatorable element (not in ProjeQtOr base, but any element not containing an idProject might cause this crash so the fix may be relevant for you):
2018-02-26 11:17:41.001 ***** ERROR ***** [V6.5.6] ERROR *****
2018-02-26 11:17:41.001 ***** ERROR ***** [V6.5.6] on file '/var/www/prod/model/persistence/SqlElement.php' at line (992)
2018-02-26 11:17:41.001 ***** ERROR ***** [V6.5.6] cause = Undefined property: Client::$idProject

Here is the fix in SQLElement.php:992:
if(property_exists($this, 'idProject')) {
			$crit = array('nameIndicatorable' => get_class ( $this ), 'idle' => '0','idProject' => $this->idProject);
		} else {
			$crit = array('nameIndicatorable' => get_class ( $this ), 'idle' => '0');
		}

Not adding this fix will crash on saving if an indicator exists (closed or not) for an element with no project field (in my case, it was on Client).

I also noticed that on an indicator of type Project, the code above actually get the "is sub project of" (idProject) field instead of the id of the project (id), not sure if this is what is expected?

Thanks in advance,

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

More
26 Feb 2018 16:43 - 26 Feb 2018 16:43 #2 by babynus
Thanks for submitting the issue and the fix.

The fix, adapted to take into account Project objects, will be included in V7.0.0.
if(property_exists($this, 'idProject')) {
          $idP=(get_class($this)=='Project')?$this->id:$this->idProject;
          $crit = array('nameIndicatorable' => get_class ( $this ), 'idle' => '0','idProject' => $idP );
        } else {
          $crit = array('nameIndicatorable' => get_class ( $this ), 'idle' => '0');
        }

Babynus
Administrator of ProjeQtOr web site
Last edit: 26 Feb 2018 16:43 by babynus.

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

Moderators: babynusprotion
Time to create page: 0.037 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.