Joined Repeatable list/form calc problems

Status
Not open for further replies.

APursch

Member
I've been running a particular Fabrik form in J3 for some years without issue, it's a simple sale entry with the sale detail - customer, order date etc in the main List/Form (t_sales) and the items ordered in a joined repeatable List (t_sale_items).
The first screen print illustrates how it looks with some Calc fields settin the net price/unit and line totals
s!AjZR2Vrd2pFlzMsb8Q21YX9uW-2jWw

I tried updating this to J4.3.1 F4G3 and had so many problems I decided to start from scratch but have run into a similar problem in the new build.
Below you can see that the new build calculates fine in the first line of the repeat group but then fails - in fact it just takes the value from line 1 irrespective of the changed detail in subsequent lines. Further, as can be seen, it switches the first Yes/No field without input from the user. I'm seeing no warning or errors in the Consol or Network, etc. Any ideas please?
s!AjZR2Vrd2pFlzMsc5Lw3vbI4RBgmwA
 
Please bear with me, I should have mentioned that the calc fields all carry the same _0 suffix, whereas the other fields run _0, _1, _2 etc as they should.
 
Can you try:

In plugins\fabrik_element\calc\layouts\fabrik-element-calc-form.php line 16
add class fabrikinput
so
<div class="fabrikinput form-control-plaintext....
 
That's great thank you, the calc is working again. :) However, I still have the first Yes/No field switching from default Yes to No on load, back to correct Yes in second repeat row and to No again for subsequent rows. Tried to work around with radio buttons, but that's irregular in a similar way too. :(
 
For YesNO:
in plugins\fabrik_element\yesno\yesno.php
add after line 318 ($displayData->class = implode(' ', $this->gridClasses()['label']);)
$displayData->class .= ' fabrikinput ';
 
Again thank you. Is there a fix for the radio buttons too which which repeat ok for the first repeat row but then ignore defaults in the third and subsequent repeats?
 
I'm seeing radio button issues with buttongroup=yes (but didn't find why until now), but it seems to be ok with "old style" radios.
Can you try with buttongroup=no?
 
Oddly, button group No throws the problems for me whereas button group Yes works ok.
i.e. button group No, generates old style radios with problem, button group Yes generates, um, buttons with no problems. Curious!?!
I see you mention Gamma 3a elsewhere, I'm on Gamma 3 - is 3a available and might that have any effect?
 
All was going swimmingly by using the modified calc field and yes/no buttons, thanks to Troester. However, I have two calc fields in this joined repeat form. The first calculates a net price per unit after applying various pricing options, the second simply multiplies that net price by the quantity field to achieve a total. The previous version of Fabrik required to arrive at the total one needs to include the php script from the first calc field (net each) to be multiplied by the quantity - and that worked, as can be seen in the pic below.
J3-Fab3-b.png
Sadly, now, applying similar to Fabrik 4 I get 'Call to a member function query() on null'. Publishing either of the 2 calcs alone works fine, they just won't live together. Any thoughts anyone?
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top