Starting alps for my server using go run ./cmd/alps z3ntu.xyz
results in the error message
FATAL failed to load templates: failed to load theme "alps": template: update-address-object.html:29: function "join" not defined
I see that the join
template function gets defined in plugins/carddav/plugin.go
and I'm not sure but I think the carddav plugin doesn't get loaded for me so this function which is used in the base theme isn't defined.
Actually reading the log is also useful: the carddav and caldav plugins don't load for me (missing configuration) which is why the function never gets defined.
2020-05-21T21:37:46Z - Configured upstream IMAP server: imaps://mail.z3ntu.xyz:993 2020-05-21T21:37:46Z - Configured upstream SMTP server: smtp://mail.z3ntu.xyz:25 2020-05-21T21:37:46Z - Loaded plugin "base" 2020-05-21T21:37:46Z - caldav: failed to discover CalDAV server: discovery not yet implemented 2020-05-21T21:37:46Z - carddav: failed to discover CardDAV server: carddav: domain doesn't have an SRV record 2020-05-21T21:37:46Z - Loaded plugin "viewhtml" 2020-05-21T21:37:46Z - Loaded plugin "viewtext" 2020-05-21T21:37:46Z - Loading theme "alps" 2020-05-21T21:37:46Z FATAL failed to load templates: failed to load theme "alps": template: update-address-object.html:29: function "join" not defined exit status 1
Ah indeed that makes sense. I forgot that Go checks functions at template compile-time.
Not sure how to fix this.
I got hit by this one too, to get past it I changed the join function call to a slice. The next error it then throws up is for the functions
formatinputdate
andformatinputtime
as a temporary measure I just copied the functions into the base plugin template.go in order to get it running. I've been mulling over the best way to address it before sending in a patch.I can send a simple patch for join -> slice as a start if you'd be happy with that though.
Pushed a workaround. Opened https://todo.sr.ht/~emersion/alps/99 to figure out a proper solution.