Forum

Fix for indicatorab...
 
Notifications
Retirer tout

Fix for indicatorable element

2 Posts
2 Utilisateurs
0 Reactions
2,629 Vu
(@papjul)
Posts: 143
Reputable Member
Début du sujet
 
[#4991]

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,


 
Posté : 26/02/2018 6:26 pm
(@babynus)
Posts: 14952
Membre Admin
 

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');
        }

 
Posté : 26/02/2018 6:43 pm
Share:
Retour en haut