Closed Sven883 closed 1 year ago
@leekelleher upon further investigion I noticed that all of the custom data sources I've added above are used in umbraco block lists. This empty contentpage has an empty property 'BlockList' where editors can pick block list items that use any of the above custom data source.
should the custom datasource data be fetched if no blocks are added in the blocklist? thnx!
Hi @Sven883,
Does contentment pre-load data list items in block list items before even adding them to the page?
That is correct, the Data List items are loaded in with the Content Type (or Element Type) schema/scaffold. I can't recall when exactly the Block List editor loads in the schema/scaffolds for block types, but I know with Contentment's Content Blocks editor it is done on initial page load.
This was done by design, to reduce additional HTTP requests between client and server. If your custom data-source returns many items, or the population is an intensive action, I can appreciate the frustration. (Which is why I have been developing the alternative Data Picker editor, see PR #297, under active development).
Which Contentment version are you using?
2.2.2
Which Umbraco version are you using? For example: 8.14.1 - don't just write v8
8.14.1
Bug summary
While debugging I noticed that several of our custom datasources are executed when they are not used on a page. As example i've created a empty 'contentpage' in our backoffice:
We have multiple custom datasources, but these are the ones that are executed when loading the contentpage in the backoffice.
BlobStorageMedia
3.
Any idea why this code is executed without using any content that uses these custom datasources?
Does contentment pre-load data list items in block list items before even adding them to the page? I noticed that deleting the block list picker from the page 'solves' the problem.
Steps to reproduce
Create umbraco v8.14.1 project with contentment v2.2.2. Create custom datasource as mentioned above & load a clean content page in the backoffice.
Expected result / actual result
The datasources code should only be executed when using a block list item that uses contentment data list with a custom data source.
Do you have Umbraco ModelsBuilder enabled?
What browsers are you seeing the problem on?
Firefox, Chrome, Safari, Microsoft Edge