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 CiviEvent (Moderator: Yashodha Chaku) »
  • Not sure how to fix views problem with CiviCRM_Events
Pages: [1] 2

Author Topic: Not sure how to fix views problem with CiviCRM_Events  (Read 2325 times)

JEfromCanada

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Not sure how to fix views problem with CiviCRM_Events
November 08, 2011, 09:42:41 am
I am brand new to Drupal and brand new to CiviCRM, having installed both products within the last week; so I've probably bitten off more than I can chew!

As part of the Drupal installation, I also installed CTools and a View component.

I defined a view for displaying information on upcoming events, but realize that the view table "dr_civicrm_event" hasn't been created.  I assumed that views are created on the fly when defined or used.  It wasn't until I got an SQL error during display of the view that I even saw there was a problem.  I then verified the problem by seeing the error that was displayed when I edited the view.

Can someone lead me in the right direction in solving this issue?  I have no data of my own in the database yet - only the pre-installed CiviCRM data that came standard with the installer.

I'm using the latest version of Drupal 7 and the latest version of CiviCRM

Thanks in advance for your guidance and assistance.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Not sure how to fix views problem with CiviCRM_Events
November 08, 2011, 11:37:25 am
What version of Views?

Have you done this: http://wiki.civicrm.org/confluence/display/CRMDOC40/Views3+Integration
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.

JEfromCanada

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: Not sure how to fix views problem with CiviCRM_Events
November 08, 2011, 12:50:54 pm
That was very interesting...

No, I hadn't known about the information you posted.  Funny thing is that the settings.php file already had a definition for the $databases parameter.  I placed the new code immediately after the existing block, just as the instructions indicated, and when I did that, my site would not come up at all.  Removing the code allowed my site to come up, but with the same errors as originally reported.

So, I've enclosed another couple of screenshots of the "Views" component and "Chaos" module.

Maybe you can tell me where to fit the cut/paste code.  I can tell you that the Drupal and CiviCRM data is stored in a single database.  Some tables have the dr_ prefix, and some have the civicrm_ prefix.  There are no other tables in that database, and there are no other databases that contain tables.

On a PREVIOUS attempt to install CiviCRM, I recall it asking me for login credentials for a separate database.  After uninstalling Drupal/CiviCRM and removing all files/databases, I tried a second install.  I again recall being asked about a separate database to store CiviCRM data into, however, that database is completely blank... the database is there, but no tables exist in it at all.  Does that help?
« Last Edit: November 08, 2011, 05:15:47 pm by JEfromCanada »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Not sure how to fix views problem with CiviCRM_Events
November 09, 2011, 02:55:50 am
Post here the first few lines of what you see at  http://yourdomain.com/civicrm/admin/setting/uf?reset=1 (meaning the code starting with $databases['default']['default']['prefix']= array(" ) and I will show you one line you will need to add.
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.

JEfromCanada

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: Not sure how to fix views problem with CiviCRM_Events
November 09, 2011, 09:48:26 am
I appreciate the time you're putting into this.  Once I get familiar with a product, I tend to spend a lot of time in forums, helping other users.  So just know that your "investment" will pay dividends eventually!

And thank you to whoever removed the requirement for that annoying captcha before posting  :)



Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Not sure how to fix views problem with CiviCRM_Events
November 09, 2011, 10:00:27 am
So after the second line (starting with 'civicrm_acl') put a like:

Code: [Select]
'default' => 'dr_',
That should do it.
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.

JEfromCanada

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: Not sure how to fix views problem with CiviCRM_Events
November 09, 2011, 11:39:40 am
Thank you.  That code cleared the SQL error.  When I now click on the "Upcoming Events" link in my menu, I am presented with a generic page that lists space-holders for events.  Checking the Events Management area, I see there are two pre-loaded events in the database that came from CiviCRM.

I'll check the block definition (this is the very first block I've defined, so I may not have the hang of it yet) to see if I made an error.  In the meantime, if you have a suggestion, I'm all ears.

I checked the View definition and didn't realize I had to select which fields were displayed.  It's all good now.

Thank you very much for your help!
« Last Edit: November 09, 2011, 11:47:30 am by JEfromCanada »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Not sure how to fix views problem with CiviCRM_Events
November 09, 2011, 11:42:01 am
You need the edit the "Fields" section of the view that's all.
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.

