Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,21 @@ function dosomething_campaign_is_closed($node) {
* @return bool
*/
function dosomething_campaign_is_active($node) {
// Node must be published, and campaign status != closed.
return $node->status == 1 && !dosomething_campaign_is_closed($node);
// Campaign must be active and not closed.
if (!dosomething_campaign_is_closed($node)) {
// Campaign is on mobile app and may/may not be published.
$on_mobile_app = dosomething_helpers_extract_field_data($node->field_on_mobile_app);
if ($on_mobile_app) {
return TRUE;
}

// Campaign is published.
if ($node->status == 1) {
return TRUE;
}
}

return FALSE;
}

/**
Expand Down