add fulcrm_collections as well

master
Marek Isalski 7 years ago
parent 22e8593d96
commit 0841e97501

@ -65,7 +65,10 @@ function fulcrm_collection_form_values_to_d( $prefix, $values ) {
foreach ( $values as $k => $v ) { foreach ( $values as $k => $v ) {
$bits = explode( '/fulcrm/', $k ); $bits = explode( '/fulcrm/', $k );
if ( ( count( $bits ) === 2 ) && ( $bits[ 0 ] === $prefix ) ) { if ( ( count( $bits ) === 2 ) && ( $bits[ 0 ] === $prefix ) ) {
fulcrm_collection_set_d_value( $d, $bits[ 1 ], $v ); if ( $bits[ 1 ] === 'fulcrm_collections' )
fulcrm_collection_set_d_value( $d, $bits[ 1 ], array( $v ) );
else
fulcrm_collection_set_d_value( $d, $bits[ 1 ], $v );
} }
} }
@ -110,5 +113,9 @@ function fulcrm_collection_to_form( $prefix, $collection_data, $d = array() ) {
} }
} }
$form[ $prefix . '/fulcrm/fulcrm_collections' ] = array( '#type' => 'hidden',
'#default_value' => $collection_data[ 's' ],
);
return $form; return $form;
} }

Loading…
Cancel
Save