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

View import fails when selection formula includes @Now #255

Open
jesse-gallagher opened this issue Jan 18, 2021 · 1 comment
Open

View import fails when selection formula includes @Now #255

jesse-gallagher opened this issue Jan 18, 2021 · 1 comment
Labels
bug Something isn't working odpcompiler ODP compiler implementation and servlet

Comments

@jesse-gallagher
Copy link
Member

I observed this in the OpenNTF XSnippets app. Its selection formula is:

SELECT ((Form = "Log") & (DOWNLOADTYPE = "snippet") & ((@Date(@Now) - @Date(Date)) )/86400 >= 90)

On import, this leads to:

[INFO] Caused by: com.darwino.domino.napi.DominoException: Signature on document is invalid (inconsistent field signatures)
[INFO] 	at com.darwino.domino.napi.DominoAPIImpl.NSFNoteSign(Native Method)
[INFO] 	at com.darwino.domino.napi.wrap.NSFNote.sign(NSFNote.java:1078)
[INFO] 	at org.openntf.nsfodp.compiler.ODPCompiler.importDxl(ODPCompiler.java:855)
[INFO] 	at org.openntf.nsfodp.compiler.ODPCompiler.importBasicElements(ODPCompiler.java:577)
[INFO] 	... 9 more

This appears to be specifically due to the presence of @Now somehow. If I change it to reference a field name (say, just Now), it compiles without issue.

Since this is almost definitely an underlying problem, the options are limited. One potential, extremely-ugly workaround would be:

  1. Look for @Now in the selection formula before import
  2. Stash the value and set the formula to e.g. SELECT @All
  3. Open the view post-import, set the formula programmatically, and re-save
@jesse-gallagher jesse-gallagher added bug Something isn't working odpcompiler ODP compiler implementation and servlet labels Jan 18, 2021
@jesse-gallagher
Copy link
Member Author

I could also lower the severity of NSFNoteSign exceptions to a logged warning or error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working odpcompiler ODP compiler implementation and servlet
Projects
None yet
Development

No branches or pull requests

1 participant