I'm not crazy... Date and Views hate each other!

Events happening in the community are now at Drupal community events on www.drupal.org.
trista13's picture

After having my site really messed up (WSOD messed up) twice, I started to look into calendar, dates and views more to see if anyone else is having an issue and I found this http://drupal.org/node/1066690. It looks like they're going to be rebuilding the date module to work better with views (sigh of relief!). Anyone else seeing problems with Date, Views and Calendar in Drupal 7?

Comments

You're not alone...

scottrouse's picture

I've run into the same issue(s) this morning while trying to set up a calendar display on a fresh Drupal 7 site. It used to work...sort of. But, because I'm using the dev version of Views, one of the more recent updates completely broke the way Date/Calendar integrates. So...I've just got to put off my Calendar plans for a bit until some progress is made on the Date/Calendar modules.

I'm so glad it's not just me!

trista13's picture

I'm so glad it's not just me! I was practically pulling my hair out yesterday.

Oh, and I got my certificate in the mail a few days ago... Thanks!

Yay

scottrouse's picture

Glad you got your cert. Thanks.

Back in Drupal 6

niels's picture

This may or may not be related but I am working with a Date field in user profiles. I would like to sort a user list on the date field from the profile but it will not show up. I am using it in Fields but no dice on the Sort Criteria. Any thoughts would be appreciated.

How's the arm?

Related

scottrouse's picture

