Details
-
Bug
-
Resolution: Fixed
-
Blocker
-
17.9.0-rc-1
-
Unknown
-
N/A
-
N/A
-
Description
Steps to reproduce
- Request the REST resource of an extension whose versions are stored in dedicated version pages, without a version: e.g. https://extensions.xwiki.org/xwiki/rest/repository/extensions/org.xwiki.platform:xwiki-platform-image-style-rest
Expected results
The extension metadata (id, name, summary, authors, properties, etc.) is returned, as it is for extensions which don't use version pages (e.g. https://extensions.xwiki.org/xwiki/rest/repository/extensions/org.xwiki.contrib:application-xambox).
Actual results
An HTTP 500 error is returned:
jakarta.servlet.ServletException: javax.servlet.ServletException: java.lang.IllegalArgumentException: An Entity Reference name cannot be null or empty
Analysis
ExtensionRESTResource calls AbstractExtensionRESTResource#createExtension(extensionDocument, null), a null version meaning "no specific version". Since XWIKI-14136, createExtension always starts by resolving the version document with ExtensionStore#getExtensionVersionDocument(extensionDocument, version, xcontext). When the extension uses version pages, that builds a PageReference named after the version, which fails for a null version. The version document is only needed for the dependencies, which are only computed when a version is given, so it should only be resolved in that case.
Regression introduced by XWIKI-14136 (same origin as XWIKI-23996, which fixed the /extensions listing). The endpoint is not used by the XWiki extension repository client, so this only affects direct REST users. Found while investigating XWIKI-25602.
Attachments
Issue Links
- is caused by
-
XWIKI-14136 Dedicate a different page for each version of the extension in the Repository
-
- Closed
-
- relates to
-
XWIKI-23996 Repository /extensions/ REST endpoint return the wrong values
-
- Closed
-
-
XCOMMONS-3863 "Failed to get remote extension from repository" NPE warning after starting an XWiki instance
-
- Closed
-