Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only set mediaTypes.banner.sizes from sizes if mediaTypes doesn't exist. #3274

Merged
merged 1 commit into from
Nov 15, 2018

Conversation

snapwich
Copy link
Collaborator

@snapwich snapwich commented Nov 7, 2018

Type of change

  • Bugfix

Description of change

Fixes #3269. The issue is when mediaTypes.video.playerSize is set then adUnits.sizes is set here. Since sizeMapping still supports adUnit.sizes it will set adUnit.mediaTypes.banner.sizes if it doesn't already exist, which is a bug if adUnit.sizes was set from the video sizes. So to fix this, this pull-request only sets adUnit.mediaTypes.banner.sizes from adUnit.sizes if adUnit.mediaTypes doesn't exist.

Copy link
Contributor

@idettman idettman left a comment

Choose a reason for hiding this comment

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

LGTM

@idettman idettman requested a review from mike-chowla November 8, 2018 19:04
@idettman idettman added needs review needs 2nd review Core module updates require two approvals from the core team and removed needs review labels Nov 8, 2018
@@ -65,22 +65,20 @@ export function resolveStatus({labels = [], labelAll = false, activeLabels = []}
let maps = evaluateSizeConfig(configs);

if (!isPlainObject(mediaTypes)) {
mediaTypes = {};
// add support for deprecated adUnit.sizes by creating correct banner mediaTypes if they don't already exist
if (sizes) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this check if mediaTypes already exists, as stated in description?

I'm testing this fix out, but I still see mediaTypes.banner.sizes set when I'm only configuring an instream video mediaType.

Copy link
Contributor

Choose a reason for hiding this comment

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

My mistake, I was testing a prebid version without this fix. With the fix, I can confirm that it is working as expected and no longer setting mediaType.banner if only a video unit.

Thanks for the fix!

Copy link
Contributor

@mike-chowla mike-chowla left a comment

Choose a reason for hiding this comment

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

LGTM

@mike-chowla mike-chowla removed the needs 2nd review Core module updates require two approvals from the core team label Nov 15, 2018
@snapwich snapwich merged commit 186ee66 into master Nov 15, 2018
ghost pushed a commit to devunrulymedia/Prebid.js that referenced this pull request Jan 30, 2019
pedrolopezmrf pushed a commit to Marfeel/Prebid.js that referenced this pull request Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

banner mediaTypes always added in bid despites provided mediaTypes in adUnits config
4 participants