mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API Removed user_error when setting missing option on UploadField via setConfig. Added documentation to this function as a replacement for the check.
This commit is contained in:
parent
59fb88bec7
commit
96023079d5
@ -502,14 +502,13 @@ class UploadField extends FileField {
|
|||||||
/**
|
/**
|
||||||
* Assign a front-end config variable for the upload field
|
* Assign a front-end config variable for the upload field
|
||||||
*
|
*
|
||||||
|
* @see https://github.com/blueimp/jQuery-File-Upload/wiki/Options for the list of front end options available
|
||||||
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param mixed $val
|
* @param mixed $val
|
||||||
* @return UploadField self reference
|
* @return UploadField self reference
|
||||||
*/
|
*/
|
||||||
public function setConfig($key, $val) {
|
public function setConfig($key, $val) {
|
||||||
if(!array_key_exists($key, $this->ufConfig)) {
|
|
||||||
user_error("UploadField->setConfig called with invalid option: '$key'", E_USER_ERROR);
|
|
||||||
}
|
|
||||||
$this->ufConfig[$key] = $val;
|
$this->ufConfig[$key] = $val;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -517,13 +516,13 @@ class UploadField extends FileField {
|
|||||||
/**
|
/**
|
||||||
* Gets a front-end config variable for the upload field
|
* Gets a front-end config variable for the upload field
|
||||||
*
|
*
|
||||||
|
* @see https://github.com/blueimp/jQuery-File-Upload/wiki/Options for the list of front end options available
|
||||||
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function getConfig($key) {
|
public function getConfig($key) {
|
||||||
if(!array_key_exists($key, $this->ufConfig)) {
|
if(!isset($this->ufConfig[$key])) return null;
|
||||||
user_error("UploadField->getConfig called with invalid option: '$key'", E_USER_ERROR);
|
|
||||||
}
|
|
||||||
return $this->ufConfig[$key];
|
return $this->ufConfig[$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user