Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EDD_HTML_Elements::user_dropdown() assumes selected value isn't an array #8224

Closed
ashleyfae opened this issue Nov 25, 2020 · 0 comments · Fixed by #8226
Closed

EDD_HTML_Elements::user_dropdown() assumes selected value isn't an array #8224

ashleyfae opened this issue Nov 25, 2020 · 0 comments · Fixed by #8226
Labels
Milestone

Comments

@ashleyfae
Copy link
Contributor

Bug Report

Expected behavior

I expect to be able to use user_dropdown() and set selected to an array of user IDs. I expect this because it supports the multiple parameter, which allows you to select multiple users.

Actual behavior

When you pass in an array of user IDs you get this notice:

array_key_exists(): The first argument should be either a string or an integer

This is due to using array_key_exists() with $args['selected'] here: https://github.com/easydigitaldownloads/easy-digital-downloads/blob/master/includes/class-edd-html-elements.php#L343-L357 This fails if $args['selected'] is an array.

Steps to reproduce the behavior

  1. Install Discounts Pro.
  2. Create a discount and assign it to a user.
  3. Save.
  4. Notice triggers when the page refreshes.

Information (if a specific version is affected):

PHP Version:

EDD Version (or branch):

WordPress Version:

Any other relevant information:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants