Rotating virtual URI mapping does not return expected values
-------------------------------------------------------------
Key: MAGNOLIA-3321
URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-3321
Project: Magnolia
Issue Type: Bug
Components: core
Affects Versions: 4.3.7
Reporter: Antti Hietala
Assignee: Philipp Bärfuss
Priority: Minor
[API doc for
RotatingVirtualURIMapping|http://dev.magnolia-cms.com/ref/latest/apidocs/info/magnolia/cms/beans/config/RotatingVirtualURIMapping.html]
says: "An extension of RegexpVirtualURIMapping that allows a rotation between
different destination urls. In order to rotate {{toURI}} must contain the {{*}}
that will be replaced by a random number between {{start}} (default is 1) and
{{end}} (default is 3)."
The code does not return random integers between {{start}} and {{end}}. It
returns integers between one and "end minus start".
{code:java}int randomNumber = RandomUtils.nextInt(end - start) + 1;{code}
|| {{start}} || {{end}} || {{RandomUtils.nextInt(end - start) + 1}} ||
| 0 | 3 | 1...3 |
| 1 | 3 | 1...2 |
| 1 | 4 | 1...3 |
| 2 | 5 | 1...3 |
| 3 | 7 | 1...4 |
| 4 | 9 | 1...5 |
Kindly revise the code to return integers between {{start}} and {{end}}. This
is potentially quite useful.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------