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

Fetch the profile on name, not on title #4

Open
tttp opened this issue Sep 25, 2013 · 1 comment
Open

Fetch the profile on name, not on title #4

tttp opened this issue Sep 25, 2013 · 1 comment
Assignees

Comments

@tttp
Copy link
Contributor

tttp commented Sep 25, 2013

Hi,

you seem to fetch the profiles based on the title (ie. stuff the admin can change) instead of the name (stuff the admin can't change)

So guess what: my admin changed the title and it seems that it got seriously confused (or might be just because it's in a different language than english)

so instead of

  $profArray = array('Current User Profile' => 1, 'Other Parent Or Guardian' => 2, 'First Emergency Contacts' => 3, 'Second Emergency Contacts' => 4, 'New Individual' => 6);

  $profiles = CRM_Core_DAO::executeQuery(" SELECT id FROM civicrm_uf_group WHERE (title = 'Current User Profile' OR  title = 'Other Parent Or Guardian' OR  title = 'First Emergency Contacts' OR  title = 'Second Emergency Contacts') AND is_active = 1");

you should use
name= "Other_Parent_Or_Guardian"...

I haven't checked how you create the profiles, but to make it more readable, you can set your own name instead of generating it from the title automatically (if you use the api to create at least)

X+

@ghost ghost assigned sgladstone Sep 25, 2013
@sgladstone
Copy link
Owner

Good idea to use profile "name" instead of "title".

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

No branches or pull requests

2 participants