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) »
  • CiviEvents Calendar View has error
Pages: [1]

Author Topic: CiviEvents Calendar View has error  (Read 3621 times)

jptillman

  • Guest
CiviEvents Calendar View has error
July 18, 2009, 05:22:54 pm
Installed CiviCRM v 2.2.7, Drupal 6.12, Views 6.x-2.6

Enabled the civicrm_events View in the Views module.

I get the following error:

user warning: Unknown column 'node.type' in 'field list' query: SELECT civicrm_event.id AS id, civicrm_event.start_date AS civicrm_event_start_date, civicrm_event.title AS civicrm_event_title, node.type AS node_type FROM civicrm_event civicrm_event WHERE (civicrm_event.is_active <> 0) AND (civicrm_event.is_public <> 0) ORDER BY civicrm_event_start_date ASC in /home/taltech/public_html/sites/all/modules/views/includes/view.inc on line 759.

and a blank calendar.

Any ideas on where to begin fixing this?  I can see that the SQL query is incorrectly built (trying to use a column node.type from a table that has not been joined into the query), but I can't quite find the place to create a fix for it.

jptillman

  • Guest
Re: CiviEvents Calendar View has error
July 18, 2009, 05:27:37 pm
Just found the solution to my own issue.  I saw the sticky post on views integration after my post and tried upgrading the calendar, date, and cck modules to the latest (I was a few versions behind).  This appears to have resolved the issue and the calendar displays now.

WallyJ

  • Guest
Re: CiviEvents Calendar View has error
August 08, 2009, 03:46:39 pm
I have the latest version of all of the modules and still receive a db error concerning a missing table when I look at the view.

Any ideas?

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: CiviEvents Calendar View has error
August 18, 2009, 10:26:26 am
Have you configured the Views db_prefix(s) correctly in your Drupal settings.php file?  There should be a huge list of db_prefix to get Views working correctly.   Can you post the error?
Try CiviTeacher: the online video tutorial CiviCRM learning library.

jooplaan

  • Guest
Re: CiviEvents Calendar View has error
August 24, 2009, 04:51:29 am
I see the same type of error in my installation:

user warning: Unknown column 'civicrm_event.title' in 'field list' query: SELECT civicrm_event.id AS id, civicrm_event.title AS civicrm_event_title, civicrm_event.start_date AS civicrm_event_start_date FROM civicrm.civicrm_event civicrm_event WHERE ((civicrm_event.is_active <> 0) AND (civicrm_event.is_public <> 0)) AND ((DATE_FORMAT(ADDTIME(civicrm_event.start_date, SEC_TO_TIME(7200)), '%Y-%m') <= '2009-08' AND DATE_FORMAT(ADDTIME(civicrm_event.start_date, SEC_TO_TIME(7200)), '%Y-%m') >= '2009-08')) ORDER BY civicrm_event_start_date ASC in /opt/drupal/drupal-6.13/sites/all/modules/views/includes/view.inc on line 759.

It worked first, but after enabling multiple languages in civicrm it stopped working. Even after updating the Drupal settings.php with the new db_prefix table names..

What would be the way to solve this?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviEvents Calendar View has error
August 24, 2009, 05:32:11 am

I dont think our views2 integration is compatible with multilingual features. The multilingual install changes the column names and adds additonal columns etc, and hence u get the error: Unknown column 'civicrm_event.title' in 'field list' query

at some point it would be good for folks using multiligual to figure out how to make the two play well together. this is currently not on our short/medium term plans

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

jooplaan

  • Guest
Re: CiviEvents Calendar View has error
August 24, 2009, 05:41:00 am
oki, thanks for the info. Guess I will switch back to mono lingual civicrm and let Drupal handle all the multilingual stuff for now..

hgcrpd

  • Guest
Re: CiviEvents Calendar View has error
August 30, 2009, 06:27:37 am
I am having the same error, but don't believe I have localization activated in CiviCRM and have modified Settings.php appropriately.  Here's the exact error text (actually two errors):

