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

Undefined translation key when the licence of the diagram app is not valid #38

Closed
aubincleme opened this issue May 27, 2019 · 8 comments
Closed
Assignees
Milestone

Comments

@aubincleme
Copy link
Member

@aubincleme aubincleme commented May 27, 2019

When the diagram app has no valid license, the diagrams are replaced with an error macro with the a translated text under the key diagram.app.noValidLicense.

This key isn't defined.

@CamiAndrei
Copy link

@CamiAndrei CamiAndrei commented May 30, 2019

@aubincleme What do you mean by "the licence of the diagram app is not valid"?
Was the license never added or the license expired? Is there an other way to obtain a invalid license?
I tested with no license added and I obtained #39 .
Thanks.

Loading

@aubincleme
Copy link
Member Author

@aubincleme aubincleme commented May 31, 2019

Looking at the codebase, it seems that this translation key is actually defined somewhere in the app (DiagramMacro, line 245) and never translated :

caubin@t580:~/Projects/xwiki/pro/application-diagram/src/main (master=) % grep -R -n -A 5 -B 5 "diagram.app.noValidLicense"
resources/Diagram/DiagramMacro.xml-240-## don't have view right on those pages.
resources/Diagram/DiagramMacro.xml-241-#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference))
resources/Diagram/DiagramMacro.xml-242-  #executeDiagramMacro
resources/Diagram/DiagramMacro.xml-243-#else
resources/Diagram/DiagramMacro.xml-244-  {{error}}
resources/Diagram/DiagramMacro.xml:245:    {{translation key="diagram.app.noValidLicense" /}}
resources/Diagram/DiagramMacro.xml-246-  {{/error}}
resources/Diagram/DiagramMacro.xml-247-#end
resources/Diagram/DiagramMacro.xml-248-{{/velocity}}</code>
resources/Diagram/DiagramMacro.xml-249-    </property>
resources/Diagram/DiagramMacro.xml-250-    <property>

Loading

@aubincleme
Copy link
Member Author

@aubincleme aubincleme commented May 31, 2019

Looks like the licensor app provides good translation keys when no license is available.

Loading

@aubincleme
Copy link
Member Author

@aubincleme aubincleme commented May 31, 2019

So @CamiAndrei, the error itself is shown when

#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference))
returns false, IE when the extension isn't licensed AFAICS.

Loading

@CamiAndrei CamiAndrei self-assigned this May 31, 2019
@CamiAndrei
Copy link

@CamiAndrei CamiAndrei commented May 31, 2019

This issue was fixed in a08f72c. It looks like you don't have the latest sources of the application.

Loading

@aubincleme
Copy link
Member Author

@aubincleme aubincleme commented May 31, 2019

@CamiAndrei unfortunately, the commit that you mentioned (a08f72c) is actually the source of the problem :

It looks like you don't have the latest sources of the application.

Apparently no :

caubin@millenium:~/Projects/XWiki/xwiki-sas/application-diagram/src (master=) % git log | head
commit 6a0a9174668d263c7c6235ad148a51274df09d84
Author: Alex Cotiugă <alexandru.cotiuga@xwiki.com>
Date:   Wed Apr 10 22:23:16 2019 +0300

    [maven-release-plugin] prepare for next development iteration

commit ce74f429d7ab2517fb8606fcf66c59a67afff58b
Author: Alex Cotiugă <alexandru.cotiuga@xwiki.com>
Date:   Wed Apr 10 22:23:16 2019 +0300

caubin@millenium:~/Projects/XWiki/xwiki-sas/application-diagram/src (master=) % grep -R -n -A 5 -B 5 "diagram.app.noValidLicense"
main/resources/Diagram/DiagramMacro.xml-240-## don't have view right on those pages.
main/resources/Diagram/DiagramMacro.xml-241-#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference))
main/resources/Diagram/DiagramMacro.xml-242-  #executeDiagramMacro
main/resources/Diagram/DiagramMacro.xml-243-#else
main/resources/Diagram/DiagramMacro.xml-244-  {{error}}
main/resources/Diagram/DiagramMacro.xml:245:    {{translation key="diagram.app.noValidLicense" /}}
main/resources/Diagram/DiagramMacro.xml-246-  {{/error}}
main/resources/Diagram/DiagramMacro.xml-247-#end
main/resources/Diagram/DiagramMacro.xml-248-{{/velocity}}</code>
main/resources/Diagram/DiagramMacro.xml-249-    </property>
main/resources/Diagram/DiagramMacro.xml-250-    <property>

Loading

@aubincleme
Copy link
Member Author

@aubincleme aubincleme commented May 31, 2019

It's really an easy fix and maybe we shouldn't be wasting so much time on it. I'll make a PR at some point …

Loading

CamiAndrei added a commit to CamiAndrei/application-diagram that referenced this issue May 31, 2019
CamiAndrei added a commit to CamiAndrei/application-diagram that referenced this issue May 31, 2019
@CamiAndrei
Copy link

@CamiAndrei CamiAndrei commented May 31, 2019

Thanks for the clarification.

Loading

@CamiAndrei CamiAndrei closed this May 31, 2019
@acotiuga acotiuga added this to the 1.6.6 milestone Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants