View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - advices on implementing reserve management solution - Page 3 - ProjeQtOr
 
 

advices on implementing reserve management solution

More
28 Aug 2013 19:48 - 28 Aug 2013 19:55 #13 by babynus
Hi,

I found the fix.
Not easy to find :S

It is due to forcing of the ID (I really never use it on my projects).
In this case, the function called to save is ... $object->insert()...
Import is the only way that calls this function. Any other means use $object->save().
Unluckily, although $object->insert() realizes a save calling SqlElement::saveSqlElement, the save() method of all the objects is not called, so all calculated fields are not updated.

So the fix is : on /model/persistence/SqlElement.php, replace lines 307 and following from
public function save() {
    return $this->saveSqlElement();
  }

  public function insert() { // Specific function to force insert with a defined id - Reserved to Import fonction
    return $this->saveSqlElement(false, false, true);
  }
to
public function save() {
    if (isset($this->_onlyCallSpecificSaveFunction) and $this->_onlyCallSpecificSaveFunction==true) return;
    return $this->saveSqlElement();
  }

  public function insert() { // Specific function to force insert with a defined id - Reserved to Import fonction
    $this->_onlyCallSpecificSaveFunction=true;
    $this->save(); // To force the update of fields calculated in the save function ...
    $this->_onlyCallSpecificSaveFunction=false;
    return $this->saveSqlElement(false, false, true);
  }

This fix will be deployed on V3.5.0

Babynus
Administrator of ProjeQtOr web site
Last edit: 28 Aug 2013 19:55 by babynus.

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

More
30 Aug 2013 18:11 - 30 Aug 2013 18:12 #14 by leodom
Babynus the genius !

Great thanks for that quick fix !
I will try it now...
Last edit: 30 Aug 2013 18:12 by leodom. Reason: spelling correction

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.