Is there any way to know when a profile was last updated (equivalent of 'changed' value for nodes). The use case is to display when a profile was last updated and show how current it is.

Comments

fago’s picture

Category: support » task

No, currently not. However I agree that we should keep that date, as well as a creation date.

scor’s picture

Should that be pushed to entity API to have some more generic metadata on all entities?

geerlingguy’s picture

I would really like this feature as well, as it would help in synchronizing data on the drupal site with external systems that aren't well-built (many Churches and nonprofits I work with use Excel or other weak member storage systems and manually synchronize data based on updated dates. Even though it's silly, this would help them a lot).

geerlingguy’s picture

It seems Node module currently has to do the date stuff on it's own, but if Entity API could handle dates and revisioning for all entities, that would be a bonus. I wouldn't hold my breath, though :)

MacRonin’s picture

Just another person mentioning that I would find having the updated/created date to be a very useful addition.

While including as part of the Entity code would probably be the most generic(and beneficial) solution. Since Entity has a whole bunch of things in their wish-list, as @geerlingguy mentions it probably won;'t be happening at that level anytime soon.

Personally I'd like to have that info ( updated/created date ) for each field but I'm not that greedy :-)

geerlingguy’s picture

For field data, the Profile2 Revisions module might be able to help - aren't field API fields' revisions stored with a time stamp? Anyways, node.module handles the updated column itself... So yeah, not thinking Entity API will do this soon.

MacRonin’s picture

Thanks @geerlingguy I didn't know about the 'Profile2 Revisions module'

I took a quick search and didn't see it, but I'll look deeper in case it's part of a general Revision, Diff or Entity project

fourmi4x’s picture

I counld't find the "Profile2 Revisions module" either.

I agree that having the creation date, at least, would be great.

In fact, I badly need this... Any idea how I could get it, even if it's not a very "clean" way ?

EDIT: Ok I just created a date field with default value "Now" on the profile...

geerlingguy’s picture

Oh... I actually meant User revision, though if Entity API supported revisions (#996696: Support revisions in Entity API), then this would all be a bit easier.

scor’s picture

EDIT: Ok I just created a date field with default value "Now" on the profile...

This will work for "Creation date" but for last updated date, you will need to update that field value programmatically on entity save.

fourmi4x’s picture

Yep, but I just needed the creation date.
I guess using the Computed field module would do it for an updated date field.

a.siebel’s picture

I think a "updated" field would be very important - I have an adressbook filled with uder profiles - Without "Updated date" field users have no information when the adress was last updatet.

fago’s picture

Status: Active » Fixed

I've implemented that (created + changed) as usual with regular entity properties. For existing profiles the values will be just NULL, while upon edit the changed date is going to be set.

Of course, those properties are also available in views, rules, search api, as tokens, ...

geerlingguy’s picture

Thank you, fago!

scor’s picture

Status: Fixed » Closed (fixed)

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