Skip to content

Commit

Permalink
Fixing issue with calc_on_save_only in inline edit.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Nov 11, 2013
1 parent c05a875 commit 00a8e59
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions plugins/fabrik_element/calc/calc.php
Original file line number Diff line number Diff line change
Expand Up @@ -734,15 +734,23 @@ public function onAjax_listUpdate()
$data = $listModel->getData();
$return = new stdClass;
$w = new FabrikWorker;
$store = (bool) $params->get('calc_on_save_only', 0);
/**
* $$$ hugh ... no, we never need to store in this context. The 'calc_on_save_only' param simply distates
* whether we re-calc when displaying the element, or just use the stored value. So if calc_on_save_only is
* set, then when displaying in lists, we don't execute the calc, we just used the stored value fro the database.
* And that logic is handled in _getV(), so we don't need to do the $store stuff.
*/
// $store = (bool) $params->get('calc_on_save_only', 0);
$listRef = 'list_' . $listModel->getRenderContext() . '_row_';
$storeKey = $this->getElement()->name;
// $storeKey = $this->getElement()->name;

foreach ($data as $group)
{
foreach ($group as $row)
{
$key = $listRef . $row->__pk_val;

/*
$default = $w->parseMessageForPlaceHolder($params->get('calc_calculation'), $row);
if (FabrikHelperHTML::isDebug())
Expand All @@ -758,6 +766,9 @@ public function onAjax_listUpdate()
{
$listModel->storeCell($row->__pk_val, $storeKey, $return->$key);
}
*/

$return->$key = $this->_getV(JArrayHelper::fromObject($row), 0);
}
}

Expand Down

0 comments on commit 00a8e59

Please sign in to comment.