gocodebox / gocodebox/lifterlms

Invalid memberships when using the Restrict this page functionality

Open
#2,727 0 comments 0 reactions 1 assignee Assigned to @brianhogg View on GitHub
Dominant language
PHP
Stars
212
Forks
140
Avg merge
2d 14h
Merged PRs (30d)
19

Description

### Reproduction Steps

1. Create one or more memberships
2. Create a new page or edit an existing page
3. Turn on "Restrict this page" in the menu on the right
4. Select one or more memberships in the select box
5. Use the black "X" to remove memberships
6. Save
7. Select one membership
8. Save again
9. Refresh the page

### Expected Behavior

Only the one membership is shown

### Actual Behavior

Sometimes "None" shows as an option which then turns into " (ID#)" in the listing as a "phantom" membership. This can cause problems with restricting the access or showing an appropriate message when someone tries to access it who doesn't have access.

https://github.com/user-attachments/assets/8a31a0e1-aaec-433f-90b3-83f6d7fef4ab

### Tech Notes

It looks like these entries are saved as `""` (empty string) in the array of restricted IDs.

This issue has be recreated:
+ [ ] Locally
+ [ ] On a staging site
+ [ ] On a production website
+ [ ] With only LifterLMS and a default theme

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.