]> saetta.ns0.it Git - zakform/cgi/commitdiff
Bootstrap version must be set for each elements of an array element.
authorAndrea Zagli <azagli@libero.it>
Tue, 13 Oct 2020 12:44:05 +0000 (14:44 +0200)
committerAndrea Zagli <azagli@libero.it>
Tue, 13 Oct 2020 12:44:05 +0000 (14:44 +0200)
src/form.c

index cc01b2d9bd1e9a587051f98ad890c1ab851d6001..92b202552570619a03901f4f393765bc963a122b 100644 (file)
@@ -344,6 +344,11 @@ zak_form_cgi_form_set_bootstrap_version (ZakFormCgiForm *zakcgiform, const gchar
 
        ZakFormCgiFormPrivate *priv;
 
+       GPtrArray *ar_ar_elems;
+       guint l;
+
+       ZakFormCgiFormElement *ar_element;
+
        priv = ZAK_FORM_CGI_FORM_GET_PRIVATE (zakcgiform);
 
        if (priv->bootstrap_version != NULL)
@@ -357,7 +362,20 @@ zak_form_cgi_form_set_bootstrap_version (ZakFormCgiForm *zakcgiform, const gchar
                {
                        ZakFormCgiFormElement *element = (ZakFormCgiFormElement *)g_ptr_array_index (priv->ar_elems, i);
 
-                       zak_form_cgi_form_element_set_bootstrap_version (element, priv->bootstrap_version);
+                       if (ZAK_FORM_IS_ELEMENT_ARRAY (element))
+                               {
+
+                                       ar_ar_elems = zak_form_element_array_get_elements (ZAK_FORM_ELEMENT (element));
+                                       for (l = 0; l < ar_ar_elems->len; l++)
+                                               {
+                                                       ar_element = (ZakFormCgiFormElement *)g_ptr_array_index (ar_ar_elems, l);
+                                                       zak_form_cgi_form_element_set_bootstrap_version (ar_element, priv->bootstrap_version);
+                                               }
+                               }
+                       else
+                               {
+                                       zak_form_cgi_form_element_set_bootstrap_version (element, priv->bootstrap_version);
+                               }
                }
 }