Hi,

I'm trying to get the dates to show in a View, but it is showing up blank. Seems to only affect the date fields as the name and email showed up fine.

I followed the instructions from both the video and documentation.

Video: https://vimeo.com/18701843
Documentation: https://www.drupal.org/node/2180607

Anyone have clearer directions?

Looking to create a calendar with the date inputs from a webform.

Thanks in advance.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

skchan2 created an issue. See original summary.

Piratawww’s picture

Same problem here.

joachim’s picture

Status: Active » Closed (won't fix)

> Looking to create a calendar with the date inputs from a webform.

Then you need webform's views support, not this module.

Piratawww’s picture

My date fields come empty from any table (i dont use webform views)

joep.hendrix’s picture

Version: 7.x-1.0-alpha7 » 7.x-1.x-dev
Status: Closed (won't fix) » Active

Same problem here.
If the type is datetime then blanks. When INT it works fine.

joachim’s picture

Component: User interface » Code
Status: Active » Postponed (maintainer needs more info)

Have you set up the correct Views field handler for your data entity?

joep.hendrix’s picture

Yes, in the view it is reconized as a date field (i can set the formats).
However, the output is blank.
When the field is an int (like node created), it works fine.

joachim’s picture

It could be the underlying format in your table isn't compatible with the handler.

Can you debug in the handler class to see what's going wrong?

joep.hendrix’s picture

the table field is of the datetime in Mysql.
I will try to debug.

joep.hendrix’s picture

Here is my test case:
Test table definition

CREATE TABLE `date_test2` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mysql_date` date DEFAULT NULL,
  `mysql_datetime` datetime DEFAULT NULL,
  `mysql_timestamp` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `unixtimestamp` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4

Attached the view definition and screenshots of the settings.

When debugging views_handler_field_date->render the values are never converted to timestamp (except for timestamp field). The call format_date($value, $format, '', $timezone) will return blank consequently.

I hope this helps.

joachim’s picture

> When debugging views_handler_field_date->render the values are never converted to timestamp (except for timestamp field).

What should be converting them to a timestamp? Does views_handler_field_date expect a timestamp?

Please bear in mind that it's been years since I worked on this code, and I don't have enough free time to set up an instance and debug it. You should use Devel module to debug the code to figure out why things aren't behaving as they should.