course pretty permalinks don't appear to work

Home Forums Legacy Support Support queries Other issues course pretty permalinks don't appear to work

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #43830
    tamser
    Spectator
    Hi there. I have a local installation of WPLMS and I can't get the pretty permalinks to work. Is it a problem on my end? If I enable "LMS -> settings -> general -> revert pretty permalinks" then it works. Please advise.
    #43832
    tamser
    Spectator
    I also saved the Settings -> Permalinks many, many times :)
    #43880
    H.K. Latiyan
    Participant
    Please clarify if you are using this tip: https://wplms.io/support/knowledge-base/changing-slugs-in-wplms/ And you mean your default slugs i.e. /admin ,  /curriculum  ,  /events  , etc permalinks are not working and only the revert permalinks works. Yes there are few setups where the new permalinks do not work, the issue is not quite clear why this happens but it happens only on some particular setups.
    #44014
    tamser
    Spectator
    I am not using the tip you specified above. So, I guess it is still unclear why it happens. If it helps, I am using XAMPP and PHP 7.0.4 and testing on win10 x64 localhost before going live. Thanks.
    #44310
    Anshuman Sahu
    Keymaster
    Well these are just working fine at all our test and demo sites . Please check if you have saved the course permalink correctly . Please disable the "Revert pretty permalinks" form lms -> settings and then save permalinks and clear browser cache . also the default permalinks must be set to the postname . One more thing : The course links like activity admin submissions will only work if the course is published . Please check that you course is published form back end course edit screen .
    #44394
    tamser
    Spectator
    My mistake! The permalinks DO work but render differently. If revert pretty permalinks is enabled then things work out nicely (http://screencast.com/t/xuoJfzRn). URLs for the above show up as:
    • /course/COURSENAME/?action=admin&
    • /course/COURSENAME/?action=drive&drive
    • /course/COURSENAME/?action=events&events
    If "revert pretty permalinks" is disabled, then the tabs don't display as nicely: Additionally, I noticed that the URLs show up as:
    • /course/COURSENAME/drive
    • /course/COURSENAME/admin
    Curiously both have the "edit course" with the "?action=POSTID"
    #44556
    Anshuman Sahu
    Keymaster
    I checked the videos . You case is the case when the permalinks does not works correctly . Revert pretty permalinks is a fallback option that we have provided when the pretty permalinks does not works . Can you please share a screenshot of your settings -> permalinks screen? Specially the course permalinks. Please also make sure that there is no page with the slug same as course,quiz ,assignments .drive ,events etc .
    #44560
    tamser
    Spectator
    Hi. Please find the following screenshots: No matter how many times I save the permalinks, the "unit permalinks" radio button doesn't get selected. Thanks
    #44732
    Anshuman Sahu
    Keymaster
    Okay please check if you have created any page with slug same as " unit " or "course" .If any then please trash and then delete em. If above does not fix the issues then i would be needing your site as live along with admin credentials and site url  to check this .
    #45219
    tamser
    Spectator
    Hi! I finally migrated to a staging site so you can check this out: Thanks!
    #45293
    Anshuman Sahu
    Keymaster
    I checked your site but was not able to detect the problem . The last thing you can do is to try deactivating third party plugins and then re-save permalinks and check the issue again . This is working on all of our test and demo sites and most of the user . this might also be a problem from your webhost . Please refer : http://codex.wordpress.org/Using_Permalinks#Using_.22Pretty.22_permalinks in the above there are some of the server requirements to run pretty permalinks . Please confirm if these are ok with your webhost .
    #45581
    Ravi Kiran Katha
    Participant
    I have the same problem on my site too. After searching the forums for a solution, I ran all of the tips provided but none worked. I debugged the whole issue and worked on a fix for the issue. The fix is in the vibe-customtypes plugin (vibe-customtypes\includes\permalinks.php => Vibe_CustomTypes_Permalinks::filter_request method). I still do not know the reason for the issue, but this might be useful to somebody like me.   Observations My course curriculum permalink setting => "/curriculum" Invoked url => "/course/dotnet/curriculum/" When filter_request filter was called, the $vars contained something like
    (
    [attachment] => dotnet
    [curriculum] =>
    )
    I guess the course name 'dotnet' was translated as an attachment. When the filter_request returned, the $vars is like
    (
    [attachment] => dotnet
    [curriculum] => 1
    [curriculum_slug] => 1
    )
    This returned vars are translated by the wp_query object into something like SELECT * from wp_post WHERE post_type = 'attachment' AND post_name = 'dotnet' which returned 0 records. This empty posts result got converted into a 404 by the wordpress core functions. This 404 in turn got converted into the course permalink "<strong style="line-height: 1.5;">/course/dotnet/<span style="line-height: 1.5;">" (skipping the "curriculum" part) inside "wp-includes/canonical.php" which redirected my request to the course page.</span>   Fix The last line return $vars; of the method Vibe_CustomTypes_Permalinks::filter_request method in the above mentioned file has to be replaced with the following code.
    $attachment = $vars['attachment'];
    if ( ! empty ( $attachment ) && ! isset( $vars['name'] ) && ! isset( $vars['post_type'] ) ) {
    $course_slug_names = array(
    'curriculum_slug',
    'members_slug',
    'activity_slug',
    'admin_slug',
    'submissions_slug',
    'stats_slug',
    'course_category_base',
    'events_slug',
    'drive_slug'
    );
    foreach ( $course_slug_names as $course_slug_name ) {
    $slug_value = str_replace( '/', '', $this->permalinks[ $course_slug_name ] );
    if ( isset( $vars[ $slug_value ] ) ) {
    unset ( $vars['attachment'] );
    $vars['post_type'] = 'course';
    $vars['name'] = $attachment;
    break;
    }
    }
    }
    return $vars;
    Once I updated this code in my plugin files, all course permalinks started working fine. I still do not know why this issue happens and why that 'attachment' property in the $vars exists and how to deal with it. May be the authors of the plugin can check this fix, modify it to cover all possible cases and investigate this issue further. Thanks & Regards Ravi Kiran Katha
    #45625
    H.K. Latiyan
    Participant
    @ravikatha: Thanks for this observation, we will test it on other websites with this issue. After testing, if the fix works for all websites then only we will include this in the update of vibe customtypes.
Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘course pretty permalinks don't appear to work’ is closed to new replies.