fedenuche
Forum Replies Created
-
Hi guys, could you reproduce the error? Remember to create the modules inside the course edition page.
In addition to that, in the module order, I’m having the same problem.
I follow the code and I found this:
private function save_module( array $item ) { if ( $item['id'] ) { $term = get_term( $item['id'], 'module' ); $slug = $this->get_module_slug( $item['title'] );// <-- This line ...File: wp-content\plugins\sensei-lms\includes\class-sensei-course-structure.php
Function: private function save_module( array $item )When I have the module duplication the title for both modules is the same (see the attached image https://www.loom.com/i/9881744331e742c3a509959a868b8091). So the slug gets in the code above will be always the module for the eng version.
One possible solution is change this line:
$slug = $this->get_module_slug( $item['title'] );
For this one:
$slug = $term->slug;I hope this is useful.
I think that the module duplication occurs when you create a new module from the edit/create Korean course (in the “Course Modules” right box).
If I create the modules in the modules screen and after that, I go to the lesson screen and add those modules to the lesson it works as expected. And there isn’t module duplication.
@bluejay77 How did you create those Korean modules?
Hi @gaurav, I don’t have any “Synchronize metadata between translations” marked in my configuration. Did you create modules for your courses and assign those lessons to the modules? I think that the problem is with the modules.
I tried to figure out why this problem is happening and I think that the problem is with the module slug. So when you create a new module in Korean it creates two modules. One with the slug depending on the module name and the other with the same slug but adding the ko at the end (module1 and module1-ko). And I think that when you are ordering Sensei use the incorrect slug for the modules
In my screen recorded at 00:32, you can see four modules but I’ve just created two. So every module is used in the corresponding language (in English Sensei use “module1” and in Korean use “module1-ko”), but I think that the problem is when you are ordering in Korean (remember that in English works as expected) Sensei try to use the English version of the modules instead of corean. So when trying to get the new order for “module1” the result is empty and doesn’t change the order because is set for the “module1-ko”.
Sorry, I didn’t respond because I read “I’ve added this forum thread to the issue so the developers can take a look”.
In addition, I tried to remove the Classic Editor plugin but the issue is still there. About the Polylang adding the extra slug, that was my guess too. I’ve sent this issue to you because on your site you are recommending using Polylang or WPML (https://senseilms.com/documentation/translating-sensei-lms/) and if this is normal Polylang behavior, maybe you are interested in fixing it.
Thanks for your support, and let me know if I can help in any other way.
- This reply was modified 3 years, 12 months ago by fedenuche.
I think that the problem is with the modules. When I’m creating a new course in the Korean language I’ve created modules. As you can see in my video (0:31) there are 4 modules but I only created two. I think that when you add a new module in a foreign language Sensei adds the lang iso at the end. In my example, I created the “module1” from the Korean course, and this action automatically creates two modules. One with the slug “module1” and the other with “module1-ko”. So I think that the lesson is added in the module “module1-ko” but when you save the order Sensei is trying to use the “module1”.
In addition to that, I followed the source code and applied a quick fix. I’m sending my solution to see if this is helpful for you.
File: plugins\sensei-lms\includes\class-sensei-course-structure.php
Function: get_module_slug
Line: 421private function get_module_slug( $title ) { $teacher_user_id = get_post( $this->course_id )->post_author; $lang = ''; if(is_polylang_active()) { $aux_lang = pll_get_post_language($this->course_id, 'slug'); if($aux_lang != pll_default_language()) { $lang = $aux_lang; } } return sanitize_title( $title ).'-'.$lang; /*return user_can( $teacher_user_id, 'manage_options' ) ? sanitize_title( $title ) : intval( $teacher_user_id ) . '-' . sanitize_title( $title );*/ }- This reply was modified 4 years ago by fedenuche.
Thanks for your reply. I’m sending the screen recording.
You are the best!
Did you see this issue? Did my regex help?
Forum: Plugins
In reply to: [PDF.js Viewer] Internal Server ErrorAnother contribution, I hope this will be helpful.
I have installed a security plugin (iThemes Security). So When I’m logged in, the plugin works great. But If I’m not, it returns 403 error (this is because an .htaccess rule). To fix that I just change the line “$final_url” for:
$final_url = $viewer_base_url."?file=".urlencode ($file_name)."&download=".$download."&print=".$print."&openfile=".$openfile;(Just add the “urlencode”)
Same here.
In addition, I checked the data base value “suckerfish_depthpages” and it doesn’t change when update the options from the wpadmin. I tried to change that manually but it didn’t work neither.Forum: Plugins
In reply to: [Social Login] [Plugin: Social Login] customize provider imagesmay be it helps you http://www.w3schools.com/css/css_image_sprites.asp