as in subject, i have a field in an external database table with timestamp type.
it is a simple table with this structure:
smsId int(11) No
mittente varchar(70) No
numCell varchar(14) No
smsTxt text No
sms_data timestamp No CURRENT_TIMESTAMP
all others field are well rendered but the sms_data field's rows are empty.
furtermore this warning is displayed on view's page:
Warning: date_timezone_set() expects parameter 1 to be DateTime, boolean given in format_date() (linea 2040 di /var/www/html/drupal-7.34/includes/common.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | views_database_connector-timestamp-field-not-shown-2474387-5.patch | 4.4 KB | mitjasvab |
Issue fork views_database_connector-2474387
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
purpleleaf commentedi found a solution in this page.
adding the filter and the handler and modifying the views_database_connector_views_data function as suggested in the above post solved the problem.
i only edited the workshop_handler_filter_datetime.inc file, and modified all the format_date function passing to it an intval as suggested in this post
Comment #2
jakonore commentedHello Purpleleaf,
I have the same problem with a field from my database which is a timestamp and is being displayed empty by views.
Can you explain how you solved the problem and what changes you did on views_database_connector_views_data ?
I tried to get my head around the post you refer to but I am failing to really understand.
Thanks
Comment #3
purpleleaf commentedhi jakonore.
first of all download from Rahul site the handler classes, then include them in your module.info, as suggested in former cited site:
files[] = views/workshop_handler_field_datetime.inc
files[] = views/workshop_handler_filter_datetime.inc
the files in this example are in a new folder called views inside the module folder.
note that the downloaded file must be renamed because they ends in "._inc" not ".inc"
then modify views_database_connector_views_data function inside views_database_connector.views.inc file (row 55) like this:
It is not necessary to modify workshop_handler_filter_datetime.inc file as i wrote in the former post
Comment #4
clayfreeman--
Comment #5
mitjasvab commentedHi,
I assembled a patch with above informations. :-)
Comment #6
clayfreemanThis project is now abandoned.
Comment #7
bulldozer2003Patch in #5 works great.
Comment #8
bulldozer2003I've committed the patch to the 7.x-1.x branch.