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) »
  • Recent Items doesn't update for users without Administer CiviCRM permission
Pages: [1]

Author Topic: Recent Items doesn't update for users without Administer CiviCRM permission  (Read 1978 times)

Marty

  • I post occasionally
  • **
  • Posts: 67
  • Karma: 14
    • Boulder County Arts Alliance
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.26
  • MySQL version: 5.5.37
  • PHP version: 5.4.27
Recent Items doesn't update for users without Administer CiviCRM permission
July 12, 2010, 10:13:54 pm
I have a Drupal user with all CiviCRM permissions except Administer CiviCRM, and the list of Recent Items never updates for this user after browsing contacts.  I can't verify if this is an issue on the sandbox site.  I would appreciate it if someone could verify if this is an issue on another site.  I'm running CiviCRM 3.1.5.

TwoMice

  • I post frequently
  • ***
  • Posts: 214
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
Re: Recent Items doesn't update for users without Administer CiviCRM permission
July 12, 2010, 10:38:38 pm
Hi Marty,

I'm running 3.1.3 on Drupal and just double-checked: "Recent Items" is updating properly for the tested user, who does not have the "Administer CiviCRM" permission.

Could be another module interfering.  Have you tried testing this with other modules turned off?

 -Allen
Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Recent Items doesn't update for users without Administer CiviCRM permission
July 13, 2010, 11:03:51 pm
Just tested on 3.2 beta 3 and recent items are update fine for a user w/o Admin CiviCRM.
Protect your investment in CiviCRM by  becoming a Member!

Marty

  • I post occasionally
  • **
  • Posts: 67
  • Karma: 14
    • Boulder County Arts Alliance
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.26
  • MySQL version: 5.5.37
  • PHP version: 5.4.27
Re: Recent Items doesn't update for users without Administer CiviCRM permission
July 17, 2010, 07:25:37 pm
I discovered that the issue is related to Drupal block caching and not CiviCRM permissions. My user with Administer CiviCRM permission is Drupal user 1, and Recent Items display properly because Drupal does not cache blocks for user 1. The Recent Items block does not update properly for my user without Administer CiviCRM permission because Drupal is fetching a stale copy of the block from the cache.  The Drupal hook function civicrm_block() is never called to create updated versions of the Recent Items block for users other than user 1.

My solution for now was to change the 'cache' field in the Drupal 'blocks' table for the Recent Items block from BLOCK_CACHE_GLOBAL (0x0008) to BLOCK_NO_CACHE (-1).  Recent Items update properly for all users with this change.

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Recent Items doesn't update for users without Administer CiviCRM permission
July 20, 2010, 08:38:12 am
Hey,

Recent items block has been set to be BLOCK_NO_CACHE by default - we store the information in session, so there is not too much overhead for retrieval, it should do the trick.

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

Marty

  • I post occasionally
  • **
  • Posts: 67
  • Karma: 14
    • Boulder County Arts Alliance
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.26
  • MySQL version: 5.5.37
  • PHP version: 5.4.27
Re: Recent Items doesn't update for users without Administer CiviCRM permission
July 20, 2010, 12:23:36 pm
If I understand correctly, all of the CiviCRM blocks are registered in Drupal with BLOCK_CACHE_GLOBAL (see CRM/Core/Block.php).  Should we open an issue to change the default caching to BLOCK_NO_CACHE?

Do you know if the Drupal block cache is enabled on the sandbox site?  I would expect to see the same problems there if it is.

Thanks!

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Recent Items doesn't update for users without Administer CiviCRM permission
July 23, 2010, 06:13:46 am
That's correct, most of remaining blocks are using BLOCK_CACHE_GLOBAL. Switching the to no cache is probably a good idea, however some of them are fairly static and it does make sense to cache them.

Block cache is not enabled on sandbox. I'll take a look at remaining blocks, see which should not  be cached and will come back here with update.

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Recent Items doesn't update for users without Administer CiviCRM permission
July 23, 2010, 08:51:34 am
Hey,

I left "CiviCRM Create New Record", "CiviCRM Quick Add" and "CiviCRM Full-text Search" as cached blocks, and changed all the rest to be BLOCK_NO_CACHE. Those three are basically small forms that do not change due to setting/data changes, while the rest of blocks might.

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Recent Items doesn't update for users without Administer CiviCRM permission

This forum was archived on 2017-11-26.