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
Exception to the failure() method
$this->failure($return, $package, new \Exception(t('No configuration was selected to be exported.')));
- Add
NULL as the default value for the $exception parameter of the failure() 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
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.