Support Forum
Support › MB Frontend Submission › Group "std" doesn't work on frontend ?Resolved
Hi,
is the "std" paramters of group filedtype is working with front end submission/edition, i can see it works on backend but i need it to work on front end, and it doesn't seems to do so :/
I've already tested rwmb_frontend_field_{attributes} (both query and hook), unsuccessfully.
Hope you can help on this
have a nice day,
Kevin
Hi Kevin, the std
param should work on both back end and front end. I added some docs on setting std
for groups a couple of days ago, please take a look.
Hi Anh,
i did, here's my code (set in fields, as i say, everything works fine on backend) :
thanks for your help
just to be sure i'm not missing anything, here's a pastebin
Sorry i wasn' t clear enough in my previous answer, it sill not working on front end, even with the code set up in the previous pastebin
Hi Kevin, I see the problem. Let me check and fix it.
Hi Anh, as far as i can get from now, by editing group-field.php child_field_std() function, i successfully show the array in the field, but i don't understand how to show them in two separate clone. any clue ?
protected static function child_field_std( $parent, $child, $meta ) {
// Respect 'std' value set in child field.
if ( ! empty( $child['std'] ) ) {
return $child['std'];
}
$meta = $parent['std'];
foreach($meta as $k => $v):
$std[$k] = $meta[$k][$child['id']] = $v[$child['id']];
endforeach;
// $meta contains $parent['std'] or clone's std.
//$std = isset( $meta[$child['id']] ) ? $meta[$child['id']] : '';
return $std;
}
thanks for your help,
K
ok, i finally get it,
in group-field.php, under the html() function, you have to check if $field['std'] isset or not
line 108 :
// Remove filter to child field meta value and reset class's parent field's meta.
if(!isset($field['std']))://ADD THIS
if ( empty( self::$meta_queue ) ) {
remove_filter( 'rwmb_field_meta', array( __CLASS__, 'child_field_meta' ) );
}
endif;//AND THIS
and all works fine now.
Hope these helps
Thanks
K
Hi Kevin,
Thanks a lot for your help. I was able to fix this issue another way and just released the version 1.3.6 of the plugin. Meta Box AIO and MB Core will be released later today.
Thanks Anh
have a nice day
K