Problem/Motivation
While trying to write a feature, there is a check to ensure something has been selected to be exported.
In the case where nothing has been selected, the following failure is generated:
$this->failure($return, $package, NULL, t('No configuration was selected to be exported.'));
The problem is that the failure() method awaits for an Exception object an get NULL. I thought it was OK but it seems that it's not.
Proposed resolution
Two solutions available:
- Pass an
Exceptionto thefailure()method
$this->failure($return, $package, new \Exception(t('No configuration was selected to be exported.'))); - Add
NULLas the default value for the$exceptionparameter of thefailure()method:
protected function failure(array &$return, Package $package, \Exception $exception = NULL, $message = '') {
Remaining tasks
Choose the prefered solution
Patch
Review
Commit
User interface changes
No
API changes
No
Data model changes
No
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | features-Argument_instance_issue_fixed-2701571-3.patch | 2.18 KB | sourabh.singhal |
Comments
Comment #2
sourabh.singhal commentedComment #3
sourabh.singhal commentedHi DuaelFr,
I have made the changes proposed in the solution and uploaded the patch. Please review.
Thanks
Sourdrup
Comment #5
mpotter commentedCommitted to 14d66f6.