Problem/Motivation

The calculation doesn't work with the IEF module. This is happening because the evaluated fields from math expression have different parents than original ones and the path to field name should take this in consideration.

Proposed resolution

I've changed the mathfield_field_widget_form to take field parents in consideration.

I've commented the $is_new condition to be able to work properly with ief.

I've changed next hooks to match the field names based on their field parents, so the values when the calculation is made are correct. The changes had to be made in the following places:
mathfield_mathfield_get_token, mathfield_mathfield_get_token_value, mathfield_mathfield_get_token_number_alter, mathfield_mathfield_get_token_value_number_alter, mathfield_mathfield_get_token_list_alter, mathfield_mathfield_get_token_value_list_alter.

Comments

radubutco created an issue. See original summary.

radubutco’s picture

hfarrier’s picture

Tried the attached patch. The math field tries to calculate (spinning arrow appears) but no calculation appears.

radubutco’s picture

Assigned: radubutco » Unassigned
Status: Active » Needs work
antonyanimator’s picture

Hi Radubutco, this kinda works, but not quite. Can't really explain how. I have multiple ief single forms on a node, but it only seems to work for one of the entity reference fields