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

Update to include affiliates info in Campaign class build.#6395

Merged
weerd merged 2 commits intodevfrom
affiliates-join-the-api-party
Apr 26, 2016
Merged

Update to include affiliates info in Campaign class build.#6395
weerd merged 2 commits intodevfrom
affiliates-join-the-api-party

Conversation

@weerd
Copy link
Contributor

@weerd weerd commented Apr 26, 2016

What's this PR do?

This PR include a Campaign's affiliates information (such as partners in this particular case) to the Campaign class build function when a new Campaign is instantiated and also exposes this data to the API.

Example output:
image

How should this be manually tested?

Load a few campaigns both with and without partners (and partners that are also sponsors) via the API and see if the affiliate property on the response object is appropriately filled out.

Any background context you want to provide?

If a partner does not have a logo "media" available, instead of making the uri and type be NULL I decided to make the entire media object NULL. Just seemed to make more sense to me that when planning on outputting the path to the logo, better to check the media object if that's something valid first. But we can nerd 🤓 battle over this if others feel strongly with a different opinion!

Also, since this is on the Campaign class object, the partner information is now nicely formatted and available for use in future Campaign template updates via the web interface as well, wink wink 😉

What are the relevant tickets?

Fixes #6393


@aaronschachter @angaither @chloealee

cc: @mikefantini


if ($logo) {
$partner['media'] = [
'uri' => image_style_url('wmax-423px', $logo['uri']),
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we enforce minimums on partner logos, so I have a feeling this might be a little large

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, but it's already what we use in the web app. On the DS we use CSS to help us tame the size of partner logos. I referenced the image "style" used in the ds_taxonomy module.

@aaronschachter
Copy link
Contributor

Code looks good to me -- I think a null media object makes sense when we don't have a logo.

@weerd weerd merged commit db5d3c5 into dev Apr 26, 2016
@weerd weerd deleted the affiliates-join-the-api-party branch April 26, 2016 18:37
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.

3 participants