Skip to content

Commit

Permalink
Merge branch 'release/2.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pbchase committed Jun 26, 2019
2 parents 17366f6 + b07b453 commit b070de0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ All notable changes to the REDCap Entity project will be documented in this file
This project adheres to [Semantic Versioning](http://semver.org/).


## [2.3.0] - 2019-06-26
### Changed
- Deliver a warning if a bulk operation does not return true (Kyle Chesney)


## [2.2.0] - 2019-03-31
### Changed
- Replacing __pendencies with __issues (Tiago Bember Simeao)
Expand Down
15 changes: 11 additions & 4 deletions classes/EntityList.php
Original file line number Diff line number Diff line change
Expand Up @@ -712,13 +712,20 @@ protected function processBulkOperations() {
protected function executeBulkOperation($op, $op_info, $entities) {
foreach ($entities as $entity) {
// TODO: check if method exists.
$entity->$op();
$op_response = $entity->$op();
}

// TODO: detect errors.

if (!empty($op_info['message'])) {
StatusMessageQueue::enqueue($op_info['message']);
if ($op_response !== true) {
$message = "An issue prevented $op from acting as expected";
if ($op_response !== false) {
$message .= "</br>It returned: $op_response";
}
StatusMessageQueue::enqueue($message, 'warning');
} else {
if (!empty($op_info['message'])) {
StatusMessageQueue::enqueue($op_info['message']);
}
}
}

Expand Down

0 comments on commit b070de0

Please sign in to comment.