Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.

Professional campaigns only please#6234

Merged
angaither merged 2 commits intodevfrom
professional-campaigns-only-please
Mar 2, 2016
Merged

Professional campaigns only please#6234
angaither merged 2 commits intodevfrom
professional-campaigns-only-please

Conversation

@angaither
Copy link
Contributor

What's this PR do?

remove unpublished campaigns from the api index.

How should this be manually tested?

do unpublished campaigns show up in the index?

Any background context you want to provide?

This fix was added in with #5175 to support the original
idea in the mobile app, where we had campaigns show up on
the app, but not on the web.
As we are no longer going that route, let's only return
published campaigns.

What are the relevant tickets?

Fixes #6233

doesn't fix

it kinda feels like always setting the campaign.status to closed for an unpublished campaign node will do the trick there
because even if we hide the campaign from API, that signup is still returned from signups?user=:id

This fix was added in with #5175 to support the original
idea in the mobile app, where we had campaigns show up on
the app, but not on the web.
As we are no longer going that route, let's only return
published campaigns.
Fixes #6233
@aaronschachter
Copy link
Contributor

👍 Looks good!

Brings to mind whether to kill those Mobile App dates / checkbox fields for housekeeping...

$query->join('field_data_field_campaign_type', 't', 't.entity_id = n.nid');

// @TODO: this is a temporary fix to address the need to allow unpublished mobile_app campaigns to be retrieved, only for the mobile app.
if (!$params['mobile_app']) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this doesn't remove the param, it just makes sure all campaigns are published

@angaither
Copy link
Contributor Author

@aaronschachter are all mobile app dates/query param unused?

@aaronschachter
Copy link
Contributor

Not using them anywhere in iOS. @jonuy?

angaither added a commit that referenced this pull request Mar 2, 2016
…-please

Professional campaigns only please
@angaither angaither merged commit 92bf699 into dev Mar 2, 2016
@angaither angaither deleted the professional-campaigns-only-please branch March 2, 2016 19:02
@jonuy
Copy link
Contributor

jonuy commented Mar 2, 2016

We should be good on the Android side too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Campaigns API: return closed status if the node is unpublished (or don't return campaign at all)

3 participants