Fixed StackOverflow exception when using NoopPropertyIndexValueFactory #15284
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisites
This is related to the issue #14556, which has been partially fixed for
RichTextPropertyEditor
, but not for property editors that useNoopPropertyIndexValueFactory
.Description
Removed recursive call from the
GetIndexValues
method ofNoopPropertyIndexValueFactory
which is now marked asobsolete
. Even though it is an obsolete method and it is not directly called within Umbraco CMS codebase anymore, I thought it would be good to fix it for backward compatibility with modules and libraries that may be still using it, for example https://github.com/umbraco/Umbraco.Cms.Integrations.This is how this method looked prior to this change, see the recursive call in red:
Instead of making a recursive call it now calls the other method overload with 5 parameters, as seen in other property index value factory classes (
DefaultPropertyIndexValueFactory
,JsonPropertyIndexValueFactoryBase
,GridPropertyIndexValueFactory
andRichTextPropertyIndexValueFactory
).Steps to reproduce
I've tried it with Umbraco 12.2.0/12.3.0 and Umbraco.Cms.Integrations.Search.Algolia library version 1.5.0.
Umbraco.Cms.Integrations.Search.Algolia
.Umbraco.MediaPicker3
.StackOverflowException
:I have previously raised an issue in umbraco/Umbraco.Cms.Integrations#150 to remove the obsolete method call, but then realised that there could be other packages using this method and it would be good to fix this method until it's fully deprecated in v14.