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

AssetAdmin does not report any _unexpected_ errors, and just stops. #708

Closed
NightJar opened this issue Dec 12, 2017 · 3 comments
Closed

Comments

@NightJar
Copy link
Contributor

SilverStripe\Assets\Upload_Validator::validate runs a series of checks and returns false if one fails (true otherwise).
This appears to work reasonably well in common use cases (such as a file being over the legal limit as such), however does not if for example we have a custom rule. The file is sent off, and a perfectly valid response is sent back, however there is precisely zero feedback from the AssetAdmin, and it refuses to do any more business with invalid (or sometimes valid) uploads.

@unclecheese advises me that the current checks in Upload_Validator are recreated and performed on the client side. Simply prepending the validate method with

$this->errors[] = 'Test bad response';
return false;

is enough to hack in an always repeatable occurrence of the error.

tl;dr AsssetAdmin ignores all server side validation errors.

@unclecheese
Copy link

Resolved here: #709

@tractorcow tractorcow self-assigned this Dec 13, 2017
@tractorcow
Copy link
Contributor

I'm reviewing the fix.

@tractorcow tractorcow removed their assignment Dec 13, 2017
@tractorcow
Copy link
Contributor

The fix is good and can be merged on green.

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

3 participants