Skip to content

Conversation

jorisvaesen
Copy link
Collaborator

Fix for #371

continue;
}

$settings = is_array($settings) ? $settings : [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not properly setup the settings in the initialize?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was thinking the same, just like Hash::normalize too much :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So after the Hash::normalize() call, detect an invalid config and fix it :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, we'd better loop the config ourselfs, otherwise it's doing the job twice. RIP Hash::normalize.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 3159ae6 on jorisvaesen:master into ea42c77 on josegonzalez:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling d26494a on jorisvaesen:master into ea42c77 on josegonzalez:master.

@oktomus
Copy link

oktomus commented Jan 17, 2017

The error is till happening for me. I'm using 3.6.2 version.

Error :
InvalidArgumentException: Invalid data type, must be an array or \ArrayAccess instance.

This works :

$this->addBehavior('Josegonzalez/Upload.Upload', [
	   'thumbnail' => [], 
	]);

This doesn't work :

$this->addBehavior('Josegonzalez/Upload.Upload', [
	   'thumbnail'
	]);

Stacktrace :
Stacktrace

Should I open a new issue ?

@josegonzalez
Copy link
Member

@KevinMasson mind filing an issue?

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

Successfully merging this pull request may close these issues.

4 participants