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

Refactor get user field#2638

Merged
angaither merged 6 commits intoDoSomethingArchive:devfrom
angaither:refactor-get-user-field
Jun 23, 2014
Merged

Refactor get user field#2638
angaither merged 6 commits intoDoSomethingArchive:devfrom
angaither:refactor-get-user-field

Conversation

@angaither
Copy link
Contributor

Overview

Refactoring calls to dosomething_user_get_field

What does this PR do?

  • Creates a generic dosomething_user_get_field function
    • This function calls handlers if more specific formatting is needed
    • The handlers should not be called directly

How to test

  • Check out this PR
  • Test out the user profile page for any oddities
  • Manually drush php-eval functions to make sure the results are as expected, a few to test...
    • drush php-eval "var_dump(dosomething_signup_get_mbp_params(user_load(10), node_load(84)));"
    • drush php-eval "echo dosomething_user_is_under_thirteen(user_load(10))"
    • drush php-eval "echo dosomething_user_get_field('field_first_name', user_load(10), 'ucwords');"

Bonus! Fixes #2606

Copy link
Contributor

Choose a reason for hiding this comment

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

Minor but I could see us moving this into dosomething_helpers to potentially use in other modules.

@aaronschachter
Copy link
Contributor

Code looks ok - just seemed to find the one bug in the Campaign Close template. Another place we could use this is in the User Signup Form, where we collect addresses, but this is also minor and not needed for merge..

@aaronschachter
Copy link
Contributor

👍

angaither added a commit that referenced this pull request Jun 23, 2014
@angaither angaither merged commit 208ce3d into DoSomethingArchive:dev Jun 23, 2014
@angaither angaither deleted the refactor-get-user-field branch June 23, 2014 20:06
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.

User: Get First Name function

2 participants