Comments are inheriting metadata schema from news items


(Ryan Archer) #1

Have a slight problem,

 

I have an asset builder that is setup so users can create comments in response to News Items.

The issue is that the News Items are also created with an Asset Builder that has mandatory metadata applied to it.

 

So when a comment is created it somehow inherits the metadata schema from its parent - the News Item. No metadata schema has been set to apply to comment after it has been created - its just defaulting to the News Item's schema.

 

I was thinking of two workaround solutions:

 

1) setup a blank metadata schema and apply it to newly created comments that are made in asset builder (metadata is set to optional)

2) setup a trigger to remove the metadata schema when the comment is created - which I don't think will work anyway...

 

I'm favouring option 1 right now but want to hear from anyone else who has came across this same issue of inheritance and what their solution was...


(Ryan Archer) #2

Mmmm, went with the trigger option as I had to make a few other actions take place. All the first option did was to add an additional metadata schema.

The trigger was the solution that worked.


(Bart Banda) #3

Can't you just restrict the metadata sections to only news items and other assets you need it for? That way even if it gets applied to comment assets, no fields will be editable or required to be filled in. 


(Tim Davison) #4

Inheriting schema's from parents is expected behaviour.

 

Confirming Bart's response, put a restriction on the metadata section to News Items only, this way the Comment won't pick it up.


(Ryan Archer) #5

Ok, thanks for that guys. That seemed to work and means I can take out two trigger actions which is good.

The metadata schema is applied still but its not stopping the comment from going live the moment it is created.


(Tim Davison) #6

Good.  That's the intention with restrictions (that the schema is still applied but the fields not applicable to the asset).

 

The way I use it (and not everyone likes this approach, but I think it's useful) is I create a global schema for the site, and so every asset has it.  There's a general section with no restrictions that will apply to all assets regardless of type, and then I use restrictions to limit/force other fields based on the asset type.  Means you have a single schema for everything, and saves having to apply/remove schemas based on types, etc, either manually or by triggers.  Specialised functionality will still need their own schemas, but above approach caters for most generic cases for all asset types.