It is, indeed, related. The recent changes to the Views API renders the Date fields unusable as filters, sorting criteria, arguments, etc. Bummer. :-(

Type first...ask questions later.

scottrouse's picture

I see now that your issue may be about Drupal 6 rather than Drupal 7. Is that accurate?

If so, we should be able to sort by that date field in Drupal 6. Is that field part of the core user profile or provided by the Content Profile module? If it's part of the core user profiles, I believe it is difficult (if not impossible) to access those fields in Views. That's why the Content Profile module became popular.

I think I'm getting it...

niels's picture

I was indeed mixing up the core user profile and the content profile. I'm beginning to understand how the Drupal API can confuse you when everyting get woven together so nicely.

I agree! It's really

trista13's picture

I agree! It's really complicated troubleshooting when you have so many contrib modules working together plus Drupal core. Had an issue today and wasn't sure if it was Drupal, WYSIWYG or CCKeditor. Glad your issue is resolve... I'm just waiting for the dates module to be updated to work with the new Views.

My arm is doing great by the way. My last x-ray looked so much better and I've managed to work out typing with two hands :)

Hope all is well at UM.

X-Ray

scottrouse's picture

Glad your x-ray is looking better. I was worried when I saw that last one!

Hey Scott, I uploaded the new

trista13's picture

Hey Scott,
I uploaded the new dev versions of dates and calendar, but I'm still getting lots of error messages and some of the stuff in views isn't working. Have you had any luck with those modules or are you getting some funkiness still?
Thanks!!

Still broken...

scottrouse's picture

I haven't tried in the past few days, but I believe Drupal 7 Date/Calendar + Views may be broken for a while still.

I keep checking the commits for Date and Calendar occasionally. You may see a fix end up in there.

Dates

pschwede's picture

First time doing this and new to Drupal. I am using Drupal 7. I have a page where I'm sorting the data by date, ascending order. It appears to be sorting by the date it was posted. Any ideas? I have looked through the help, but to no avail. BTW: I am not working on my local PC. We access the modules, etc., through the server.

The default behavior is to

scottrouse's picture

The default behavior is to sort by date posted. Remove the Content: Post date from the Sort Criteria. Add the date field by which you'd like the content sorted as a Sort Criteria.

That's it.

Reply

pschwede's picture

Thanks for your help. I have tried a few things. I removed the filter criteria. I have "Fields: field_jf_date_beg_time (asc) " in sort criteria. It still sorts by the default. Do I have to add a contextual filter?

A contextual filter would

scottrouse's picture

A contextual filter would allow an argument in the URL to be the filter, which doesn't sound like what you want here. Can you take a screen shot of your View or paste the exported View here in code tags on on PasteBin?

how do I do that. I don't see

pschwede's picture

how do I do that. I don't see PasteBin

PasteBin

Code

pschwede's picture

Query

SELECT field_data_field_jf_date_beg_time.field_jf_date_beg_time_value AS field_data_field_jf_date_beg_time_field_jf_date_beg_time_val, node.nid AS nid
FROM
{node} node
LEFT JOIN {field_data_field_jf_date_beg_time} field_data_field_jf_date_beg_time ON node.nid = field_data_field_jf_date_beg_time.entity_id AND (field_data_field_jf_date_beg_time.entity_type = :views_join_condition_0 AND field_data_field_jf_date_beg_time.deleted = :views_join_condition_1)
ORDER BY field_data_field_jf_date_beg_time_field_jf_date_beg_time_val ASC
LIMIT 10 OFFSET 0

The query appears correct,

scottrouse's picture

The query appears correct, but I'd like to see the Views export text. Are you able to export the View?

I had the same problem...

trista13's picture

So, to set this up, you need to go to the view and then add a filter criteria with Date: Date node and then select the content type (I think the content types will be different depending upon what you've set up). Once you have that, go into the settings and select the field you want to sort by date. Again, I think this depends on how you set up your fields with each content type. I'm still pretty new to Drupal, so I don't know how helpful that is, but let me know if you have any questions or want more details.

Paste Bin

pschwede's picture

When I go to my paste bin how do I attach a copy of my screen?

If I am understanding you correctly...

opegasus's picture

This is a blockquote from Andy Laken on another thread:

Christopher, thanks for taking the time to document your process for the community. Getting it out here helps people who may have similar issues find and benefit from your work.

Just wanted to offer a hint - if you're taking the trouble to make screenshots to illustrate your post, you can embed them directly in your page just by using Only local images are allowed. tags, like I did in this old post: http://groups.drupal.org/node/17151

The image tags couldn't be simpler, e.g. <img src="http://img.skitch.com/20081130-ei2me2aj96tkxt2eea39qxytin.preview.jpg"  /> [to show the code like on the left one puts the code in [<code>] tags ] if you just put that code (line above) of image in by it's self (no code tags but just image -img- tags) one gets the actual image, below (as long as it is being hosted/served properly).

Only local images are allowed.

Just make sure to use a screenshot hosting service that will hopefully be around for a long time!

~ CCC
P.S. The >Input Format at the bottom of these individual reply boxes has the allowable HTML code we can use.

Difference between Pastebin and screen shots

laken's picture

On pastebin you don't attach a copy of your screen. Pastebin is a convenient way for storing and sharing text, most often programming code. Often in a conversation like this we'll ask you to put some text (like the contents of your settings.php file, a Views export, or a SQL query) into Pastebin and share the link here – it's a quick way to look at the details without pasting tons of text into these posts themselves (though that can work as well sometimes). Pastebin is so easy, you just copy the text you want to paste onto your clipboard, go to http://pastebin.com , paste the text into the big form, set optional paste settings, and click submit - you've just created a new web page with your paste, with its own URL. Then just copy the URL from your browser address bar and paste it here, into an email, wherever you want to share it.

Sometimes you want to share an image of your screen rather than pasted text. There are many ways to grab images of your screen (called screenshots or screengrabs). There are typically 3 steps to sharing screenshots: 1) Grabbing the area of the screen you want, 2) Optionally annotating the screenshot with explanatory text, arrows, etc 3) Uploading the image to the web somewhere so it can be shared easily. In the past 3) was a big pain, but recently there have been a number of services that make it almost instant.

Solutions differ depending on your platform: Mac, Windows, and Linux. Which platform are you on?

I'm on a Mac, and the two I use are Skitch and Cloud.app. Skitch is awesome and offers all 3 of the features above. Cloud.app doesn't do annotations, but the grab/upload experience is only a single step, which is hugely convenient, so I use that when I don't need to annotate. These are both free services. If you're on a Mac I'd say: get skitch, take 10 minutes to figure it out, and you're done.

