1. "Fabrik 4" helpers needed!

    You are invited to join other community members active in coding, maintaining and improving Fabrik. Please visit https://fabrik.help for more information!
    Dismiss Notice

Joined Repeatable list/form calc problems

Discussion in 'Bugs, Issues & Suggestions' started by APursch, May 26, 2023.

Thread Status:
Not open for further replies.
  1. APursch

    APursch Member

    Level: Community
    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
    [​IMG]
    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?
    [​IMG]
     
  2. APursch

    APursch Member

    Level: Community
    Sorry had problem with images ... J3-Fab3.png J4.3.1-Fab4 G3.png
     
  3. APursch

    APursch Member

    Level: Community
    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.
     
  4. troester

    troester Well-Known Member Staff Member

    Level: Community
    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....
     
  5. troester

    troester Well-Known Member Staff Member

    Level: Community
    Should be fixed in the next release.
     
  6. APursch

    APursch Member

    Level: Community
    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. :(
     
  7. troester

    troester Well-Known Member Staff Member

    Level: Community
    For YesNO:
    in plugins\fabrik_element\yesno\yesno.php
    add after line 318 ($displayData->class = implode(' ', $this->gridClasses()['label']);)
    $displayData->class .= ' fabrikinput ';
     
  8. APursch

    APursch Member

    Level: Community
    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?
     
  9. troester

    troester Well-Known Member Staff Member

    Level: Community
    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?
     
  10. APursch

    APursch Member

    Level: Community
    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?
     
  11. APursch

    APursch Member

    Level: Community
    Actually, spoke too soon. Buttons all over the place in repeat rows, some both yes and no pre-selected.
     
  12. APursch

    APursch Member

    Level: Community
    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?
     
Thread Status:
Not open for further replies.

Share This Page