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

BAO_Navigation: Respect domain_id param #12476

Merged
merged 2 commits into from
Jul 15, 2018
Merged

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Jul 15, 2018

Overview

Allow choosing the domain_id when creating or updating a navigation menu item

Before

The BAO would clobber the domain_id whenever creating or updating a navigation menu item.

After

It respects the param if set, but will still default to the current domain.

@civibot
Copy link

civibot bot commented Jul 15, 2018

(Standard links)

@seamuslee001
Copy link
Contributor

@mattwire
Copy link
Contributor

  • Old logic: Always set default domain_id.
  • New logic: If creating a new entity, prefer the domain_id passed in via $params. Fallback to default domain_id. If updating, don't touch the domain_id (unless passed in via $params in which case it will be used).

This looks good, if we could add a unit test per @seamuslee001 suggestion I'm happy for it to be merged.

@colemanw
Copy link
Member Author

@mattwire @seamuslee001 thanks for the review. I've added a simple test for api3, and will be adding more robust testing for this in the api4 extension.

@colemanw colemanw merged commit e596685 into civicrm:master Jul 15, 2018
@colemanw colemanw deleted the navigation branch July 15, 2018 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants