# Bug in Advanced Search Rendering in ELN GUI

**URL:** https://community.openbis.ch/t/bug-in-advanced-search-rendering-in-eln-gui/383
**Category:** ELN, LIMS, Data management functionalities
**Created:** [5 August 2024 08:36 UTC](https://community.openbis.ch/t/bug-in-advanced-search-rendering-in-eln-gui/383 "2024-08-05T08:36:39Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![khalil.rejiba](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@khalil.rejiba](https://community.openbis.ch/u/khalil.rejiba)
#### Post date: [5 August 2024 08:36 UTC](https://community.openbis.ch/t/bug-in-advanced-search-rendering-in-eln-gui/383/1 "2024-08-05T08:36:39Z")

</div>

Dear all,

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

 ![20240805-openbis-search-bug](https://europe1.discourse-cdn.com/flex013/uploads/openbis/original/1X/9844fff5bb9213ecd8d58cede79696e06199d142.jpeg)  
Version: 20.10.7.1

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

> **[ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/PrintUt...](https://sissource.ethz.ch/sispub/openbis/-/blob/master/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/PrintUtil.js#L20)**
>
> Gitlab instance of Scientific IT Services, ETH Zurich.

The error can be circumvented by introducing the following modification.

```auto
	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

---

<div class="post-metadata">

### Author: ![cbarillari](https://dub1.discourse-cdn.com/flex013/user_avatar/community.openbis.ch/cbarillari/32/10_2.png) [@cbarillari](https://community.openbis.ch/u/cbarillari)
#### Post date: [14 August 2024 08:02 UTC](https://community.openbis.ch/t/bug-in-advanced-search-rendering-in-eln-gui/383/2 "2024-08-14T08:02:02Z")

</div>

Dear Khalil,

can you describe how we can reproduce the error?

Thanks

Caterina

---

<div class="post-metadata">

### Author: ![khalil.rejiba](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@khalil.rejiba](https://community.openbis.ch/u/khalil.rejiba)
#### Post date: [14 August 2024 12:59 UTC](https://community.openbis.ch/t/bug-in-advanced-search-rendering-in-eln-gui/383/3 "2024-08-14T12:59:25Z")

</div>

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.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/openbis/original/1X/0c21a726f41b9071360d446318349179a7563f2c.png)

Best,  
Khalil

---

<div class="post-metadata">

### Author: ![cbarillari](https://dub1.discourse-cdn.com/flex013/user_avatar/community.openbis.ch/cbarillari/32/10_2.png) [@cbarillari](https://community.openbis.ch/u/cbarillari)
#### Post date: [14 August 2024 13:10 UTC](https://community.openbis.ch/t/bug-in-advanced-search-rendering-in-eln-gui/383/4 "2024-08-14T13:10:18Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![khalil.rejiba](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@khalil.rejiba](https://community.openbis.ch/u/khalil.rejiba)
#### Post date: [14 August 2024 13:28 UTC](https://community.openbis.ch/t/bug-in-advanced-search-rendering-in-eln-gui/383/5 "2024-08-14T13:28:20Z")

</div>

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