Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

Fix for indicatorab...
 
Notifications
Clear all

Fix for indicatorable element

2 Posts
2 Users
0 Reactions
2,664 Views
(@papjul)
Posts: 143
Active Member
Topic starter
 
[#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,


 
Posted : 26 Feb 2018 18H26
babynus
(@babynus)
Posts: 14966
Main Contributor 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');
        }

 
Posted : 26 Feb 2018 18H43
Share:

Scroll to Top