Skip to content

Conversation

@Ducica
Copy link
Contributor

@Ducica Ducica commented Nov 25, 2025

Description

The SearchBar, does not take a default prop buildUID, which means that for example here https://github.com/inveniosoftware/invenio-communities/blob/8ff51b31e1a5cb1e9f3f0568e6a405447b8f9aba/invenio_communities/assets/semantic-ui/js/invenio_communities/community/searchComponents/CommunitiesSearchLayout.js#L38 (maybe in other places where it was forgotten to pass buildUID function to SearchBar), the app crashes. Meaning the community home page /communities//records crashes.

It happens because if this conditional fails, the components proceeds and tries to call buildUID

const domElement = document.getElementById(elementId);
if (domElement) {
domElement.innerHTML = "";
return ReactDOM.createPortal(<ReactSearchKitSearchBar />, domElement);
}

We received a design of a repository that does not have searchbar in the header as there is in RDM implementation, so this is how we discovered this bug. It seems reasonable that there would be default value for buildUID function passed to the component. Please let us know if we could merge this. Thanks!

@utnapischtim
Copy link
Contributor

nit: can you please add a small description of the bug to the commit message too.

@Ducica
Copy link
Contributor Author

Ducica commented Nov 25, 2025

nit: can you please add a small description of the bug to the commit message too.

Yes sure, i am afk, but ill push it tmrw.

*In case buildUID prop is not passed the
component can crash entire search app
@Ducica Ducica force-pushed the oarepo-feature-fix-searchbar branch from dcc22f3 to 8eb26d4 Compare November 25, 2025 18:35
@Ducica
Copy link
Contributor Author

Ducica commented Nov 27, 2025

@utnapischtim Hello, I've corrected the commit message. If possible, could we please merge? Thanks!

@utnapischtim utnapischtim merged commit 0720faf into inveniosoftware:master Nov 30, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants