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 (Moderator: Dave Greenberg) »
  • Problem Getting Basic User View Working
Pages: [1]

Author Topic: Problem Getting Basic User View Working  (Read 23693 times)

Lionsharz

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 0
    • www.ulearnschool.com
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • PHP version: 5.3 / 5.4
Problem Getting Basic User View Working
July 05, 2013, 07:01:26 am
Hi

I have had success with relatively complex views integration (using table wizard) plus custom tables. However, I am currently having trouble pulling in basic contact information for those Members in a certain group.

I created a User View as per the manual with fields such as 'First Name' and 'Group', but no data shows.

Ultimately I would like to filter the users based on the group that they are memeber of, or put another way - show me all the members of Group "Next Weeks Arrivals" for upcoming members. That group exists in civi but I am totally stuck as to how to pull that data into Views.

Any help much appreciated.

« Last Edit: July 05, 2013, 07:05:15 am by Lionsharz »
www.ulearnschool.com

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Problem Getting Basic User View Working
July 05, 2013, 12:31:58 pm
you need to be using the view relationship that links civi to drupal - not clear from above if you have done that.

once you have that you should find you have access to include civi fields and filters

if you already have the civi fields in then i am not sure why you are not seeing first/last etc
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Problem Getting Basic User View Working
July 06, 2013, 02:23:02 pm
Tell Views to show you the SQL generated and post that here.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Problem Getting Basic User View Working
July 06, 2013, 02:31:07 pm
also pls confirm you are using the standard way of doing this - your reference to Table Wizard made me wonder!

http://drupal.demo.civicrm.org/civicrm/admin/setting/uf?reset=1
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Lionsharz

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 0
    • www.ulearnschool.com
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • PHP version: 5.3 / 5.4
Re: Problem Getting Basic User View Working
August 14, 2013, 02:04:00 am
Quote from: Hershel on July 06, 2013, 02:23:02 pm
Tell Views to show you the SQL generated and post that here.

Hi

Thanks for your response. I have created the View using the View Type: User based on http://wiki.civicrm.org/confluence/pages/viewpage.action?pageId=46661668
« Last Edit: August 14, 2013, 02:27:02 am by Lionsharz »
www.ulearnschool.com

Lionsharz

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 0
    • www.ulearnschool.com
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • PHP version: 5.3 / 5.4
Re: Problem Getting Basic User View Working
August 14, 2013, 02:20:33 am
Code: [Select]
Query
SELECT users.uid AS uid, civicrm_contact.first_name AS civicrm_contact_first_name, civicrm_contact.id AS civicrm_contact_id, civicrm_contact.group AS civicrm_contact_group, 'civi_user:default' AS view_name FROM users users  LEFT JOIN civicrm_uf_match civicrm_uf_match ON users.uid = civicrm_uf_match.uf_id LEFT JOIN civicrm_contact civicrm_contact ON civicrm_uf_match.contact_id = civicrm_contact.id
Other queries
These queries were run during view rendering: [0.4 ms] render_textarea /* ulearn_admin : render_textarea */ SELECT name FROM filter_formats WHERE format = 2 [0.28 ms] drupal_lookup_path /* ulearn_admin : drupal_lookup_path */ SELECT dst FROM url_alias WHERE src = 'admin/build/views/edit/civi_user' AND language IN('en', '') ORDER BY language DESC, pid DESC [0.23 ms] drupal_lookup_path /* ulearn_admin : drupal_lookup_path */ SELECT dst FROM url_alias WHERE src = 'admin/build/views/export/civi_user' AND language IN('en', '') ORDER BY language DESC, pid DESC [0.22 ms] drupal_lookup_path /* ulearn_admin : drupal_lookup_path */ SELECT dst FROM url_alias WHERE src = 'admin/build/views/clone/civi_user' AND language IN('en', '') ORDER BY language DESC, pid DESC
Title
Path This display has no path.
Query build time 2.37 ms
Query execute time 3.25 ms
View render time 6.36 ms

Which produces no results.
« Last Edit: August 14, 2013, 02:49:21 am by Lionsharz »
www.ulearnschool.com

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Problem Getting Basic User View Working
August 14, 2013, 04:43:59 am
Hard to say without seeing your database. If you run that SQL in the database yourself, do you see results?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Lionsharz

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 0
    • www.ulearnschool.com
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • PHP version: 5.3 / 5.4
Re: Problem Getting Basic User View Working
August 14, 2013, 11:20:03 am
Hi

The issue was that I had the wrong array code.  I am running 4.2.0 on Drupal 6 with Views 2. Previously code like this

Code: [Select]
$db_prefix = array(
 'default' => '',
'civicrm_acl'                              => '',
  'civicrm_acl_cache'                        => '',
  'civicrm_acl_contact_cache'                => '',
  'civicrm_acl_entity_role'                  => '',
  'civicrm_action_log'                       => '',
  'civicrm_action_mapping'                   => '',
  'civicrm_action_schedule'                  => '',
  'civicrm_activity'                         => '',
etc...

worked fine (note that there is nothing between the apostrophes). For anyone else having similar problems (the CiviCRM Fields appear in the Views setup but no output appears) it may be down to this issue. I revisted the CMS Database Integration page (www.mydomain.com/civicrm/admin/setting/uf?reset=1) and input that code into the settings.php file
Code: [Select]
$db_prefix = array(
 'default' => '',
'civicrm_acl'                              => '`ulearn_civi`.',
  'civicrm_acl_cache'                        => '`ulearn_civi`.',
  'civicrm_acl_contact_cache'                => '`ulearn_civi`.',
  'civicrm_acl_entity_role'                  => '`ulearn_civi`.',
  'civicrm_action_log'                       => '`ulearn_civi`.',
  'civicrm_action_mapping'                   => '`ulearn_civi`.',
  'civicrm_action_schedule'                  => '`ulearn_civi`.',

This got things working. I'm still using the 'default' => '', at the start of the code. Works for me.

Thanks for your help. This is a great community.
« Last Edit: August 14, 2013, 11:23:15 am by Lionsharz »
www.ulearnschool.com

Lionsharz

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 0
    • www.ulearnschool.com
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • PHP version: 5.3 / 5.4
Re: Problem Getting Basic User View Working
August 15, 2013, 10:31:52 am
...actually this hasn't solved the issue.

When you first open the Add View page you'll see some standard CivCRM tables, eg; CiviCRM Activities, CiviCRM Campaigns, CiviCRM Contributions etc.

Some of these tables are missing / have disappeared. Most importantly I no longer see the CiviCRM Contacts table. Furthermore, creating a View of Type "User" no longer gains access to the civicrm Contacts table (with fields like First Name, Last Name etc).

These standard views are provided by the module within the CiviCRM folder (sites/all/modules/civicrm/drupal/modules/views). They are not connected to the settings.php array. This was functioning for me in a basic way yesterday but now I cannot access Contact info.

Any ideas on what might be causing that?

N
www.ulearnschool.com

Lionsharz

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 0
    • www.ulearnschool.com
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • PHP version: 5.3 / 5.4
Re: Problem Getting Basic User View Working
August 15, 2013, 11:16:47 am
Hi

For anyone out there using Table Wizard to pull in or merge data from CiviCRM or Drupal, note that inclusion of tables in TW will remove them from the View Type page and you won't be able to use the "normal" civi approach to Views.

I removed these tables from Table Wizard and they then reappeared under the View Type for selection as normal. Hope that helps someone.
www.ulearnschool.com

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Problem Getting Basic User View Working

This forum was archived on 2017-11-26.