openjournals / inara

Tools to create JOSS/JOSE publishing artifacts
MIT License
27 stars 17 forks source link

Empty metadata time values #2

Closed xuanxu closed 1 year ago

xuanxu commented 2 years ago

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.

tarleb commented 2 years ago

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.