JEfromCanada

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: Not sure how to fix views problem with CiviCRM_Events
November 09, 2011, 11:48:00 am
Thanks, I saw that, and edited my previous post to indicate that I found the problem.  Thanks again.

JEfromCanada

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: Not sure how to fix views problem with CiviCRM_Events
November 09, 2011, 12:07:47 pm
As fields are added, how do I control the order that fields are displayed.  I selected a bunch of fields, but I can't find a way to reorder them.

It also appears that in my stumbling about, I've generated an "Undefined variable" error.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Not sure how to fix views problem with CiviCRM_Events
November 09, 2011, 12:10:35 pm
To the right of "add" which is to the right of Fields, there is an arrow. Open that and find one of the options and choose it. Then you can drag and drop them into order.

If all else works, then you can ignore Undefined variable warnings.
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.

JEfromCanada

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: Not sure how to fix views problem with CiviCRM_Events
November 09, 2011, 12:30:13 pm
Thanks.  I've now reordered the fields to my satisfaction.  However, the Undefined Variables message appears on the live website, not just when configuring the event view.

I'm also going to look for a way to leave more space between entries... the first line of subsequent events appears immediately after the last line of prior events.  I need some separation.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Not sure how to fix views problem with CiviCRM_Events
November 09, 2011, 12:38:21 pm
Quote from: JEfromCanada on November 09, 2011, 12:30:13 pm
Thanks.  I've now reordered the fields to my satisfaction.  However, the Undefined Variables message appears on the live website, not just when configuring the event view.

It also shows if you're NOT logged in? If so, Go to Administer > Site configuration > Error reporting (admin/settings/error-reporting).

Quote from: JEfromCanada on November 09, 2011, 12:30:13 pm

I'm also going to look for a way to leave more space between entries... the first line of subsequent events appears immediately after the last line of prior events.  I need some separation.

Adjust the CSS of your theme for this.
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.

JEfromCanada

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: Not sure how to fix views problem with CiviCRM_Events
November 09, 2011, 12:57:08 pm
Quote from: Hershel on November 09, 2011, 12:38:21 pm
Quote from: JEfromCanada on November 09, 2011, 12:30:13 pm
Thanks.  I've now reordered the fields to my satisfaction.  However, the Undefined Variables message appears on the live website, not just when configuring the event view.

It also shows if you're NOT logged in? If so, Go to Administer > Site configuration > Error reporting (admin/settings/error-reporting).

After applying a change, I check the site both as a logged in administrative user and as a general surfer (not logged into CiviCRM).  Prior to my attempts to get the additional fields to display for an event, I was able to see the Event ID's without any error.  It was only in my mucking about to try to get the other fields to display that I introduced the undefined variable message.  I'm not sure how I generated this error, but it does appear under both scenarios (registered and unregistered user).


Quote from: Hershel on November 09, 2011, 12:38:21 pm
Quote from: JEfromCanada on November 09, 2011, 12:30:13 pm

I'm also going to look for a way to leave more space between entries... the first line of subsequent events appears immediately after the last line of prior events.  I need some separation.

Adjust the CSS of your theme for this.

Hmm.

I'm not terribly proficient with CSS editing.  I used a template generating program (Artisteer) to create my custom Drupal theme.  Whenever something doesn't work the way I like, I revert to one of the default Drupal themes to confirm whether it's a general problem, or something specific to my theme.  I'll see what can be done to edit the CSS file.

JEfromCanada

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: Not sure how to fix views problem with CiviCRM_Events
November 09, 2011, 01:09:14 pm
I found the cause of the undefined variables message...

When defining the "Title" field, I asked it to link to the Event page.  When I went back to look at the field definition, it showed the Title as not being linked to any type of link(!)

I tried again to select a page to link to, and immediately noticed that the link was not properly stored (it still indicated it was not linking to any other page).

Only after completely removing the field, and adding it back as an UNLINKED field did the error message go away.

I have not attempted to link to another page.  I'll do that later.

Well, after adding the Title back, I again tried to link it to one of the Events pages, and again, the undefined variable error occurred.  When I first associated the Title field with a link, the link was operational, despite the error messages.  So, I may look at the PHP code and see whether this variable is undefined because of a path through the code that causes it to be undefined.  It won't be the first time I've found a module that had undefined variables due to the logic of the PHP file not anticipating every path through the code.
« Last Edit: November 09, 2011, 01:16:24 pm by JEfromCanada »

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Not sure how to fix views problem with CiviCRM_Events

This forum was archived on 2017-11-26.