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

AvatarBrowserUploaderSaveService nests errors one level to deep #61

Open
kraftner opened this issue Nov 22, 2016 · 1 comment
Open

AvatarBrowserUploaderSaveService nests errors one level to deep #61

kraftner opened this issue Nov 22, 2016 · 1 comment
Assignees
Milestone

Comments

@kraftner
Copy link
Member

media_handle_upload() only returns one WP_Error object which then might contain multiple errors. So we shouldn't store this error as an array but as a plain object.

$this->error[] = $result;

should instead be

$this->error = $result;

Otherwise the error won't be displayed inside media_upload_form() as the filter returns an array containing a WP_Error instead of the object itself.

@franz-josef-kaiser
Copy link
Member

@kraftner Are you sure that there might not be previous errors? In case there are, it might be better to merge, push or append to the errors-array.

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

No branches or pull requests

2 participants