• Resolved joppedi

    (@joppedi)


    Using EM version 5.6.6.1.
    I have made bookings-event-printable.php to sort the list’s person name alphabetically. But by some peculiar reason it places lower case letters AFTER capital letters! For example, lower case “a” is sorted after capital “Z”.

    In my attempts to solv this I have changed the table “wp_em_bookings” column “booking_meta” collation to charset “utf8mb4_swedish_ci”.
    This solved swedish letters åäö but not lower/capital letters.

    Perhaps there is a charset thas is case-sensitive?

    • This topic was modified 7 years, 10 months ago by joppedi.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    just to confirm, is this only happening on your bookings-event-printable.php ?

    Thread Starter joppedi

    (@joppedi)

    Yes.
    To be clear: I have not even tried to sort the attendees in the booking table for a single event in the admin-area. (E.g. the url ‘edit.php?post_type=event&page=events-manager-bookings&event_id=nnn’. I don’t know the php-page).
    The sorting on that page seems to be the time of order – at least not by the names.
    And I do not need to sort that list but I really want to order the bookings-event-printable.php in a way that makes it simple for the box office!

    • This reply was modified 7 years, 10 months ago by joppedi.

    This should help:
    http://pastebin.com/xVkLD7sT

    Thread Starter joppedi

    (@joppedi)

    Nope, caimin_nwl. I’ve already done that: “I have made… sort the list’s person name alphabetically”.
    The result is as I wrote it places lower case letters AFTER capital letters.

    • This reply was modified 7 years, 10 months ago by joppedi.

    You did’t mention that you’d used that code.

    Try changing this line

    asort($bookings);

    to

    natcasesort($bookings);

    http://php.net/manual/en/function.natcasesort.php

    Thread Starter joppedi

    (@joppedi)

    Sorry caimin_nwl, you are absolutly wright! I missed to tell you I used that snippet to sort alphabetically.
    I have also adjusted it to sort first ‘person_last_name’ and secondly ‘person_first_name’. Which work fine except for the lower case.

    Now I have tried ‘natcasesort($bookings);’ but that totally disorder everything.
    For exampel (Last_name, First name):

    Chmi, Pa
    asch, Jacob
    Åsch, Hacon
    Ösch, Åacob
    bsch, Jacob
    Sch, Jacob
    asch, acob

    This is not even the ID-order! Can’t figure out what sorting it does.
    Remember I use charset “utf8mb4_swedish_ci” if it matters.

    Perhaps solution is in the notes of that linked page of yours?
    E.g.:
    natcasesort($arr);
    $arr = array_values($arr);

    Can you post the version of the code you’re using?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Printable bookings: lower case “a” comes after capital “Z”’ is closed to new replies.