CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Allowing a Drupal User to View and Edit their own profile...
Pages: [1]

Author Topic: Allowing a Drupal User to View and Edit their own profile...  (Read 1552 times)

greg72

  • Guest
Allowing a Drupal User to View and Edit their own profile...
July 29, 2008, 02:32:23 pm
A user can click on the My Account link and it brings them to the Drupal account information which they are allowed to change their basic contact information but I want to provide a link in it's place that they would click on that would take them directly to their Civicrm profile page and edit their information there. How do I go about doing that? I know I can create a link civicrm/profile/view?reset=1&gid=N but how do I dynamically add the users id number? I'm very confused.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Allowing a Drupal User to View and Edit their own profile...
July 29, 2008, 03:13:06 pm
Greg - You can omit the contact's id in the profile view and edit path if you want the link to access a logged in user's contact path.

So, if I'm logged in and click these links:
http://<drupal site>/civicrm/profile/view?gid=1&reset=1
http://<drupal site>/civicrm/profile/edit?gid=1&reset=1

I'll get the view and edit screens with "my" contact data (using Profile 1).
Protect your investment in CiviCRM by  becoming a Member!

greg72

  • Guest
Re: Allowing a Drupal User to View and Edit their own profile...
July 29, 2008, 03:20:46 pm
I'm developing on an install of Xampp and using localhost/drupal58 as my root.

So, I type http://localhost/drupal58/civicrm/profile/view?gid=1&reset=1 and it returns me to /localhost/xampp.

Why does it do that?

I can get to my profile in a round about way @ http://localhost/drupal58/index.php?q=civicrm/contact/view&reset=1&cid=106 (this is a non-admin test user)
but when I click the edit link it tells me:

Sorry. A non-recoverable error has occurred.
You do not have access to this page
Return to Home Page.

If I use: http://localhost/drupal58/index.php?q=civicrm/profile/view?gid=1&reset=1

I get an error:
Sorry. A non-recoverable error has occurred.
Could not find valid value for gid

Return to home page.

« Last Edit: July 29, 2008, 03:47:28 pm by greg72 »

geilhufe

  • I post frequently
  • ***
  • Posts: 293
  • Karma: 33
    • Social Source Software
Re: Allowing a Drupal User to View and Edit their own profile...
July 29, 2008, 04:38:41 pm
Sounds like you might not have clean urls turned on in drupal. Turn them on and it might start making more sense.
Drupal and CiviCRM consulting, strategy and configuration
http://www.social-source.com/

greg72

  • Guest
Re: Allowing a Drupal User to View and Edit their own profile...
July 29, 2008, 05:12:54 pm
Okay, I enabled clean URL's and input http://localhost/drupal58/civicrm/profile/edit?gid=1&reset=1 into the address bar but all that comes up is the address information to edit. How do we allow access to all the users profile information, not just one particular civicrm profile #?

If I replace gid=1 with gid=2 I get the next set of profile information but I want gid=1,2&3 all on the same page to edit.

I want the user to be able to edit the same page the admin sees by loading their civicrm profile.
« Last Edit: July 29, 2008, 05:15:17 pm by greg72 »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Allowing a Drupal User to View and Edit their own profile...

This forum was archived on 2017-11-26.