Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-21811: Don't display in logs Errors related to ObjectEvaluator when upgrading XWiki #2977

Merged
merged 3 commits into from
Mar 27, 2024

Conversation

pjeanjean
Copy link
Contributor

Jira URL

https://jira.xwiki.org/browse/XWIKI-21811

Changes

Description

  • Fixes the error messages that would get logged during an update due to a missing dependency to SearchSuggestSourceObjectEvaluator.

Clarifications

This PR moves the UI component searchSuggest.js to its own module with the proper dependencies.
It also refactors the different places that relied on the newly moved files.

Screenshots & Video

N/A

Executed Tests

The update process was run successfully with this patch and the errors are no longer logged.
The search suggestions still work as expected.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • stable-15.10.x

@michitux michitux added the backport stable-15.10.x Used for automatic backport to 15.10.x branch. label Mar 12, 2024
<script src="${services.webjars.url('org.xwiki.platform:xwiki-platform-search-webjar', 'searchSuggest.min.js', {'evaluate': true, 'h': $searchSuggestConfigHash.hashCode()})}" defer="defer"></script>
$xwiki.linkx.use(
$services.webjars.url('org.xwiki.platform:xwiki-platform-search-webjar', 'searchSuggest.min.css', {'evaluate': true}),
{'type': 'text/css', 'rel': 'stylesheet'})##
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm couldn't it be considered as a possible breakage? Isn't it possible that an extension used to use that searchSuggest.js or css?

Copy link
Member

@tmortagne tmortagne Mar 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not very clear if everything in uicomponents/ is supposed to be an API or not. I searched a bit in xwiki.org and could not find any documentation suggesting to use searchSuggest files, so I assumed it was OK enough as it's definitely not the first file we move from there to a webjar.

WDYT @mflorea ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it's not documented as an API we could have extensions that manually load this JavaScript/CSS. Adding a mention in the release notes (in the migration section) should be enough IMO.

<script src="${services.webjars.url('org.xwiki.platform:xwiki-platform-search-webjar', 'searchSuggest.min.js', {'evaluate': true, 'h': $searchSuggestConfigHash.hashCode()})}" defer="defer"></script>
$xwiki.linkx.use(
$services.webjars.url('org.xwiki.platform:xwiki-platform-search-webjar', 'searchSuggest.min.css', {'evaluate': true}),
{'type': 'text/css', 'rel': 'stylesheet'})##
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it's not documented as an API we could have extensions that manually load this JavaScript/CSS. Adding a mention in the release notes (in the migration section) should be enough IMO.

…when upgrading XWiki

* Fix wrong dependencies
* Improve code style
…when upgrading XWiki

* Target version 16.3.0-SNAPSHOT
@tmortagne tmortagne merged commit 7bd3b2b into xwiki:master Mar 27, 2024
1 check passed
github-actions bot pushed a commit that referenced this pull request Mar 27, 2024
michitux added a commit that referenced this pull request May 7, 2024
…ckend

Revert "XWIKI-21811: Don't display in logs Errors related to ObjectEvaluator when upgrading XWiki (#2977)"

This reverts commit 7bd3b2b.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport stable-15.10.x Used for automatic backport to 15.10.x branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants