Title: Sort not functioning properly
Last modified: November 8, 2016

---

# Sort not functioning properly

 *  Resolved [codeward](https://wordpress.org/support/users/codeward/)
 * (@codeward)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/)
 * Hi there, was going through to find a fix, but this one eludes me.
 * After selecting a category/folder and the list shows; I select “Name” for example;
   whereas it should sort by name, but it reloads the page with “?mdocs-cat=” at
   the end of the url, but no category selected resulting in the default documents
   category being selected. I can manually add a category in the url (i.e.: ?mdocs-
   cat=PR-E), and it works until I switch categories; however I don’t see an everyday
   user thinking/knowing to do this.
 * I tried making a change to the mdocs-the-list.php (line 16-17), but didn’t seem
   to affect it so not sure if this is taking place elsewhere, or if it’s just not
   picking up the category/folder currently selected.
    -  This topic was modified 9 years, 6 months ago by [codeward](https://wordpress.org/support/users/codeward/).

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/sort-not-functioning-properly/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/sort-not-functioning-properly/page/2/?output_format=md)

 *  Thread Starter [codeward](https://wordpress.org/support/users/codeward/)
 * (@codeward)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/#post-8410643)
 * After checking a couple var dumps; it appears the $_GET[‘mdocs-cat’] is coming
   back NULL on load, then an empty string on sort causing it to default to mDocuments
   folder on sort.
 * Hope this helps.
 *  Thread Starter [codeward](https://wordpress.org/support/users/codeward/)
 * (@codeward)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/#post-8410726)
 * Took a look in mdocs-functions.php (line 471 & 472) “mdocs-cat=” is being added
   on to $permalink, which isn’t needed that I can see as the category isn’t added;
   resulting in the sort being broke and defaulting to mDocuments.
 * Let me know if this helps at all.
 * Cheers
 *  Plugin Author [bhaldie](https://wordpress.org/support/users/bhaldie/)
 * (@bhaldie)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/#post-8410820)
 * Im having trouble recreated the problem, have you made any setting changes to
   mdocs.
 *  Thread Starter [codeward](https://wordpress.org/support/users/codeward/)
 * (@codeward)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/#post-8410998)
 * The only setting I’ve changed myself was setting the Show File Names to False.
   
   Although reviewing the settings, I do see: Hide Sub Folders Category Page – [
   mdocs cat=”A Cat”], which is selected.. Would this be the culprit?
 *  Plugin Author [bhaldie](https://wordpress.org/support/users/bhaldie/)
 * (@bhaldie)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/#post-8411027)
 * No that wouldn’t cause any issues with the category not being passed. Can you
   run a browser debug and take a look at any of the sort buttons e.g. Name, Version
   etc. Inspect the element should look like this
 *     ```
       <th class="mdocs-sort-option" data-disable-user-sort="" data-sort-type="modified" data-current-cat="mdocs-cat-4" data-permalink="https://somewebsite.com/?mdocs-cat=mdocs-cat-4">Last Modified <i class="fa fa-chevron-down"></i></th>
       ```
   
 * look at the **data-permalink** tag and tell me what you see.
 *  Thread Starter [codeward](https://wordpress.org/support/users/codeward/)
 * (@codeward)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/#post-8411064)
 * data-permalink=”[https://somewebsite.com/?mdocs-cat=&#8221](https://somewebsite.com/?mdocs-cat=&#8221);
 * Is what I get back, I altered it to drop the ?mdocs-cat= to work for now, but
   I’m figuring that’ll probably introduce a bug or 2
 *  Thread Starter [codeward](https://wordpress.org/support/users/codeward/)
 * (@codeward)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/#post-8411151)
 * I did a var_dump on $_GET[‘mdocs_cat’] & just $_GET in mdocs-the-list, before
   and after it brings back the permalink, and it’s either null or empty. Null on
   page load, empty after clicking “name” to sort.
    So followed into mdocs-functions,
   and the mdocs_get_permalink doesn’t appear to populate..
 * var_dump($_GET);
    if(isset($_GET[‘mdocs-cat’])) $permalink = $permalink.$_GET[‘
   mdocs-cat’]; Result = Array(0) {}
 *  Plugin Author [bhaldie](https://wordpress.org/support/users/bhaldie/)
 * (@bhaldie)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/#post-8411232)
 * something is overriding the $_GET I’m not sure what, what other plugins are you
   running?
 *  Thread Starter [codeward](https://wordpress.org/support/users/codeward/)
 * (@codeward)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/#post-8411275)
 * I’ll have to check, we have another individual that’s been managing the plugins..
   I think there’s a few though
 *  Thread Starter [codeward](https://wordpress.org/support/users/codeward/)
 * (@codeward)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/#post-8411332)
 * Well, a few more than I thought…:
 * Add Categories to Pages
    Categorized Tag Cloud Custom Sidebars Divi Builder Feature
   a Page Widget Image Widget List category posts Memphis Documents Library Nav 
   Menu Roles PDF Embedder Premium PS Auto Sitemap Require Login SAML 2.0 Single
   Sign-On TinyMCE Advanced Transients Manager User Role Editor Widget Logic WonderPlugin
   Carousel WonderPlugin Gallery WonderPlugin Portfolio Grid Gallery WonderPlugin
   Tabs WordPress Popular Posts WPML Multilingual CMS
 * – And 2 custom in-house plugins
    Custom roles and capabilities -> Plugin to provide
   custom roles and capabilities for users Online Courses -> Displays and manages
   online course content.
 * According to the other person; the sort function was working prior to the most
   recent update of Memphis Docs.
 *  Plugin Author [bhaldie](https://wordpress.org/support/users/bhaldie/)
 * (@bhaldie)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/#post-8411380)
 * going back to this
 *     ```
       var_dump($_GET);
       if(isset($_GET[‘mdocs-cat’])) $permalink = $permalink.$_GET[‘mdocs-cat’];
       Result = Array(0) {}
       ```
   
 * the mdocs_get_permalink function is fine, it is return the proper value. the 
   heart of the problem is as you stated before the $_GET is returning null or ”
 * Can you tell me when you goto a folder for the first time what does the address
   look like? Does it have the ??mdocs-cat=some-cat
 *  Thread Starter [codeward](https://wordpress.org/support/users/codeward/)
 * (@codeward)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/#post-8411455)
 * No, the first time I go to a page it’s just:
    [https://websiteName.ca/pageName/](https://websiteName.ca/pageName/)
 * Then when I click Name to sort, it shows:
    [https://websiteName.ca/pageName/?mdocs-cat=](https://websiteName.ca/pageName/?mdocs-cat=)
 *  Plugin Author [bhaldie](https://wordpress.org/support/users/bhaldie/)
 * (@bhaldie)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/#post-8411527)
 * what i want to see is if you go to
 * [https://websiteName.ca/pageName/](https://websiteName.ca/pageName/)
 * then click on a subfolder, what is the url e.g.:
 * [https://websiteName.ca/pageName/?mdocs-cat=sub-page](https://websiteName.ca/pageName/?mdocs-cat=sub-page)
 *  Plugin Author [bhaldie](https://wordpress.org/support/users/bhaldie/)
 * (@bhaldie)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/#post-8411542)
 * okay i’ve found it finally!! I see what the issue is. When you create a shortcode
   of a subpage then when you click the “Name” button the page returns to the base
   page.
 * Now its just a matter of how I fix it.
 * Thanks for the report, and all the comments I will look into the issue now that
   I know how to recreate it and have a solution soon.
 *  Thread Starter [codeward](https://wordpress.org/support/users/codeward/)
 * (@codeward)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/#post-8411573)
 * Awesome, no problem, I’m glad to help.
 * What works for me is removing the “?mdocs-cat=” call altogether (in mdocs_get_permalink);
   but not sure the ramifications it has on the rest of the plugin…
 * I look forward to seeing how you fixed it; I’m semi-new to WordPress & modifying
   Plugins, so please forgive my ignorance.

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/sort-not-functioning-properly/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/sort-not-functioning-properly/page/2/?output_format=md)

The topic ‘Sort not functioning properly’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/memphis-documents-library_91918f.
   svg)
 * [Memphis Documents Library](https://wordpress.org/plugins/memphis-documents-library/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/memphis-documents-library/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/memphis-documents-library/)
 * [Active Topics](https://wordpress.org/support/plugin/memphis-documents-library/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/memphis-documents-library/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/memphis-documents-library/reviews/)

## Tags

 * [sort](https://wordpress.org/support/topic-tag/sort/)

 * 17 replies
 * 2 participants
 * Last reply from: [bhaldie](https://wordpress.org/support/users/bhaldie/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/sort-not-functioning-properly/page/2/#post-8416158)
 * Status: resolved