Home › Forums › Legacy Support › Support queries › Other issues › course pretty permalinks don't appear to work
- This topic has 12 replies, 4 voices, and was last updated 8 years, 6 months ago by H.K. Latiyan.
Viewing 13 posts - 1 through 13 (of 13 total)
-
AuthorPosts
-
April 19, 2016 at 8:40 pm #43830tamserSpectatorHi 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.April 19, 2016 at 8:43 pm #43832tamserSpectatorI also saved the Settings -> Permalinks many, many times :)April 20, 2016 at 7:50 am #43880H.K. LatiyanParticipantPlease 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.April 20, 2016 at 8:32 pm #44014tamserSpectatorI 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.April 22, 2016 at 1:15 pm #44310Anshuman SahuKeymasterWell 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 .April 22, 2016 at 4:02 pm #44394tamserSpectatorMy mistake! The permalinks DO work but render differently. If revert pretty permalinks is enabled then things work out nicely (http://screencast.com/t/xuoJfzRn).
- http://screencast.com/t/Ql6sWJHVPTOO (Admin Tab)
- http://screencast.com/t/V8rWZxoSg5OD (Drive Tab)
- http://screencast.com/t/EoVzMEYB (Events Tab)
- /course/COURSENAME/?action=admin&
- /course/COURSENAME/?action=drive&drive
- /course/COURSENAME/?action=events&events
- http://screencast.com/t/hUyP27MaTn81 (Events Tab)
- http://screencast.com/t/YNeTlKlH (Drive Tab)
- /course/COURSENAME/drive
- /course/COURSENAME/admin
April 23, 2016 at 1:34 pm #44556Anshuman SahuKeymasterI 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 .April 23, 2016 at 1:46 pm #44560tamserSpectatorHi. Please find the following screenshots:- http://screencast.com/t/woqOvzNIO (courses and quiz)
- http://screencast.com/t/Sk4nFl4wpc (unit and course action endpoints)
April 25, 2016 at 10:36 am #44732Anshuman SahuKeymasterOkay 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 .April 28, 2016 at 4:09 am #45219tamserSpectatorHi! I finally migrated to a staging site so you can check this out:- URL: https://the-bit.org/
- username: themesupport
- password: LtQT@qeZ&rnT
April 28, 2016 at 10:57 am #45293Anshuman SahuKeymasterI 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 .April 29, 2016 at 6:10 pm #45581Ravi Kiran KathaParticipantI 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 likeSELECT * 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 linereturn $vars;
of the methodVibe_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 KathaApril 30, 2016 at 7:49 am #45625H.K. LatiyanParticipant@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. -
AuthorPosts
Viewing 13 posts - 1 through 13 (of 13 total)
- The topic ‘course pretty permalinks don't appear to work’ is closed to new replies.