Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25263

Move getLocalReferenceMaxLength() from XWikiDocument to XWiki

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 18.9.0-rc-1
    • 11.4
    • Old Core
    • None
    • Unknown

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: