Support » Plugin: WP Google Maps » Bug: Marker Listing Ordered by Title Doesn’t Handle Numbers Correctly

  • Resolved KZeni

    (@kzeni)


    It appears that the “Order markers by” setting in the Marker Listing options for a map isn’t working correctly when ordered by “Title” for the Carousel mode, if not the others as well. It’s mishandling numbers.

    For example, I have:

    • Item 1
    • Item 2
    • Item 3
    • Item 3a
    • Item 4
    • Item 5
    • Item 6
    • Item 7
    • Item 8
    • Item 9
    • Item 10
    • Item 11
    • Item 12

    as items in my map.

    However, ordering the items in the marker list (for the Carousel, at the very least) by Title has the following be output:

    • Item 1
    • Item 10
    • Item 11
    • Item 12
    • Item 2
    • Item 3
    • Item 3a
    • Item 4
    • Item 5
    • Item 6
    • Item 7
    • Item 8
    • Item 9

    You can clearly see what’s wrong here.

    I’m guessing the sort that’s being performed is comparing one character at a time (making the 1 in 1 and 10-12 be next to each other) rather than checking for full/proper alphanumeric sorting (obviously having it count as one would expect.)

    It seems like the fix might be to use natcasesort() (https://www.php.net/manual/en/function.natcasesort.php) for this so natural sorting (proper alphanumeric handling instead of “standard” sort() sorting) that’s case-insensitive (I don’t think capitalization should alter the position of an item when sorting by title) is performed.

    • This topic was modified 4 months ago by KZeni. Reason: Detailed a method to potentially fix the issue
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support stevendebeer

    (@stevendebeer)

    Hi @kzeni

    Thank you for taking the time to get in touch, we do appreciate your time.

    Unfortunately, these forums are reserved for support to users of our base plugin only, meaning we are not allowed to provide any Premium support here, as per the WordPress.org guidelines.

    As your question is related to our Pro add-on, I will need to ask you to reach out to us on our website instead, via the following link: https://www.wpgmaps.com/contact-us/ – One of our support agents will gladly assist you with your issue as soon as possible.

    Please note, this topic will be marked as resolved as it is related to our Premium add-on which we do not provide support for via these forums as mentioned above.

    Thread Starter KZeni

    (@kzeni)

    Alrighty! I’ve reached out via https://www.wpgmaps.com/contact-us/ regarding this, and I’ve closed this support thread as the rest of this discussion will likely happen there & really should be a straightforward fix that likely won’t need much to be discussed where a new version can be released with this bug having been fixed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.