XWiki.SharePage: Deprecated usage of getter [com.xpn.xwiki.api.DeprecatedContext.getUser]

Hi.

When users like to share articles with users we have the following warnings in the log files:

WARN  o.a.v.introspection            - Deprecated usage of getter [com.xpn.xwiki.api.DeprecatedContext.getUser] in XWiki.SharePage@1,29
WARN  o.a.v.introspection            - Deprecated usage of getter [com.xpn.xwiki.api.DeprecatedContext.getUser] in XWiki.SharePage@5,46
WARN  o.a.v.introspection            - Deprecated usage of getter [com.xpn.xwiki.api.DeprecatedContext.getUser] in XWiki.SharePage@8,59
WARN  o.a.v.introspection            - Deprecated usage of getter [com.xpn.xwiki.api.DeprecatedContext.getUser] in XWiki.SharePage@31,118
WARN  o.a.v.introspection            - Deprecated usage of getter [com.xpn.xwiki.api.DeprecatedContext.getUser] in XWiki.SharePage@5,57
WARN  o.a.v.introspection            - Deprecated usage of getter [com.xpn.xwiki.api.DeprecatedContext.getUser] in XWiki.SharePage@8,62
WARN  o.a.v.introspection            - Deprecated usage of getter [com.xpn.xwiki.api.DeprecatedContext.getUser] in XWiki.SharePage@34,121

And these messages too:

WARN  o.a.v.introspection            - Deprecated usage of getter [com.xpn.xwiki.api.DeprecatedContext.getUser] in jar:file:/data/xwiki/data/extension/repository/org%252Exwiki%252Eplatform%253Axwiki-platform-sharepage-api/17%252E10%252E13/org%252Exwiki%252Eplatform%253Axwiki-platform-sharepage-api-17%252E10%252E13.jar!/templates/shareinline.vm@5,57
WARN  o.a.v.introspection            - Deprecated usage of getter [com.xpn.xwiki.api.DeprecatedContext.getUser] in jar:file:/data/xwiki/data/extension/repository/org%252Exwiki%252Eplatform%253Axwiki-platform-sharepage-api/17%252E10%252E13/org%252Exwiki%252Eplatform%253Axwiki-platform-sharepage-api-17%252E10%252E13.jar!/templates/shareinline.vm@8,62
WARN  o.a.v.introspection            - Deprecated usage of getter [com.xpn.xwiki.api.DeprecatedContext.getUser] in jar:file:/data/xwiki/data/extension/repository/org%252Exwiki%252Eplatform%253Axwiki-platform-sharepage-api/17%252E10%252E13/org%252Exwiki%252Eplatform%253Axwiki-platform-sharepage-api-17%252E10%252E13.jar!/templates/shareinline.vm@32,121

Regards, Simpel

From what I can see, the German translation in XWiki.SharePage uses $context.user (deprecated) instead of $xcontext.user.
This can easily be fixed by updating the translation in https://l10n.xwiki.org/

I’ll open a jira and fix it along with other discrepancies:

And several other problems.

I wonder why the english original uses the deprecated one too. So no wonder that it’s used in the translation. I will fix this on Weblate.

Hm, I tried it with a local translation:

myhomepage=$xwiki.getDocument($xcontext.user).display("first_name", "view", $xwiki.getDocument($xcontext.user).getObject("XWiki.XWikiUsers", 0))s Profil

Not working. Error messages stay the same.

So I won’t change anything in the german translation yet.

PR to review at XWIKI-25040: The Share Page email templates are inconsistent between languages by vmassol · Pull Request #6510 · xwiki/xwiki-platform · GitHub

The following issues have been fixed: