XWIKI-19383: Display a title on createlink#2104
XWIKI-19383: Display a title on createlink#2104Sereza5 wants to merge 24 commits intoxwiki:masterfrom
Conversation
* Changed generation in the class editor on the platform
* Added an extension for rendering default behavior.
* Fixed wrong version tag
* Fixed wrong version tag
* Changed generation in the class editor on the platform
* Added an extension for rendering default behavior.
* Fixed wrong version tag
* Added an hint on the URITitleGenerator component
* Fixed the hint of the URITitleGenerator implementation
|
PR Changes:
NOTE: This commit needs to be merged with/after xwiki/xwiki-rendering#256 |
* Refactored name and fixed hint to match DocumentXHTMLLinkTypeRenderer in xwiki-render.
| <span class="wikicreatelink"><a href="$pageDoc.getURL('create')" | ||
| title="$services.localization.render('core.create.inline.label', [$title])">$title</a></span> |
There was a problem hiding this comment.
Wrong formatting + escaping missing.
| <span class="wikicreatelink"><a href="$pageDoc.getURL('create')" | |
| title="$services.localization.render('core.create.inline.label', [$title])">$title</a></span> | |
| <span class="wikicreatelink"> | |
| <a href="$pageDoc.getURL('create')" title="$services.localization.render('core.create.inline.label', [$title])">$title</a> | |
| </span> |
* Fixed escaping on title. * Properly formatted changes.
|
PR Changes:
|
| title="$services.localization.render('platform.', | ||
| ['#pageLink($translationsReference)']" |
There was a problem hiding this comment.
This looks wrong. The translation key is incomplete and there's a bracket missing.
| import org.xwiki.rendering.renderer.reference.link.URITitleGenerator; | ||
|
|
||
| /** | ||
| * Generate link titles for ATTACH URIs. |
There was a problem hiding this comment.
This doesn't match the class name. Is this about pages or attachments?
| * Generate link titles for ATTACH URIs. | ||
| * | ||
| * @version $Id$ | ||
| * @since 15.2RC1 |
| return this.contextLocalization.getTranslationPlain("core.create.inline.label", | ||
| attachmentReference.getName()); |
There was a problem hiding this comment.
I don't understand, you're returning "Create page: attachmentName"? Doesn't make any sense. Also bad formatting.
There was a problem hiding this comment.
| $escapetool.xml($pageReference) | ||
| #else | ||
| #set ($title = $escapetool.xml($pageDoc.plainTitle)) | ||
| #set ($title = $escapetool.velocity($pageDoc.plainTitle)) |
There was a problem hiding this comment.
This is wrong. You need XML escaping because you're printing the value below in HTML.
* Fixed indents * Fixed documentation * Fixed the ClassEditSheet.xml call.
|
Please add to the jira issue the exact WCAG problem (link to it) + mention if it's auto detected by Axe core or not, and if not, do we need to define a best practice for developers to avoid regressing on this (or other use cases) in the future. |
| * @version $Id$ | ||
| * @since 15.3RC1 | ||
| */ | ||
| @Component(hints = {"doc", "page"}) |
| public String generateCreateTitle(ResourceReference reference) | ||
| { | ||
| DocumentReference documentReference = | ||
| this.currentDocumentReferenceResolver.resolve(reference.getReference()); |
There was a problem hiding this comment.
This will only work for DocumentResourceReference and for other types, it'll cause a bug. For example SpaceResourceReference references won't be resolved correctly. Same problem for a page ResourceReference.
* Added implementations for other resource reference types. * Changed the l10n key names to be more specific TODO: * Fix tests
* Fixed the title on the wrong object in ClassEditSheet.xml * Took care of different cases in XWikiAttachmentWantedLinkTitleGenerator and XWikiDocumentWantedLinkTitleGenerator
michitux
left a comment
There was a problem hiding this comment.
There is one missing escaping (see comment). I'm not 100% sure regarding the different resolver implementations but it looks good.
| #set ($class = 'wikicreatelink') | ||
| #set ($action = 'create') | ||
| #set ($discard = $params.put('parent', $doc.fullName)) | ||
| #set ($title = $services.localization.render('core.create.inline.label',[$reference.name])) |
There was a problem hiding this comment.
Missing escaping (either here or where it is used).
* Escaped properly a title
* Updated since versions


Jira: https://jira.xwiki.org/browse/XWIKI-19383
See xwiki/xwiki-rendering#256 for the changes on xwiki-rendering.
PR Changes:
URITitleGenerator