Support Forums

Looking for support? You can access the support system via your account.

Gnist Design

Forum Replies Created

Viewing 1 post (of 1 total)
  • Gnist Design in reply to:
    Filter order is wrong for Scandinavian characters
    #274982

    It does not respect the collation, which is set to utf8mb4_danish_ci.

    I had to use a filter to fix it:

    
    function sfp_sort_scandinavian( $input_object, $sfid ) {
    
    	if ( '_sfm_employees' === $input_object['name'] ) {
    
    		usort( $input_object['options'], function( $a, $b ) {
    			return strcmp( $a->value, $b->value );
    		});
    	}
    
    	return $input_object;
    }
    add_filter( 'sf_input_object_pre', 'sfp_sort_scandinavian', 10, 2 );
    
Viewing 1 post (of 1 total)