Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying resource doesn't update it's last updated timestamp #1874

Closed
Zharktas opened this issue Aug 7, 2014 · 5 comments · Fixed by #2519
Closed

Modifying resource doesn't update it's last updated timestamp #1874

Zharktas opened this issue Aug 7, 2014 · 5 comments · Fixed by #2519
Assignees

Comments

@Zharktas
Copy link
Member

Zharktas commented Aug 7, 2014

Resources show their creation date and last updated date which are the same. If the resource is modified, the last updated date should change but it is not updated.

@wardi
Copy link
Contributor

wardi commented Sep 11, 2014

related to #1567 and would be fixed if I change #1921 to add the last_modified field to resource_show. Is there a reason this field wasn't included in resource_show?

@amercader
Copy link
Member

'last_modified' in not set anywhere in CKAN core, this was (or is) supposed to be set by extensions like ckanext-archiver. If I'm not mistaken it refers to changes on the original file, not the CKAN resource metadata, so it looks like there is more work involved than originally thought.

Moving to 2.4.

@amercader amercader modified the milestones: CKAN 2.4, CKAN 2.3 Nov 4, 2014
joetsoi added a commit to joetsoi/ckan that referenced this issue Feb 5, 2015
Just test that the homepage runs fine with the middleware actiavted
joetsoi added a commit to joetsoi/ckan that referenced this issue Feb 5, 2015
Just test that the homepage runs fine with the middleware actiavted
@wardi wardi self-assigned this Jun 25, 2015
@wardi
Copy link
Contributor

wardi commented Jun 25, 2015

I think we should update this value when users upload files too. It's displayed to end users as the resource's "last updated" date, and users expect that date to change when they upload a new file.

@augusto-herrmann
Copy link

I think the meaning and presentation of the fields should be more clear and consistent.

last_modified: the date and time when the actual data has been last changed
revision_timestamp: the date and time when the resource metadata has been last changed

If this is the correct meaning for the fields, the visual label on the templates for the resource should be consistent with that:

last_modified -> "Data last updated"
revision_timestamp -> "Metadata last updated"

Currently these fields are used interchangeably to display the same label "Last updated". See

<td>{{ h.render_datetime(res.last_modified) or h.render_datetime(res.revision_timestamp) or h.render_datetime(res.created) or _('unknown') }}</td>
https://github.com/ckan/ckan/blob/master/ckan/templates/package/resource_read.html#L158

@dmichelakis
Copy link

I just noticed that the last modified date does not update when editing or replacing a link in a resource but does change when editing or replacing a file. Is this a bug or is this suppose to happen?

jrdh added a commit to NaturalHistoryMuseum/ckanext-versioned-datastore that referenced this issue Aug 15, 2019
Turns out last_modified is only updated during a new file upload* which
makes sense once you learn that the last_modified attribute on resources
is meant to indicate when the *data* was last updated, not the metadata.
For the metadata the last_modified attribute isn't updated but the
revision timestamp is. Luckily the revision timestamp is also updated
when a new file is uploaded so we can use that for everything.

See this issue for info on the last_modified/revision timestamp
difference: ckan/ckan#1874.

*this doesn't apply if you change the url, only if you upload a file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants