Sorting questions

This topic contains 23 replies, has 4 voices, and was last updated by  jotomas 4 years, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #511267

    Alex Rollin
    Moderator
    Post count: 27815

    Login credentials are no longer valid. Please update them so we can look into that issue. I cannot think of a sort that would/should show duplicates, so, there is something funny going on and we will find a solution for it.

    WordPress Credentials
    WP Admin Login URL:
    WP Admin Username:
    WP Admin Password:

    FTP Credentials
    FTP Host:
    FTP Port:
    FTP User:
    FTP Password:

    #511314

    jotomas
    Buyer
    Post count: 802
    This reply has been marked as private.
    #511510

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #511546

    Kiran
    Moderator
    Post count: 7069

    Hi Jotomas,

    I checked and found some strange behaviour in SQL query results. I tried to execute query directly in phpMyAdmin and on every refresh it changes the listings order among same package id. I checked on my test site but this not happening there.

    I have tested following query.

    
    
    SELECT SQL_CALC_FOUND_ROWS wp_posts.ID, wp_geodir_gd_ruta_tapes_detail.package_id
    FROM wp_posts
    LEFT JOIN wp_term_relationships
    ON (wp_posts.ID = wp_term_relationships.object_id)
    INNER JOIN wp_geodir_gd_ruta_tapes_detail
    ON (wp_geodir_gd_ruta_tapes_detail.post_id = wp_posts.ID) JOIN wp_icl_translations wpml_translations
    ON wp_posts.ID = wpml_translations.element_id
    AND wpml_translations.element_type = CONCAT('post_', wp_posts.post_type)
    WHERE 1=1
    AND ( wp_term_relationships.term_taxonomy_id IN (688) )
    AND wp_posts.post_type = 'gd_ruta_tapes'
    AND (wp_posts.post_status = 'publish'
    OR wp_posts.post_status = 'private'
    OR wp_posts.post_status = 'gd-expired')
    AND wp_posts.post_type = 'gd_ruta_tapes'
    GROUP BY wp_posts.ID
    ORDER BY wp_geodir_gd_ruta_tapes_detail.package_id desc
    LIMIT 0, 18

    On /a-taula/ page first 3 listings has package id 35 and rest have 21. So on every refresh it changes order of listings within package_ids.

    To fix this i have applied second lever sorting on your site via PHP snippet under Snippet > Listing Sorting.

    Now it shows correct listings.

    Please check and let us know.

    Best Regards,
    Kiran

    #511586

    jotomas
    Buyer
    Post count: 802

    Hi Kiran,

    Thank you very much for your reply.

    In fact, I did notice this behaviour “on every refresh it changes the listings order among same package id”, but as it has always been this way, I assumed from the beginning that it was the normal behaviour.

    I will check and I will let you know if I notice something strange.

    By the way, I noticed that you have put the snippet in the network admin dashboard. Is this correct or should it be put in the site admin dashboard?

    I look forward to your news.

    Thank you very much once again for your help.

    Best regards.

    #511588

    Kiran
    Moderator
    Post count: 7069

    I noticed that you have put the snippet in the network admin dashboard. Is this correct or should it be put in the site admin dashboard?

    I have added it to network dashboard to fix sorting on network wide. Both are correct either you can add it to site wide or network wide.

    Kiran

    #511599

    jotomas
    Buyer
    Post count: 802

    Hi Kiran,

    Ok, thank you very much.

    Do you think that the strange behaviour with sorting could be only specific to my site or could happen also with other sites? I mean, is this something that you will look at or should I keep the snippet forever?

    I look forward to your news.

    Thank you very much once again for your help.

    Best regards.

    #511603

    Kiran
    Moderator
    Post count: 7069

    I checked on my test site and i can’t replicate there, so it could be server specific. You keep that snippet on site where you see similar issue.

    Kiran

    #511617

    jotomas
    Buyer
    Post count: 802

    Hi Kiran,

    Ok, thanks a lot!

    Best regards.

Viewing 9 posts - 16 through 24 (of 24 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket