Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've looked in every panel in both manage fields and manage display, and I can't find the option for Add to Cal -- in the Format column, Field column, Widget column, etc. I've read the blog entry about it -- http://thinkshout.com/blog/2012/06/kyle/add-to-cal -- and can't find anything else to do.
Comment | File | Size | Author |
---|---|---|---|
#13 | addtocal-date-types-1625244-13.patch | 464 bytes | nedjo |
#5 | date-format-field.png | 117.46 KB | BrightBold |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedTry this, it seemed to work for me:
drush cc all
)If the cache clearing is necessary and we can track down the point where it is needed maybe we can use
cache_clear_all($cid = NULL, $bin = NULL, $wildcard = FALSE)
to do this automagically?Comment #2
somatics CreditAttribution: somatics commentedThere is no widget option from the Manage Fields list for Add to Calendar -- just the options for Text field and Pop-up calendar. On the Manage Display list, there is no column for Widgets, just the column for Format, and it also doesn't give me the option of Add to Cal. I can't find that option anywhere. I don't know what to do.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedYou should be able to find it under Structure > Content Types > Event (or whatever you called it) then by going to Manage Display, finding your Date field (or whatever you called it) and in the Format column, selecting "Add to Calendar".
If it is not there, double check that the module is installed. You may also want to clear your caches as suggested above. That can be done from the Configuration > Performance page if you're not using
drush
. Beyond that I'm not sure what else to suggest as I'm not the author of this module.Comment #4
somatics CreditAttribution: somatics commentedThe format column for my Date field in Manage Display only gives me the options of:
* Date and time
* Time ago
* Plain
The module is enabled. I clear cache (via the gui, Drush, and/or my host's control panel) regularly when I'm installing modules and otherwise developing. It doesn't appear to change anything on this front.
Comment #5
BrightBoldI have figured this out after spending several hours on it and feeling like a complete idiot that I couldn't install a simple module. The module only works if your date field is a "datetime" field. Mine are "Date (ISO format)" as recommended by Karen S (see http://groups.drupal.org/node/221254).
If you change line 58 in addtocal.module from
'field types' => array('datetime'),
to'field types' => array('date'),
then the Add to Cal format option appears, and works as intended. (Also, I found I had to check the "show Add to Cal widget for Past Events" option to get the button to show up on the Event node, so be sure to check that box—I'll file a separate issue for that.)So I guess this module just needs to be a tiny bit more abstracted. ;) The fix may be as simple as changing line 58 to accept all three allowed date formats, but I don't know whether there are other potential consequences of that change. It seems to be working fine for me, however.
Comment #6
antipex CreditAttribution: antipex commentedCommitted a fix for this.
Comment #8
nedjoThis formatter should support all three data formats, as do the core date formatters. Need to add back 'datetime' and add 'datestamp'. See
date_field_formatter_info()
.Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedAh... just facepalmed on this one again. After upgrading to the dev version and clearing my caches the formatter went away. I had to go into the code of the module and change line 58 back to 'datetime', because that is what my field is using.
Can we support *both* the date and datetime formats?
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commented...and by both (in #8) I mean all three as mentioned in #7.
Comment #11
tboornaz CreditAttribution: tboornaz commentedI change line 58 back to 'datetime', because that is what my field is using but I received the following error when I do. I tried to upgrade to the dev version and cleared my cache several times and I am still receiving the error. I even tried uninstalling and reinstalling the module but nothing worked.
Notice: Undefined offset: 0 in addtocal_field_formatter_view() (line 82 of /home/content/84/9602884/html/sites/all/modules/addtocal/addtocal.module).
Warning: array_key_exists() expects parameter 2 to be array, null given in addtocal_extract_event_info() (line 279 of /home/content/84/9602884/html/sites/all/modules/addtocal/addtocal.module).
Comment #12
paulap CreditAttribution: paulap commentedSame problems...
Comment #13
nedjoAttached patch should restore 'date' support and also adds 'datestamp'. I haven't however tested with a datestamp field.
Comment #14
tboornaz CreditAttribution: tboornaz commentedI just applied the patch cleared my cache. Set add to cal as the format. When I visited the node I received the following error.
Notice: Undefined offset: 0 in addtocal_field_formatter_view() (line 82 of /home/content/84/9602884/html/sites/all/modules/addtocal/addtocal.module).
Warning: array_key_exists() expects parameter 2 to be array, null given in addtocal_extract_event_info() (line 279 of /home/content/84/9602884/html/sites/all/modules/addtocal/addtocal.module).
Comment #15
antipex CreditAttribution: antipex commented#13: Thanks - I've applied the patch in 57f8e08.
#14: I believe the error message was due to a lack of content in your date field. I've fixed this in eb3ff00.
Comment #16
tboornaz CreditAttribution: tboornaz commentedI am sorry I am relatively new to drupal, you indicated that you fixed the problem in eb3ff00 and applied the patch in 578e08. What does that mean? Is that a patch? If so, how do I locate it to apply it? Thanks for your help!
Comment #18
BrightBold@tboornaz — those refer to the Git commits. If you wait a half-day or so after the fix is committed it usually gets rolled into a new dev version, so downloading the latest dev should get you access this fix.
Comment #19
bandanaman CreditAttribution: bandanaman commentedNot working with unix timestamp because date variables are unnecessarily converted
replacing
with
temporary fixes the problem, but module needs function to recognize date write type.
Comment #20
BrightBold@trueapart — don't forget to set the status back to "active" if you need to reopen an issue; otherwise the maintainers may never see your comment.
Comment #21
Simon Georges CreditAttribution: Simon Georges commentedLast comments are covered by #1953650: Dates in ical format registering as 1969.
Comment #22
SocialNicheGuru CreditAttribution: SocialNicheGuru commented