When creating a new code, I am unable to set maximum uses to 0 (unlimited), the code just defaults to one use. Non-zero max uses work just fine.

CommentFileSizeAuthor
#1 regcode_758476.patch463 byteshadsie

Comments

hadsie’s picture

Version: 6.x-2.0 » 6.x-2.x-dev
Component: User interface » Code
Category: support » bug
Status: Active » Needs review
StatusFileSize
new463 bytes

I think this is caused because the code is running this when it saves to the database:
empty($code->maxuses) ? 1 : (int) $code->maxuses

empty will return TRUE if maxuses is 0. isset should be used instead. I've attached a patch that fixes the problem and is working for me.

aidanlis’s picture

Status: Needs review » Fixed

Thanks for fixing this and sorry for the delay in replying.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.