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

Minimum count of repeat group not taken into account

Discussion in 'Professional Support' started by jfquestiaux, Jun 12, 2018.

  1. jfquestiaux

    jfquestiaux Well-Known Member

    Level: Community
    Hi,
    About 2 weeks ago, I updated Fabrik from the latest gitHub and since then I have the following problem:

    In a form (with tab templates), I have 2 repeatable groups, with "repeat mini" set to 0, as I don't want them showing on load.

    After the update, I see that now I have 1 group showing instead of 0, which is bad because there is a validation on one of the field and the form does not submit anymore, except if you remove the 2 groups.

    So it seems that "repeat mini" does not work anymore.
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    Is it also with the bootstrap template?
    Do you get a JS error ? (there's always one group created and then deleted if min=0)
     
  3. jfquestiaux

    jfquestiaux Well-Known Member

    Level: Community
    Well there is something strange: on load, there is no JS error, nor if you delete the group that is present.
    However, if you add a second group, then delete it, you get a JS error:


    jquery.min.js?cbf0d375c9067dc2b3de8435b466c825:2 Uncaught Error: Syntax error, unrecognized expression: input[name=fabrik_deletedimages[17]]
    at Function.fa.error (jquery.min.js?cbf0d375c9067dc2b3de8435b466c825:2)
    at fa.tokenize (jquery.min.js?cbf0d375c9067dc2b3de8435b466c825:2)
    at Function.fa (jquery.min.js?cbf0d375c9067dc2b3de8435b466c825:2)
    at Function.a.find (jquery-migrate.min.js?cbf0d375c9067dc2b3de8435b466c825:2)
    at a.fn.init.find (jquery.min.js?cbf0d375c9067dc2b3de8435b466c825:2)
    at a.fn.init.a.fn.find (jquery-migrate.min.js?cbf0d375c9067dc2b3de8435b466c825:2)
    at CloneObject.decloned (fileupload-min.js:3)
    at CloneObject.e.extend.$owner (mootools-core.js?cbf0d375c9067dc2b3de8435b466c825:38)
    at Object.<anonymous> (form.js:3)
    at Function.<anonymous> (mootools-core.js?cbf0d375c9067dc2b3de8435b466c825:9)

    It's a custom template. I will check later with the bootstrap one (this is a live site and they are working now).
     
  4. troester

    troester Well-Known Member Staff Member

    Level: Community
    You can test locally by appending &layout=bootstrap (at least if there's no template set in the menu item)

    I justed tested, there's a strange thing with repeat group min=0 and validations (tested in the backend with bootstrap and bootstrap_tabs):
    If you add one group and then save with a validation error (somewhere in the form, not necessarily in this repeat group) the group is showing up and then deleted ("no data").
    It's ok if there are at least 2 group entries.

    Edit: which is an old issue
    http://fabrikar.com/forums/index.ph...h-min-0-is-deleted-on-validation-error.45380/
     
    Last edited: Jun 13, 2018
  5. jfquestiaux

    jfquestiaux Well-Known Member

    Level: Community
    I tested it with the bootstrap template and I have the same result : 1 group showing on load and no JS error - adding and deleting a second group is causing a JS error.
     
  6. troester

    troester Well-Known Member Staff Member

    Level: Community
    Following your error messages:
    Is there a fileupload in the repeat group? standard, ajax upload?
    Anything else like form in a popup, ajax validation, ...?
     
  7. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Tbh, I think that fabrik_deletedimages thing isn't needed any more. I can't find any other reference to that input name anywhere, except in the decloned() method (which is where it's erroring out in your site) ... so at some point it was looking for an input of that name when deleting a group, and adding whatever was in it to the fabrik_fileupload_deletedfile[] input ... which is where we put filenames after the "confirm you want to hard delete this file from the server" prompt ... but as far as I can tell, 'fabrik_deletedimages' just doesn't exist and isn't used anywhere any more.

    However, that seems to be a separate problem to the one Troester is describing with the min=0 and validations.

    I'll see if I can replicate that.

    -- hugh
     
  8. jfquestiaux

    jfquestiaux Well-Known Member

    Level: Community
    @troester
    There are only a normal fileupload (no ajax, but storage on S3, although I don't think it's related). and a basic field element.
    However, these groups (there are 2 of them on the form) are joined repeated groups (left join) from other lists. Maybe this has a relation.
    So to be clear, I have:
    List A, with group A)
    List B, with group B)
    List C, with group C, group A repeatable, group B repeatable

    It the form C that has the issue.
     
  9. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I don't seem to be able to replicate this, can you point me at your form, and enable Fabrik debug so I can get uncompressed JS.

    -- hugh
     
  10. Borox

    Borox Member

    Level: Community
    Hi,

    I had the same problem, even with 0 as minimum for a repeated group, after a 'Save', a record was created in this group!
    It was happening only on a specific group, it was working for others ( on other forms)!
    I deleted the join on the list and created it again and now, with 0 as minimu, no more record created in the group, it works again!

    Nicolas
     
    cheesegrits likes this.

Share This Page