Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sensei Learning Mode not working in Assembler Theme #7659

Closed
tanjoymor opened this issue Aug 6, 2024 · 5 comments · Fixed by #7658
Closed

Sensei Learning Mode not working in Assembler Theme #7659

tanjoymor opened this issue Aug 6, 2024 · 5 comments · Fixed by #7658
Milestone

Comments

@tanjoymor
Copy link

tanjoymor commented Aug 6, 2024

Steps to Reproduce

  1. Create a course
  2. Make sure Learning Mode is turned on
  3. Switch to the Assembler theme
  4. View a lesson

What I Expected

To see the lesson content using the Learning Mode design

What Happened Instead

I got a blank page

PHP / WordPress / Sensei LMS version

I tested this on an Atomic site in WordPress.com.

Sensei Version 4.24.1

It also happens on a user's site with the Sensei Pro plugin Version 1.24.0

Browser / OS version

Tested in Chrome Version 127.0.6533.72
MacBook Pro Sonoma 14.5

Screenshot / Video

594MFEuB7mAqw2xufY20KlhCixlgCbCXdPdlvHEd.mp4

Context / Source

Turning off Learning Mode will display the lesson content.

Switching themes will display the content using Learning Mode properly.

I haven't tested multiple themes.

I don't know if this is a "Sensei" issue or an "Assembler theme" issue.

@tanjoymor
Copy link
Author

I've just tested additional themes.

This is also happening in:

  • Bark

Not happening in:

  • Courses
  • Hevor
  • Vows
  • Hey
  • Dark
  • Nook

@alaczek
Copy link

alaczek commented Aug 7, 2024

I tested and reproduced the issue with the Assembler theme. However, I don't have any insights so far - the output is totally blank, and there are no console errors on the front end (and everything works fine in the editor), so there's not much to go on. Maybe someone with Sensei experience can share some debugging ideas.

image

As a side note, it makes sense that the issue would be present in Bark, since it is based on the Assembler theme, which confirms theory it is indeed a theme issue.

@dsas
Copy link

dsas commented Aug 7, 2024

I get a fatal php error, so it looks like a Sensei issue to me. I wonder if:

  • These course-theme includes should be loaded for other themes like Assembler
  • Assembler does some colour stuff slightly differently because either it has a very limited palette by default or because it's an early adopter of the colour style variations. Regardless, Sensei needs to handle the difference without fataling.

@Automattic/nexus would you be able to look at this?

[07-Aug-2024 08:02:53 UTC] PHP Fatal error:  Uncaught TypeError: strncmp(): Argument #1 ($string1) must be of type string, array given in /wordpress/plugins/sensei-lms/4.24.1/includes/course-theme/class-sensei-course-theme-styles.php:198
Stack trace:
#0 /wordpress/plugins/sensei-lms/4.24.1/includes/course-theme/class-sensei-course-theme-styles.php(198): strncmp(Array, 'var:', 4)
#1 /wordpress/plugins/sensei-lms/4.24.1/includes/course-theme/class-sensei-course-theme-styles.php(159): Sensei_Course_Theme_Styles::get_property_value(Array)
#2 /wordpress/plugins/sensei-lms/4.24.1/includes/course-theme/class-sensei-course-theme-styles.php(66): Sensei_Course_Theme_Styles::format_css_variables(Array, '-global')
#3 /wordpress/core/6.6.1/wp-includes/class-wp-hook.php(324): Sensei_Course_Theme_Styles::output_global_styles_colors('')
#4 /wordpress/core/6.6.1/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#5 /wordpress/core/6.6.1/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#6 /wordpress/core/6.6.1/wp-includes/general-template.php(3065): do_action('wp_head')
#7 /wordpress/core/6.6.1/wp-includes/template-canvas.php(17): wp_head()
#8 /wordpress/core/6.6.1/wp-includes/template-loader.php(106): include('/wordpress/core...')
#9 /wordpress/core/6.6.1/wp-blog-header.php(19): require_once('/wordpress/core...')
#10 /wordpress/core/6.6.1/index.php(17): require('/wordpress/core...')
#11 {main}
  thrown in /wordpress/plugins/sensei-lms/4.24.1/includes/course-theme/class-sensei-course-theme-styles.php on line 198

@Imran92
Copy link
Contributor

Imran92 commented Aug 7, 2024

Hi @dsas and @tanjoymor 👋 I have already published a PR #7658 fixing it. It's already been approved and will hopefully be released tomorrow with our new Sensei release. So no worries.

In the meantime, before the release, a way around is to switch to another theme very temporarily. Thanks!

@tanjoymor
Copy link
Author

Thank you all so much! The customer is happy to wait a few days for the fix to be released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants