• Resolved codeward

    (@codeward)


    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 8 years, 4 months ago by codeward.
Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter codeward

    (@codeward)

    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

    (@codeward)

    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

    (@bhaldie)

    Im having trouble recreated the problem, have you made any setting changes to mdocs.

    Thread Starter codeward

    (@codeward)

    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

    (@bhaldie)

    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

    (@codeward)

    data-permalink=”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

    (@codeward)

    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

    (@bhaldie)

    something is overriding the $_GET I’m not sure what, what other plugins are you running?

    Thread Starter codeward

    (@codeward)

    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

    (@codeward)

    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

    (@bhaldie)

    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

    (@codeward)

    No, the first time I go to a page it’s just:
    https://websiteName.ca/pageName/

    Then when I click Name to sort, it shows:
    https://websiteName.ca/pageName/?mdocs-cat=

    Plugin Author bhaldie

    (@bhaldie)

    what i want to see is if you go to

    https://websiteName.ca/pageName/

    then click on a subfolder, what is the url e.g.:

    https://websiteName.ca/pageName/?mdocs-cat=sub-page

    Plugin Author bhaldie

    (@bhaldie)

    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

    (@codeward)

    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)
  • The topic ‘Sort not functioning properly’ is closed to new replies.