Open ribsdigital opened 2 years ago
Hey @ribsdigital
To be honest, I hadn't tried using a block list editor but I know they are pretty complex in their implementation so I'm guessing it's built to expect to be in the content editor and it's looking for a specific control in the $scope
chain to read some values (which is bad angular practice to be honest).
I'll have to look into what it's doing and whether it can be faked, but for now I think it's probably a case of it being too complex and built for a specific purpose with a few assumptions made in it's code base.
Hi Matt,
We came upon the same issue when we were making a custom property editor containing a block list property. We use this property editor to let the user overwrite standard value of a property inside the block list property in certain cases.
We got this working with a few changes in the controllers and views:
umbBlockListPropertyEditor.component.js:
if (liveEditing === false) {
// transfer values when submitting in none-liveediting mode.
blockObject.retrieveValuesFrom(blockEditorModel.content, blockEditorModel.settings);
}
to
if (liveEditing === false) {
// transfer values when submitting in none-liveediting mode.
let saveOld = blockObject.config.settingsElementTypeKey;
blockObject.config.settingsElementTypeKey = null;
blockObject.retrieveValuesFrom(blockEditorModel.content, blockEditorModel.settings);
blockObject.config.settingsElementTypeKey = saveOld;
}
umb-block-list-row.html:
val-server-match="{ 'contains' : { 'valServerMatchContent': vm.layout.$block.content.key, 'valServerMatchSettings': vm.layout.$block.settings.key } }"
For now this is working for our project and although it only has one culture, perhaps this can be a starting point for a more definitive solution?
hi matt,
just checking if there is support for the blocklist editor datatype? we've double checked https://docs.getkonstrukt.net/extras/known-issues and it's not mentioned as not supported...
we've created a very basic doctype with one text property on it and then created a datalist datatype that uses the doctype:
we'added a
Data
column to our table in sql server with a data type ofnvarchar(MAX)
:added it to our poco:
and set the datatype for the property in our konstructor using
.AddField(p => p.Data).SetDataType("Blocklist editor test")
:attempting to create a new 'person' in the backoffice results in the following error:
Could not find umbVariantContent in the $scope chain
if we put the same datatype on a doctype and add content in the content tree, everything works as expected.
we've had a search, and it appears that this error has been reported in earlier versions of umbraco 8 https://github.com/skttl/umbraco-doc-type-grid-editor/issues/226 but has been fixed in later versions.
just to double check that its not a core issue, we've tried this in a projects running v9.3.1 and v9.4.1 of umbraco and get the same results.
if you could let us know if this is a bug or the blocklist editor is an unsupported datatype, that'd be great :thumbsup:
This item has been added to our backlog AB#34774