arturobernalg opened a new pull request, #536: URL: https://github.com/apache/jspwiki/pull/536
https://issues.apache.org/jira/browse/JSPWIKI-647 A page alias, set with `[{SET alias='PageName'}]`, did not redirect when the page cache was disabled (`jspwiki.cache.enable = false`; the reporter used the deprecated `jspwiki.usePageCache`). The `alias` and `redirect` page attributes are set by the markup parser. `CachingProvider` parses a page it has just fetched so that those attributes exist, but without the page cache that provider is not used, so `WikiContext#getRedirectURL()` found no alias. As the comments on the issue suggest, the difference is `CachingProvider#refreshMetadata`. `WikiContext#getRedirectURL()` now parses the page for its metadata when the page has none. Only the redirect lookup pays for the parse, and a cached page already has its metadata, so nothing changes with the cache enabled. `PageAliasTest` saves a page with an alias and checks that its redirect URL is the view URL of the target, with and without the page cache. The test without the cache failed before the change (the redirect URL was `null`) and passes with it. The `jspwiki-main` test suite passes (930 tests). Calling the parse from `PageManager#getPageInfo` would also fix it, but it would parse every page that is looked up without the cache, for example for the recent changes list, so I limited it to the redirect lookup. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
