Today I was testing the initial D6 port of Auto Expire and I figured that it needs Views integration... so I went ahead and did it. I'm only attaching a .zip with the complete altered module (based on the D6 version found at http://drupal.org/node/313280#comment-1484562) because WinMerge doesn't allow me to create proper patches when new files are added.

I added a couple of lines of code to auto_expire.module (an implementation of hook_views_api) and added two new files: auto_expire.views.inc and views_handler_field_auto_expire_link_extend.inc (I know, it's a long file name, but it follows the pattern of similar files). I didn't have to change any of the existing code, so this patch can be easily re-rolled in case of changes to the D6 port.

In views, this provides the following features:
- Filters: expiration date (date), extended (integer), warned (boolean)
- Fields: expiration date (date), extended (integer), warned (boolean), extend (link to node/[nid]/expiry, only when _auto_expire_can_user_extend() returns true)

I'm curious to read your reactions.

CommentFileSizeAuthor
auto_expire_views.zip21.8 KBmarcvangend

Comments

liliplanet’s picture

Fantastic! thank you, it works perfectly ..

skizzo’s picture

I was going to file a feature request for that... but it's there already! :-)
and so far It's working fine for me too. Thank you.

marcvangend’s picture

Status: Needs review » Reviewed & tested by the community

Two positive reviews and no problems so far... setting this to RTBC.

marcvangend’s picture

Version: 5.x-1.x-dev » 6.x-1.0-rc1
Status: Reviewed & tested by the community » Fixed

committed to 6.x-1.0-rc1.

jfmoore’s picture

Thanks for the update. Just what I needed. I don't see a way, however, to display the expiration date in the node. Am I missing something, or is this not possible?

marcvangend’s picture

You mean that you want to display the expiration date on the node page, ie. www.example.com/node/123? Currently, the expiration date is not read from the database when a node is loaded. It wouldn't be too hard to do this. Can you please open a new issue for this?

jfmoore’s picture

You mean that you want to display the expiration date on the node page, ie. www.example.com/node/123? Currently, the expiration date is not read from the database when a node is loaded. It wouldn't be too hard to do this. Can you please open a new issue for this?

Done. And thanks for the module!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.