Calc value not saving to db and only showing in list view.

pundip

Member
I have a calc element with the following code:

$myCalc = (int)'{student_impact_score___impact_on_students}' * '{student_impact_score___timing_of_change}'*'{student_impact_score___number_of_students}';

return ($myCalc);


The element shows the result in list view only. It shows 0 in edit and form view. Database records 0. If I manually change the database value there is no impact in that edit and form view show 0 and list view shows the correct value. The value entered in the database is not rendered.

Settings are as follows:

Format string: empty

Only Calc on Save: NO

Ajax calculation: YES

Ajax observe fields: empty

Calc on load: YES

Hidden: NO

I am on php 7.2 and latest version of Joomla and plugin to date.

tables are all on the same database as the joomla db.
 
Hi Hugh,
They are dropdowns with the values being integers. The are not cascading drop downs although one of them is watched by a cascading dropdown not used in the calculation. All tables on joomla db
 
Try using the raw placeholders, so append _raw to each of the element names, like {student_impact_score___impact_on_students_raw}.

WIth any element type which has the concept of a "value" and a "label" (dropdowns, radios, etc), the non-raw placeholder gets you the label, and the _raw gets you the value. Well ... sometimes the non-raw will get you the value, depending on the context. But if you want the value, always use _raw.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top