| XWikiDocument#getLocalReferenceMaxLength() and its script counterpart Document#getLocalReferenceMaxLength() (used as $doc.localReferenceMaxLength) return the maximum length of a document local reference, i.e. the size of the database column storing a document's full name. This limit comes from the store and is the same for every document of a wiki, so it shouldn't be exposed on the document. Proposal:
- Add XWiki#getDocumentLocalReferenceMaxLength(XWikiContext) and its script API counterpart $xwiki.getDocumentLocalReferenceMaxLength(), next to getDocumentTitleMaxLength() added by XWIKI-14197.
- Deprecate XWikiDocument#getLocalReferenceMaxLength() and Document#getLocalReferenceMaxLength() in favor of them, and move them to the legacy modules.
- Migrate the callers (createinline.vm, XWiki#prepareDocumentForSave, CreateActionRequestHandler#isDocumentPathTooLong).
See the discussion on https://github.com/xwiki/xwiki-platform/pull/6489 |