mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
Merge pull request #6 from tractorcow/3.0-set-option-failure-fix
BUG Error setting options on Null defaults
This commit is contained in:
commit
beb1d46aa6
@ -53,21 +53,22 @@ class GridFieldBulkImageUpload implements GridField_HTMLProvider, GridField_URLH
|
|||||||
*/
|
*/
|
||||||
function setConfig ( $reference, $value )
|
function setConfig ( $reference, $value )
|
||||||
{
|
{
|
||||||
if ( isset( $this->config[$reference] ) )
|
if (!key_exists($reference, $this->config) ) {
|
||||||
{
|
user_error("Unknown option reference: $reference", E_USER_ERROR);
|
||||||
if ( ($reference == 'fieldsClassBlacklist' || $reference == 'fieldsClassBlacklist' || $reference == 'editableFields') && !is_array($value) )
|
|
||||||
{
|
|
||||||
$value = array($value);
|
|
||||||
}
|
|
||||||
|
|
||||||
//makes sure $forbiddenFieldsClasses are in no matter what
|
|
||||||
if ( $reference == 'fieldsClassBlacklist' )
|
|
||||||
{
|
|
||||||
$value = array_unique( array_merge($value, $this->forbiddenFieldsClasses) );
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->config[$reference] = $value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ($reference == 'fieldsClassBlacklist' || $reference == 'fieldsClassBlacklist' || $reference == 'editableFields') && !is_array($value) )
|
||||||
|
{
|
||||||
|
$value = array($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
//makes sure $forbiddenFieldsClasses are in no matter what
|
||||||
|
if ( $reference == 'fieldsClassBlacklist' )
|
||||||
|
{
|
||||||
|
$value = array_unique( array_merge($value, $this->forbiddenFieldsClasses) );
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->config[$reference] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,21 +44,22 @@ class GridFieldBulkManager implements GridField_HTMLProvider, GridField_ColumnPr
|
|||||||
*/
|
*/
|
||||||
function setConfig ( $reference, $value )
|
function setConfig ( $reference, $value )
|
||||||
{
|
{
|
||||||
if ( isset( $this->config[$reference] ) )
|
if (!key_exists($reference, $this->config) ) {
|
||||||
{
|
user_error("Unknown option reference: $reference", E_USER_ERROR);
|
||||||
if ( ($reference == 'fieldsClassBlacklist' || $reference == 'fieldsClassBlacklist' || $reference == 'editableFields') && !is_array($value) )
|
|
||||||
{
|
|
||||||
$value = array($value);
|
|
||||||
}
|
|
||||||
|
|
||||||
//makes sure $forbiddenFieldsClasses are in no matter what
|
|
||||||
if ( $reference == 'fieldsClassBlacklist' )
|
|
||||||
{
|
|
||||||
$value = array_unique( array_merge($value, $this->forbiddenFieldsClasses) );
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->config[$reference] = $value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ($reference == 'fieldsClassBlacklist' || $reference == 'fieldsClassBlacklist' || $reference == 'editableFields') && !is_array($value) )
|
||||||
|
{
|
||||||
|
$value = array($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
//makes sure $forbiddenFieldsClasses are in no matter what
|
||||||
|
if ( $reference == 'fieldsClassBlacklist' )
|
||||||
|
{
|
||||||
|
$value = array_unique( array_merge($value, $this->forbiddenFieldsClasses) );
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->config[$reference] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user