1. NOTICE: If you are using Fabrik and update to Joomla 3.10, you will need to update to Fabrik 3.10. And, if you are using Fabrik, do not upgrade to Joomla 4, we do not have a supported version ready for release. More information on a release date coming soon. Also, please note that Fabrik 3.10 will not install on any Joomla sites less than 3.8.
    Dismiss Notice

Birthdate element issue in repeat groups [bug]

Discussion in 'Community' started by trb, Oct 30, 2021.

  1. trb

    trb Member

    Level: Community
    Hi - I am using the birthday element in a repeating group. It works fine on the first group but does not seem to increment the repeat group number of the ID attribute for the second group. If I inspect the page html I see the following ID's for the three dropdowns.

    First Group:
    <div class="fabrikSubElementContainer" id="jos_form_18_repeat___dob_0">
    <select id="jos_form_18_repeat___dob_0_1" name="jos_form_18_repeat___dob[0][1]" class="input-small fabrikinput inputbox ">
    </select>
    /
    <select id="jos_form_18_repeat___dob_0_0" name="jos_form_18_repeat___dob[0][0]" class="input-small fabrikinput inputbox ">
    </select>
    /
    <select id="jos_form_18_repeat___dob_0_2" name="jos_form_18_repeat___dob[0][2]" class="input-small fabrikinput inputbox ">
    </select>
    </div>

    Second Group:
    <div class="fabrikSubElementContainer" id="jos_form_18_repeat___dob_1">
    <select id="jos_form_18_repeat___dob_0_1" name="jos_form_18_repeat___dob[1][1]" class="input-small fabrikinput inputbox ">
    </select>
    /
    <select id="jos_form_18_repeat___dob_0_0" name="jos_form_18_repeat___dob[1][0]" class="input-small fabrikinput inputbox ">
    </select>
    /
    <select id="jos_form_18_repeat___dob_0_2" name="jos_form_18_repeat___dob[1][2]" class="input-small fabrikinput inputbox ">
    </select>
    </div>

    This is causing a problem with some age calculation which relies on these dates. Can anyone confirm they are seeing the same thing and is this an issue with the birthday element?

    Thanks.
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    I can't replicate.
    Which Joomla and Fabrik version?
     
  3. trb

    trb Member

    Level: Community
    Hi Troester,

    Fabrik 3.9.2
    Joomla 3.9.28
     
  4. troester

    troester Well-Known Member Staff Member

    Level: Community
    As I said: on my site it's showing id=.._0_x and _1_x as expected.
    Any special settings?
    Same in frontend and backend?
     
  5. trb

    trb Member

    Level: Community
    Thanks for checking.

    I just checked and it appears correctly in the backend.... not sure what that tells me???

    For settings I have:
    List generation method: since years
    Number of years/ start year: 2008
    Years forward/backward: -4

    I have user javascript on the element which calls an age calculation.
    I have swapped the order of the dropdowns in fabrik-element-birthday-form.php - so instead of Day/Month/Year, it is Month/Day/Year

    The first group works fine and the dropdowns display Month/Day/Year the second dropdown shows Month/ /
    for the dropdowns. The options are still available it just that the labels for Month/Year do not display.

    Thank you for any pointers...
     
  6. trb

    trb Member

    Level: Community
    I've tried reverting the dropdown order back to its original Day/Month/Year with the same result.
    I've tried disabling the javascript calculation and also tried using the Beez template but still get the same behavior.
    I also tried this on a simpler form on another joomla installation running J3.9.11 and Fabrik 3.9 and get the same thing
    First repeat group works fine, the second one only shows Day/ / in the dropdowns and the ID does not increment with the repeat group. Thanks to your suggestion I can see it is correct in the backend....but can't see what could be the issue on the front???
     
  7. troester

    troester Well-Known Member Staff Member

    Level: Community
    Ok, I see it.
    It's only after adding new groups (before saving), names are incremented correctly and also the fabrikSubElementContainer id, but not the label for id, the sub-ids and not the fabrikElementContainer class "fb_el_...".
    After save (i.e. on the next pageload) all groups are incremented correctly.
    So the issue is somewhere in form.js...
     
  8. trb

    trb Member

    Level: Community
    Thanks for confirming you also see the issue Troester.

    For now, I have changed my code to use the name attribute which updates correctly in the repeat groups.
     
  9. trb

    trb Member

    Level: Community
    Hi - is there any official way to report this bug and hopefully get it resolved? It's easily and 100% reproducible and I'm sure if the right developer were to look at it, it could get fixed.
     

Share This Page