I can't personally speak to Windows or Linux solutions, but Christopher Cable (opegasus on this group) is using Jing for Windows, which seems to offer similar functionality.

You'll need to invest a little time into learning and setting up the tool you choose. The thing to remember is to get a tool that allows frictionless upload of your screenshots to an online service, and an easy way to get the link to the posted image so you can pate it into an email or post. For instance, I just used Skitch to grab part of my screen, add annotations, and with 1 button uploaded it to skitch.com and got the link. Here it is: https://skitch.com/alaken/ghdjj/preview-comment-drupal-groups

When participating in a community like Drupal it's really helpful to get fluent with tools like Pastebin and the screenshot sharing tools – they can help you describe your problem very quickly, and make it easier for others to help you. And conversely, they can be effective tools to offer help to others (see this example of how I used Skitch to explain a complex series of steps in a post on this site.)

Hope that helps!

– Andy

PasteBin is just a website at

scottrouse's picture

PasteBin is just a website at which people can paste blocks of text (typically code) so it is formatted for easy reading and editing by others. A Christopher mentioned, there are a number of screenshot tools that allow one to take pics of their screen and host those files online.

You could just take a screenshot (Cmd+Shift+3 on a Mac or PrintScreen and then paste it into a document on a PC) and attach the resulting file to one of these comments or use a third-party service.

Chistopher uses Jing. I like Skitch (Mac only). There are other options available, I'm sure.

Back to the point, though...I wasn't really looking for a screenshot. I was looking for an export of your View. That would be a big block of text...hence my recommendation you use PasteBin or similar tool. Just look for the Export link in your View.

Reply

pschwede's picture

I was able to export a view to pastebin. Do you see it.

You'll need to provide the

scottrouse's picture

You'll need to provide the URL of the PasteBin. It will look something like http://pastebin.com/jsR0vawY.

See Pastebin instructions above

laken's picture

I mentioned how to do this in my post above:

Pastebin is so easy, you just copy the text you want to paste onto your clipboard, go to http://pastebin.com , paste the text into the big form, set optional paste settings, and click submit - you've just created a new web page with your paste, with its own URL. Then just copy the URL from your browser address bar and paste it here, into an email, wherever you want to share it.

Still don't work

pschwede's picture

Will there be any updates to the dates module for Drupal 7 coming out soon?

Updates come out...when they come out but...

opegasus's picture

...one can visit a specific module's project page http://drupal.org/project/date anytime we wish to read about that module, any updates and patches, commits, etc. http://screencast.com/t/cxgwAdOHgBY

You can even chime in on issue/bugs if you encounter any.

Sort criteria within Calendar view not working..

jdrefahl's picture

Sure it seems to work just fine when you are sorting by Event Date.. but my client is requesting the ability to order the events through the admin. In order to do this I just added a Weight field within the Content Type. Now, it should be simple and straight forward.. Under the sort criteria I get rid of the default and I added the "event: weight" and set it to ascending.

Even if its set up in the view correctly, and double checked that nothing was overriding it by zeroing out all the sort criterias on all the views (Month/Week/Day/Year/Upcoming).

Flushed the caches, and refreshed..

The sort by weight isn't working.. It continues to sort by event date which I believe is the default behavior. Is there anyone else experiencing this problem? My next attempt was going to be upgrading the Calendar/Event modules to the dev versions, but based on what I have read here.. that may break it even more.

Has anyone else had this problem with the Drupal 7 Calendar?

Hmm...not sure. This is a

scottrouse's picture

Hmm...not sure. This is a pretty old thread, so the original bugs we were discussing are likely resolved or irrelevant, but that doesn't mean that you haven't found a problem.

You might want to post an issue on the queue for the Calendar module to get the most attention. I'm not sure I have enough information from your post to reproduce the issue, but I'll give it a try.

Western Montana

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week