Code: [Select]
user warning: Unknown column 'civicrm_event.title' in 'field list' query: SELECT civicrm_event.id AS id, civicrm_event.start_date AS civicrm_event_start_date, civicrm_event.title AS civicrm_event_title FROM civicrm.civicrm_event civicrm_event WHERE (civicrm_event.is_active <> 0) AND (civicrm_event.is_public <> 0) ORDER BY civicrm_event_start_date ASC in C:\usr\webdev\drupal\modules\views\includes\view.inc on line 759.

user warning: Unknown column 'civicrm_event.title' in 'field list' query: SELECT civicrm_event.id AS id, civicrm_event.start_date AS civicrm_event_start_date, civicrm_event.title AS civicrm_event_title FROM civicrm.civicrm_event civicrm_event WHERE (civicrm_event.is_active <> 0) AND (civicrm_event.is_public <> 0) ORDER BY civicrm_event_start_date ASC in C:\usr\webdev\drupal\modules\views\includes\view.inc on line 759.

I've followed the step by step integration instructions and verified that all my modules are up to date.  Settings.php in drupal/sites/default/ is also has the new $db_prefix, with this entry in the array: 'civicrm_event'                            => 'civicrm.',

And I only have one available language in the localization setting, though my default currency is not in USD.  There are no languages listed in the "Add Language" dropdown, so I assume that this means that multilingual features are off?  Localization is turned on in Drupal, however.

Any ideas?

Thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviEvents Calendar View has error
August 30, 2009, 05:08:40 pm

1. please avoid crossposting

2. you might want to cut-n-paste the query into mysql shell (or PMA) and figure out what changes u need to do to make it work. I tried the same query on mysql 5.0.81 and it worked

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

hgcrpd

  • Guest
Re: CiviEvents Calendar View has error
August 30, 2009, 06:43:53 pm
Sorry about that.

I believe the problem is that its selecting the Drupal database even though it's supposed to be using the CiviCRM database.  So the db_prefix of 'civicrm.' is supposed to let the application know that it has to use this other database and not the drupal default, right?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviEvents Calendar View has error
August 30, 2009, 07:29:46 pm

if you look at the query it is using the civicrm DB (check the from clause)

i suspect something has changed between mysql v5.0 and v5.1 and hence u r seeing the error. Note that most of us are still on mysql 5.0.x

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

hgcrpd

  • Guest
Re: CiviEvents Calendar View has error
August 30, 2009, 07:35:31 pm
Ah, okay, thanks for pointing that out -- I didn't look close enough to catch that.

Is there a reason why it prints the table twice?:
Code: [Select]
FROM civicrm.civicrm_event [b]civicrm_event[/b] WHERE
Thanks.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviEvents Calendar View has error
August 30, 2009, 07:39:22 pm

it does not print the table twice, its just aliasing the table and giving it a shorter name :) I'm pretty sure its the views code that does that part of the sql generation

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

hgcrpd

  • Guest
Re: CiviEvents Calendar View has error
August 30, 2009, 08:04:18 pm
Oh okay.  I ran the query and found that the problem was my title field is actually "title_en_US," so I guess my problem *was* that I had internationalization turned on in CiviCRM.  Is there a way to turn it off without reinstalling the monolingual package?

Or maybe I should just modify the view to take the new column names into account?

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: CiviEvents Calendar View has error
August 31, 2009, 07:34:32 am
Quote from: hgcrpd on August 30, 2009, 08:04:18 pm
I ran the query and found that the problem was my title field is actually "title_en_US," so I guess my problem *was* that I had internationalization turned on in CiviCRM.

The actual column is civicrm_event.title_en_US, but it’s exposed in the civicrm_event_en_US view under the title name.

Quote
Is there a way to turn it off without reinstalling the monolingual package?

If your code passes through the CiviCRM codebase, simply appending the global $dbLocale to the table name should do the trick: it’s empty if it’s a single-language install, otherwise it contains the user’s (or the default) locale.

Quote
Or maybe I should just modify the view to take the new column names into account?

You should modify the table name, so that your code uses the view rather than the real table. In the civicrm_…_xx_YY views all the …_xx_YY columns from civicrm_… tables are exposed under their ‘original’ names.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • CiviEvents Calendar View has error

This forum was archived on 2017-11-26.