Bug in Advanced Search Rendering in ELN GUI

Dear all,

I stumbled on a bug in the rendering of search results using the ELN GUI when searching for Datasets.


Version: 20.10.7.1

The error seems to be caused by the rendering of the sizeHumanReadable property.

The error can be circumvented by introducing the following modification.

	this.renderNumberOfBytes = function(bytes) {
		if (typeof bytes == "string") {
			bytes = parseInt(bytes)
		} else if (typeof bytes == "undefined") {
			bytes = 0
		}
		var size = bytes;
		var unit = "bytes"
		var kbytes = bytes / 1024.0;
		var mbytes = kbytes / 1024.0;
		var gbytes = mbytes / 1024.0;
		if (gbytes > 1.0) {
			size = gbytes;
			unit = "Gb";
		} else if (mbytes > 1.0) {
			size = mbytes;
			unit = "Mb";
		} else if (kbytes > 1.0) {
			size = kbytes;
			unit = "kb";
		}
		return size.toFixed(1) + " " + unit;

Best regards,
Khalil

Dear Khalil,

can you describe how we can reproduce the error?

Thanks

Caterina

Hi Caterina,

Thanks for getting back to me.

When you try to find Datasets using the Advanced Search option, the results are not rendered properly because of PrintUtil.js utility and the sizeHumanReadable property.

When you have LinkedData like we have, it seems that the dataset size is undefined and is not handled. So, you end up with this TypeError.

Best,
Khalil

So you simply search for datasets and the search cannot display the results? The issue could indeed be due to the linked datasets, because in the productive instances we have we never experiences this issue, but we also do not have linked datasets.

Yes, it seems to be related to our use of LinkedData. If query only the PhysicalData, the results are rendered perfectly.