Problem with date field in Advanced Search

164 views
Skip to first unread message

Makeda M.

unread,
Jun 10, 2013, 4:25:10 PM6/10/13
to resour...@googlegroups.com
I foolishly deleted the Global default Date field while creating some custom fields. 

In trying to fix the issue, I recreated the global Date field, mapped it to the EXIF fields DateTimeOriginal and createdate, and changed 
# Searchable Date Field: $date_field=12; to reference the newly created date field (which has an id of 90). This had the wonderful effect of creating a 2nd date field in the advanced search, which still doesn't work. Every time I try to search for a resource by year (any month, any day) in the Advanced Search, it just returns all resources with any date at all.

Anyone have any ideas as to how to fix this?

I've searched the group for a similar issue with no luck.
Thanks in advance for any tips or ideas.

Makeda

Allison Stec

unread,
Jun 11, 2013, 7:59:26 AM6/11/13
to ResourceSpace
It sounds like there may not be any data in the new field. You can check this by typing "!empty12" into the simple search. This will look for resources without data in the date field. If the number of resources returned from the search is similar to the number of resources in the system it means the creation date data needs to be reimported.

Regardless of the results above you should verify that the recreated field exactly emulates the original with the information below (commas separate values):
12,date,Date,4,,80,1,0,0,creation_date,1,1,2#055,,,0,,DateTimeOriginal,0,0,,0,1,,0,0,"if ($value!=''){$value=nicedate($value,false);}",,,,,,

If it looks as though there is not data in the db for creation date, run "../pages/tools/update_exiftool_field.php?fieldrefs=12"
This will populate the field with exisiting data found in your current resource library.



Makeda

--
You received this message because you are subscribed to the Google Groups "ResourceSpace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Makeda M.

unread,
Jun 11, 2013, 10:40:36 AM6/11/13
to resour...@googlegroups.com
Hi Allison,

Thanks for responding.
To make things simpler, I deleted all the resources I had without any date info. (I did run the update_exiftool_field script, but this just wrote blank date information into all my resources). I then uploaded 4 new resources, and it seems that now that the original 'by date' field in the Advanced Search is functional.

But the 2nd Date field - the one with a field ID of 90 - does not work. Selecting any year returns all resources.
In my Metadata Report, DateTimeOriginal is mapped to the Date field with the field ID of 90.

It's not really a solution, but I've hidden the 2nd Date field from the Advanced Search now that the original one is working. It will continue to index the dates but won't be visible to the user.


And I've learned my lesson: never delete an original field - just hide it.

Allison Stec

unread,
Jun 11, 2013, 10:53:37 AM6/11/13
to ResourceSpace
I mis-read your initial post. I had read that you attempted to adjust the newly created date field to match the standard field that went missing, hence referencing the original field ID.

If the original date field (12) is functioning properly you should consider removing your redundant field (90) as it will just bloat your db.


Makeda M.

unread,
Jun 11, 2013, 11:10:33 AM6/11/13
to resour...@googlegroups.com
The original date field may be functioning properly, but it doesn't appear as a field in my System Setup area, and as far as I can tell, my redundant field is being mapped to DateTimeOriginal, so I'm reluctant to get rid of it. 

I lack the required knowledge to do anything to the db, but I'll see if someone else in the department can investigate more thoroughly.

Thanks for your help, Allison.

Makeda M.

unread,
Jun 11, 2013, 3:28:06 PM6/11/13
to resour...@googlegroups.com
Problem solved! One of our developers was able to look up the field in the db and correct the issue based on your info, so everything is working again. 
Thanks again for your help!

Allison Stec

unread,
Jun 11, 2013, 3:33:14 PM6/11/13
to ResourceSpace
happy to help!
Reply all
Reply to author
Forward
0 new messages