- This topic has 2 replies, 3 voices, and was last updated 9 years, 1 month ago by
Steve.
-
AuthorPosts
-
-
October 20, 2012 at 3:38 am #319
kattagamiMemberHello,
I maybe found a bug.
This is how I code my AddMore fields (it’s for a Setting page):
/*
Title: Plugins
Setting: katt-home-page
Tab: Left
Order: 21
*/piklist('field', array(
'type' => 'group',
'field' => 'katt_main_left_plugin_addmore',
'add_more' => true,
'label' => __('Plugin(s)'),
'description' => __('This is an example of how to build a list with multiple element types.'),
'fields' => array(array(
'type' => 'text',
'field' => 'katt_main_left_plugin_title',
'label' => 'Title',
'description' => 'Field Description',
'value' => 'Default text',
'columns' => 4,
),array(
'type' => 'select',
'field' => 'katt_main_left_plugin',
'label' => __('Select the plugins you want to be displayed'),
'description' => __('Lorem ipsum dolor sit amet, consectetur adipiscing elit.'),
'value' => '0',
'choices' => array(
'0' => 'No plugin',
'plugin_1' => 'Plugin 1',
'plugin_2' => 'Plugin 2',
'plugin_3' => 'Plugin 3',
),
'columns' => 4,
),)
));
When I fill the form, save the data for the first time and display the Array “katt_main_left_plugin_addmore” on the front page with a var_dump() function, this is what I obtain:
array(2) {
[0]=>
array(2) {
["katt_main_left_plugin_title"]=>
array(1) {
[0]=>
string(16) "Title plugin one"
}
["katt_main_left_plugin"]=>
array(1) {
[0]=>
string(8) "plugin_1"
}
}
[1]=>
array(2) {
["katt_main_left_plugin_title"]=>
array(1) {
[0]=>
string(16) "Title plugin two"
}
["katt_main_left_plugin"]=>
array(1) {
[0]=>
string(8) "plugin_2"
}
}
}
Three nested Arrays …
Ok, now if I save the data a second time whithout any change in the form, the var_dump() function displays this on the front page:
array(2) {
[0]=>
array(2) {
["katt_main_left_plugin_title"]=>
string(16) "Title plugin one"
["katt_main_left_plugin"]=>
string(8) "plugin_1"
}
[1]=>
array(2) {
["katt_main_left_plugin_title"]=>
string(16) "Title plugin two"
["katt_main_left_plugin"]=>
string(8) "plugin_2"
}
}
TWO nested Arrays !
Do I code something wrong or is it a bug ?
A precision, this appends when I have two or more “addMore” fields (when I duplicate the addMore fields by clicking on the “Add” button). If I fill the form and keep one “addMore” fields, I obtain two nested Arrays.
-
October 23, 2012 at 4:05 pm #337
KevinKeymaster@kattagami-
Thank you for your patience while we looked into this. At first we couldn’t recreate the problem, however today we found the exact steps to recreate it and it is indeed a bug with the add more javascript, we are working on this today and hope to have it patched for you tomorrow.
Thanks,
Kevin
-
December 13, 2012 at 12:53 pm #553
SteveKeymaster@kattagami- fixed in 0.7.1. Sorry it took so long.
-
-
AuthorPosts
- You must be logged in to reply to this topic.