BUGFIX: Disable asset search through asset editor when media browser is disabled #3536
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.
fixes: #1571
The problem
As stated in #1571, even if the media browser has been deactivated via feature-toggle in the asset editor configuration, it is still accessible through search-as-you-type, because the search results are sourced from the media module.
I can very well be argued that by configuring
mediaBrowser: false
, the integrator's intent is to restrict the asset editor solely to its upload function. At the moment this intent could be bypassed.The solution
I added code to dynamically disable the asset search in the asset editor depending on the value of the
mediaBrowser
feature toggle. IfmediaBrowser
is set tofalse
, search will be disabled as well.Despite the quick fix, I think we should discuss if we want to consider this the correct way to interpret the feature toggle. (Maybe also use 👍 / 👎 on this description)