Creating Asset with Context


(Tbaatar) #1

Hi,

With Matrix 4.18.9 you can create asset (with asset builder) in alternative context.
However in v5.4.0.0 and above it gives the following error:

Cannot set attribute value for asset #469628. The asset attribute for this asset is not contextualised for “German” context.

Is it possible to overcome this without having to create default context first and then editing it.

Thanks.


(Bart Banda) #2

Just tested this and can confirm this prevents you from creating the asset. I believe it’s expecting you to create it always in the default context first, however I think it should be possible to create the asset in any context, like you can in the Admin Asset Tree /Edit+ Creation Wizard, then you would need to still activate the context for the context you are in if you want to keep editing it.

Have filed this as a bug. https://squizmap.squiz.net/matrix/10908

The workaround I can think of is to either try and create it via a trigger or JS API, or perhaps put the asset builder in a different URL where it’s not under a context and ajax/iframe it in and build the asset as if it was in the default context and go from there.


(Tbaatar) #3

HI Bart,

Thanks for the super helpful feedback. Will investigate the JS API method.

Thanks.


(Tbaatar) #4

Hi Bart,

I just realized if context is created under context configuration but not set to the URL, then the asset builder fails to create asset altogether.

Is there a solution to this? apart from sending the form via JS API.
As you have said the system expecting it to create the asset in Default context, how do you go about force creating it with default context in the asset builder? And is there way to check which context the page is being viewed outside the admin area.

The reason why there is context set for different region is for cookie reasons and to contain a data as opposed to using it for URL.

Thanks.


(Bart Banda) #5

Apart from patching it with the bug fix, not sure. Have you tried using a Trigger?