gocodebox / lifterlms-rest

LifterLMS REST API Feature Plugin
6 stars 7 forks source link

access plan `availability_restrictions` property never returned #269

Closed thomasplevy closed 2 years ago

thomasplevy commented 2 years ago

Reproduction Steps

Expected Behavior

Actual Behavior


Looks like the error is here:

https://github.com/gocodebox/lifterlms-rest/blob/a3a644da3edd10d923e967fe0b6244606d3d1f5f/includes/server/class-llms-rest-access-plans-controller.php#L278

the empty array is in the wrong position on the ternary

Also after the above is corrected, ideally an array of ints should be returned instead of an array of strings

thomasplevy commented 2 years ago

@eri-trabiccolo I've already confirmed this and written a quick fix locally so I'm not blocked but this could be cleaned up sooner than later for release with the other access plan bug you already fixed

eri-trabiccolo commented 2 years ago

@thomasplevy

Agreed?

thomasplevy commented 2 years ago

I think this makes sense @eri-trabiccolo. The property barely seems necessary today and really seems unnecessary with what I'm building right now. So keeping it as you have for backwards compatibility purposes but not requiring users to have to actually update it via REST feels good.

I don't want to take the time to properly deprecated it right now but we can phase out it's usefulness and maybe remove it officially alongside the release of the react stuff I'm working on