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) »
  • Edit button not showing when viewing Contact record
Pages: [1]

Author Topic: Edit button not showing when viewing Contact record  (Read 915 times)

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Edit button not showing when viewing Contact record
November 26, 2013, 04:01:17 am
On /civicrm/contact/view I used to see the 'Edit' button, but after upgrading to 4.4 it's missing.

Here is a patch to /templates/CRM/Contact/Page/View/Summary.tpl that fixes the issue, but perhaps not completely.

Code: [Select]
--- /data/Download/CiviCRM/civicrm-4.4.2-drupal/templates/./CRM/Contact/Page/View/Summary.tpl 2013-11-21 16:11:12.000000000 +1100
+++ /data/Work/IT/CiviCRM/Local/4.4.2/cbf/templates/./CRM/Contact/Page/View/Summary.tpl 2013-11-22 23:13:02.895351758 +1100
@@ -58,7 +58,7 @@
             </li>
           {/if}
           {* Include Edit button if contact has 'edit contacts' permission OR user is viewing their own contact AND has 'edit my contact' per
mission. *}
-          {if $permission EQ 'edit' && call_user_func(array('CRM_Core_Permission','check'), 'edit my contact')}
+          {if $permission EQ 'edit' || call_user_func(array('CRM_Core_Permission','check'), 'edit my contact')}
             <li>
               {assign var='editParams' value=$urlParams|cat:"&action=update&cid=$contactId"}
               <a href="{crmURL p='civicrm/contact/add' q=$editParams}" class="edit button" title="{ts}Edit{/ts}">

The comment says OR but the code says AND, and fixing the code makes the button appear. My concern is that this check confirms I have the 'edit my contact' permission, but not that this is MY contact record. I assume the PHP code checks this.

Would you like me to roll a PR?

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Edit button not showing when viewing Contact record
November 26, 2013, 04:04:21 am
I can't reproduce this on the D7 demo, but perhaps the demo user has 'edit my contact'?

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Edit button not showing when viewing Contact record
November 26, 2013, 06:04:47 am
Ken,

Can you please submit a PR for this against 4.4 branch ( and also file an issue for the same )

Thanks
Kurund
Found this reply helpful? Support CiviCRM

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Edit button not showing when viewing Contact record
November 26, 2013, 02:53:25 pm
Issue http://issues.civicrm.org/jira/browse/CRM-13840
PR https://github.com/civicrm/civicrm-core/pull/2100

Kurund,

Is the protocol still
    Forum topic --> Issue --> PR
or is it more efficient another way?

Ken

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Edit button not showing when viewing Contact record
November 26, 2013, 11:14:48 pm
Quote
Is the protocol still
    Forum topic --> Issue --> PR

I personally like this flow :)

Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Edit button not showing when viewing Contact record

This forum was archived on 2017-11-26.