Automattic / sensei

Sensei LMS - Online Courses, Quizzes, & Learning
https://senseilms.com
GNU General Public License v2.0
539 stars 198 forks source link

The number in the beginning of the module slug is considered as the term owner ID (even if the user is a subscriber) #6145

Open merkushin opened 1 year ago

merkushin commented 1 year ago

The number in the beginning of the module slug is considered as the term owner ID (even if the user is a subscriber).

https://github.com/Automattic/sensei/blob/trunk/includes/class-sensei-modules.php#L2304

It is especially surprising that the user without any special permissions appears there.

Steps to Reproduce

  1. Go to 'Sensei LMS -> Modules'.
  2. Choose (or create) a module that doesn't have a teacher in parenthesis in the end. Click on Edit'
  3. Scroll down to 'Slug'. Add the number (it must be the ID of a subscriber; imagine, their name is "username") to the existing slug.
  4. Save changes and return to the module list.

What I Expected

I expected there will be no changes in the ownership of the term and it's title.

What Happened Instead

The string "(username)" added to the of the module name.

PHP / WordPress / Sensei LMS version

7.4.3/6.1.1/4.8.1

Browser / OS version

Chrome 107.0.5304.110/macOS 13.0.1

Screenshot / Video

https://user-images.githubusercontent.com/329356/202982443-36b48d00-c354-40dc-beab-fcbe8cc2c442.mp4

Context / Source

5717209-zd-woothemes

github-actions[bot] commented 1 year ago

Support References

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

danjjohnson commented 1 year ago

Also reported in 5850998-zen