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 Drupal Modules (Moderator: Donald Lobo) »
  • Drupal7 Views using FROM_UNIXTIME for civicrm_event.start_date
Pages: [1]

Author Topic: Drupal7 Views using FROM_UNIXTIME for civicrm_event.start_date  (Read 1830 times)

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Drupal7 Views using FROM_UNIXTIME for civicrm_event.start_date
June 11, 2013, 09:37:21 am
I am using Drupal Views version 7.x-3.5 to create a monthly calendar grid, as well as a block of upcoming events.  The block of upcoming events works fine.   But the monthly grid does not.  It seems the issue is Views is attempting to use the MySQL function "FROM_UNIXTIME" for the start_date field, which returns a null.    Why is this function even being used for this field?

In troubleshooting, the SQL generated by the Drupal view for the monthly grid is as follows:

SELECT civicrm_event.title AS civicrm_event_title, civicrm_event.id AS id, civicrm_event.start_date AS civicrm_event_start_date
FROM
{civicrm_event} civicrm_event
WHERE (( (civicrm_event.is_active <> '0') AND (civicrm_event.is_public <> '0') )AND( (DATE_FORMAT(ADDTIME(FROM_UNIXTIME(civicrm_event.start_date), SEC_TO_TIME(-14400)), '%Y-%m') >= '2013-06' AND DATE_FORMAT(ADDTIME(FROM_UNIXTIME(civicrm_event.start_date), SEC_TO_TIME(-14400)), '%Y-%m') <= '2013-06') )AND(( (civicrm_event.is_template = '0') )))
ORDER BY civicrm_event_start_date ASC

(CiviCRM is version 4.2.7)
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

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: Drupal7 Views using FROM_UNIXTIME for civicrm_event.start_date
August 29, 2013, 02:12:29 pm
Did you sort this out? Is it possible to create a month view using Drupal Calendar display? I'm trying to feed in the start dates from Memberships...  ???
www.ulearnschool.com

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Drupal7 Views using FROM_UNIXTIME for civicrm_event.start_date

This forum was archived on 2017-11-26.