Archiva

Reporting does not work due to bug in client-side JavaScript validation

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0
  • Fix Version/s: 1.0.2
  • Component/s: reporting
  • Labels:
    None
  • Environment:
    Win32
    Firefox 2.0.0.9 or MSIE 6.0
    German system
  • Number of attachments :
    0

Description

No matter what "Row Count" I choose in Manage | Reports, I get the error message "Row count must be between 10 and 5000.". After disabling JavaScript, which disables the client-side validation, it works.

I tracked it down to the following line in the JavaScript function validateForm_generateReport() that is included into the pickReport page

508 if (parseInt(field.value) <
509 10 ||
510 parseInt(field.value) >
511 5.000) {

The problem is the decimal point in the number "5.000". At least on my system, this is interpreted as "5", not "5000".

Activity

Hide
Dário Oliveros added a comment -

Please look what I've found at https://issues.apache.org/struts/browse/WW-1937

Show
Dário Oliveros added a comment - Please look what I've found at https://issues.apache.org/struts/browse/WW-1937
Hide
Dário Oliveros added a comment -

As a workaround I'd suggest modifying the GenerateReportAction-validation.xml located at <archiva.home>/apps/archiva/webapp/WEB-INF/classes/org/apache/maven/archiva/web/action/reports by replacing 5000 with 500. In this way you will be able to generate report without having to disable javascript validation.
I've made a simple test and it worked fine.

Show
Dário Oliveros added a comment - As a workaround I'd suggest modifying the GenerateReportAction-validation.xml located at <archiva.home>/apps/archiva/webapp/WEB-INF/classes/org/apache/maven/archiva/web/action/reports by replacing 5000 with 500. In this way you will be able to generate report without having to disable javascript validation. I've made a simple test and it worked fine.
Hide
Thomas Winkler added a comment -

I have a similar problem on the report page.

The dot within the JavaScript gets interpreted like "x > 5" or "x < 10".

The generated JavaScript seems to be dependend on the language settings of the used JVM.

Possible workaround:
Setting the JVM language propertie to en (e.g. Tomcat startup parameter -Duser.language=en) is a possible workaround. This results in generating a script, using commas, which seems to be interpreted correctly by JavaScript ( parseInt(file.value) > 5,000 ).

Show
Thomas Winkler added a comment - I have a similar problem on the report page. The dot within the JavaScript gets interpreted like "x > 5" or "x < 10". The generated JavaScript seems to be dependend on the language settings of the used JVM. Possible workaround: Setting the JVM language propertie to en (e.g. Tomcat startup parameter -Duser.language=en) is a possible workaround. This results in generating a script, using commas, which seems to be interpreted correctly by JavaScript ( parseInt(file.value) > 5,000 ).
Hide
Brett Porter added a comment -

fixed alongside MRM-598

Show
Brett Porter added a comment - fixed alongside MRM-598

People

Vote (3)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: