openjournals/inara

Empty metadata time values

xuanxu opened this issue · 1 comments

When using inara to create a draft, published_at metadata will have no value, and sometimes submitted_at will also be empty.
Now when any of these values are null or an empty string this error is happening in the time filter:

[INFO] Running filter /usr/local/share/openjournals/data/filters/time.lua
Error running filter /usr/local/share/openjournals/data/filters/time.lua:
/usr/local/share/openjournals/data/filters/time.lua:8: bad argument #1 to 'for iterator' (table expected, got string)
stack traceback:
	[C]: in function 'next'
	/usr/local/share/openjournals/data/filters/time.lua:8: in upvalue 'copy_string_values'
	/usr/local/share/openjournals/data/filters/time.lua:21: in function 'Meta'

Inara should accept nil published_at/submitted_at values and compile the paper with an empty value there.

Made a view changes that should fix this. We still require the values to be set somewhere, but now provide default values in the config.