WordPress / Learn

WordPress.org Learn - The canonical source for the code and content behind https://learn.WordPress.org
276 stars 101 forks source link

Links are broken on Courses page #2544

Closed samy closed 5 months ago

samy commented 5 months ago

Type of feedback

//content

Description

On Cours page, all courses links are broken

Step-by-step reproduction instructions (optional)

Screenshots or screen recording (optional)

Other information (optional)

clementpolito commented 5 months ago

Hi !

There is the same problem on lesson pages.

On the page https://learn.wordpress.org/course/introduction-to-block-development-build-your-first-custom-block/, the URL link of the lesson "What is a block? " is https://learn.wordpress.org/lecon/what-is-a-block/ ("lecon")but the good page is https://learn.wordpress.org/lesson/what-is-a-block/ ("lesson")

Test realized in private browsing mode, not connected to my WP.org account.

wp-course-lesson-url-bug

adamwoodnz commented 5 months ago

Hi, thanks for reporting. It is not like this for me:

Courses Course
Screenshot 2024-06-18 at 9 43 21 PM Screenshot 2024-06-18 at 9 42 56 PM

I'm wondering if the post type is being translated, I'm viewing the site in English, how about you?

clementpolito commented 5 months ago

Maybe I am on the french site, some texts are in french. But the URL does not contain fr subdomain. So I don't really know.

But I can say that the first 4 links "Developing with WordPress, Introduction to WordPress, Using the Site Editor, Contributing to WordPress points to /courses/ pages, while others links like "Introduction to Block Development: Build your first custom block", "Using the WordPress Data Layer", "A Developers Guide to Block Themes – Part 1", etc. in the same page point to /cours/.

CleanShot 2024-06-18 at 16 48 54

CleanShot 2024-06-18 at 16 53 27

mjaragon commented 5 months ago

This happened to me too.

When I'm in "My Courses" page: https://learn.wordpress.org/my-courses/

"Open Source Basics and WordPress" links to: https://learn.wordpress.org/kurs/open-source-basics-and-wordpress/

Which I think it's because based on my location (Germany), the browser shows me everything in German (de_DE).

image

If I switch the language to English (en_US)

https://learn.wordpress.org/my-courses/?locale=en_US , then the link works and goes to: https://learn.wordpress.org/course/open-source-basics-and-wordpress/

adamwoodnz commented 5 months ago

Maybe I am on the french site, some texts are in french. But the URL does not contain fr subdomain. So I don't really know.

Yes the site is definitely using French, I can tell from your screenshot, and if I switch to French I can reproduce.

But I can say that the first 4 links "Developing with WordPress, Introduction to WordPress, Using the Site Editor, Contributing to WordPress points to /courses/ pages, while others links like "Introduction to Block Development: Build your first custom block", "Using the WordPress Data Layer", "A Developers Guide to Block Themes – Part 1", etc. in the same page point to /cours/.

The first 4 links are just internal links on the page, so they match the current URL, while the others are permalinks, and appear to have the post type translated, which doesn't match what the site expects for routes.

samy commented 4 months ago

thanks @adamwoodnz