… with adhoc data views (elastic#145583)
## Summary
Fixes elastic#141812
This PR preventing using Discover saved objects with adhoc data views in
aggregation based visualisations.
### Test notes
- Create Saved search based on adhoc data view in Discover
- Open new Agg based visualisations list and choose one
- Created Saved search shouldn't appear in the list.
### Checklist
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
(cherry picked from commit 2c9043a)
# Conflicts:
# src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts
Backport
This will backport the following commits from
mainto8.5:Questions ?
Please refer to the Backport tool documentation
\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n\n\nCo-authored-by: Dmitry Tomashevich <39378793+dimaanj@users.noreply.github.com>"}},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com//pull/145583","number":145583,"mergeCommit":{"message":"[Discover] Prevent agg based visualizations of Discover saved objects with adhoc data views (#145583)\n\n## Summary\r\n\r\nFixes #141812\r\n\r\nThis PR preventing using Discover saved objects with adhoc data views in\r\naggregation based visualisations.\r\n\r\n### Test notes \r\n- Create Saved search based on adhoc data view in Discover\r\n- Open new Agg based visualisations list and choose one\r\n- Created Saved search shouldn't appear in the list. \r\n\r\n### Checklist\r\n\r\n\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"2c9043ab431cebbbdeb77c96aa2a5c0bc5b0ddf4"}},{"branch":"8.5","label":"v8.5.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->