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

Extract styles from referenced property to fix style compatibility for theme.json version 3 in learning mode #7660

Open
Imran92 opened this issue Aug 6, 2024 · 1 comment
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Pri] Normal Can wait for the next release [Status] Triaged Issue has been triaged [Type] Bug
Milestone

Comments

@Imran92
Copy link
Contributor

Imran92 commented Aug 6, 2024

Steps to Reproduce

  1. Install the assembler theme https://wordpress.com/theme/assembler
  2. Undo the changes in this PR manually Fix lesson loading error issue in learning mode for themes that are using referenced styles #7658
  3. Create a course with a lesson in it, make sure learning mode is enabled for that Course
  4. Now try to access the lesson as a student

What I Expected

The Lesson to load without issue

What Happened Instead

It throws an error like 8551277-zd-a8c

PHP / WordPress / Sensei LMS version

8.1/ 6.6.1/ 4.24.1

Browser / OS version

Any

Screenshot / Video

image

Context / Source

Source: 8551277-zd-a8c

Reason we found after investigation:

In theme.json version 3, it's possible to use a reference of a color from another json file instead of explicitly using the name of hexcode of a color. We can use a object with a ref property now. But this function here can only extract the style from from a string property. So to make LM lessons fully compatible with theme.json version 3 styles, we need to be able to extract this reference-type styles properly as well.

We've fixed the error throwing with a quick PR #7658 just so that lessons work even in this scenario. It prevents the error from happening. We'll handle the extraction of style under this issue.

Additional read: https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/theme-json-living/

image

@Imran92 Imran92 added [Type] Bug [Status] Needs Triage Issue needs to be triaged labels Aug 6, 2024
Copy link

github-actions bot commented Aug 6, 2024

Support References

This comment is automatically generated. Please do not edit it.

  • 8551277-zen

@github-actions github-actions bot added the Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". label Aug 6, 2024
@donnapep donnapep added this to the 4.24.3 milestone Aug 7, 2024
@donnapep donnapep added [Status] Triaged Issue has been triaged [Pri] Normal Can wait for the next release and removed [Status] Needs Triage Issue needs to be triaged labels Aug 7, 2024
@donnapep donnapep removed this from the 4.24.3 milestone Aug 22, 2024
@donnapep donnapep added this to the 4.24.4 milestone Oct 23, 2024
@donnapep donnapep modified the milestones: 4.24.4, 4.24.5 Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Pri] Normal Can wait for the next release [Status] Triaged Issue has been triaged [Type] Bug
Projects
None yet
Development

No branches or pull requests

2 participants