1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

PHP plugin does not work on repeating group form?

Discussion in 'Community' started by AlfredJK, Jul 6, 2019.

  1. AlfredJK

    AlfredJK Member

    Level: Community
    Hi, i try to trigger a php plugin on a form that's part of a repeating group. But it seems that this is not working.

    my situation:

    Main form with 2 left joins
    I try to launch a php trigger on the form of the 2e join. Unfortunately nothing happens. I tried it on several triggers.
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    Not sure what you mean with
    There's no "form of the 2e join" and no "form that's part of a repeating group".
    A repeating group is part of a form - your main form (not vice versa) - and you must add the php plugin to this main form.
     
  3. AlfredJK

    AlfredJK Member

    Level: Community
    okay - i implemented the php plugin on the main form. That works fine :) The php generates a unique key. On the first iteration of the repeating group the key is filled on the right place in the form. When i push the plus button to get a second record in that group i hoped that the php plugin would launch again. To get a new unique key.
     
  4. troester

    troester Well-Known Member Staff Member

    Level: Community
    What did you select as "Process script"? I don't think there's a hook you can use "on Create Group".
     
    Last edited: Jul 6, 2019
  5. AlfredJK

    AlfredJK Member

    Level: Community
    Hi Troester, i tried it on 'OnCanEditGroup' but that doesn't work. I searched for the 'OnCreateGroup':) That would help. Maybe a new feature in the next version?
     
  6. troester

    troester Well-Known Member Staff Member

    Level: Community
    'OnCanEditGroup' is related to group access settings (e.g. the complete repeated group).

    Additional "groups" inside a repeated groups are created via JS (so it seems there's no "new" default php calculation).
     
  7. AlfredJK

    AlfredJK Member

    Level: Community
    that's a pity, but thanks for your answers and help!
     
  8. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    You could do it yourself, using the 'fabrik.form.group.duplicate.end' JS event, then do an AJAX call to the server to generate the key (unless you can do the same thing in JS), and poke the value into the element on the page directly.

    -- hugh
     
  9. AlfredJK

    AlfredJK Member

    Level: Community
    :) Thanks!
     

Share This Page