Potential bug in asset_metadata_<FieldName> keyword replacement

(Lewis) #1

There is almost certainly a bug in the %asset_metadata_% keyword replacement as I’ve created an asset, applied a schema to it, filled out the metadata fields within the schema with the word ‘Test’ and no matter which way I try, the above keyword does not produce any text on the page.

In my schema, I have two fields: Title and Summary (‘title’ and ‘summary’ for the purposes of the keyword). In the asset listing, I’m doing this:


… but nothing is being displayed. When I manually update these two metadata fields on the asset with the following, their values get printed:

  • ‘A title for the strategy’ (in the ‘title’ field)
  • ‘A description for the strategy’ (in the ‘summary’ field)

@Bart how do I go about logging a bug as that seems to be what this is. We’re on version


(John gill) #2

Not impossible, but that bug sounds quite unlikely. The code around rendering MD fields is old and doesn’t seem to change much so I’d be surprised if this had been lurking for a long time.

I’m not able to replicate the issue with a first attempt.

  • What sort of asset are you dealing with?
  • what are the field types?
  • Is the “Test” value set on the asset’s metadata screen or is it a default value?
  • If you set the fields to “Show in frontend” do they show up at the top of the metadata screen?
  • What happens if you add a keyword modifier? %asset_metadata_title^charcount%
    • The idea here is to check if perhaps the Test is being written into the page but then impacted by some other factor.

(Lewis) #3

Hi @JohnGill. Thanks for the reply!

I’m applying the schema to Data Records. Both the field types are text. The ‘Test’ vallue is set on the metadata screen (when I was trying to work out what was going on), otherwise it’s set automatically using a SOAP request.

When I set them to show on frontend, nothing appears. When I try adding %asset_metadata_title^charcount%, I get ‘0’ (zero).

Again, I’ve manually gone in and updated the values in the two field and now they display - setting them to ‘ABCDEFG’ prints them in the asset listing.

(Iain Simmons) #4

Hi @lewis,

A few questions so I can try to help:

  1. The <ul> you have in your asset listing, is that in the default format bodycopy (or Data Record Format if one exists)?
  2. How is the SOAP data being applied as metadata values? Via trigger? Or default values?
  3. Are you viewing the asset listing on the same domain as admin, and with a user that had permissions to all of the data and metadata?

– iain

(Aleks Bochniak) #5

Keywords are case specific.

If your metadata field name is Title not title - then your keyword won’t work. Looks like you’re trying to reference your Title metadata field with ‘title’ not capitalised. Please correct me if my assumption is wrong.

You can always try using %asset_data_metadata% to see if this shows you something.

(Lewis) #6

Hi @isimmons. Thanks for the reply!

The <ul> is in the Page Contents bodycopy, the metadata is applied automatically using a SOAP API call when a Data Record is created, there are no default value beforehand and the asset listing is being viewed on the same domain as the asset and the SOAP call.

(Iain Simmons) #7

And you have the %asset_listing% keyword inside the <ul> and then the <li> and other keywords in the default format?

(Lewis) #8

Hi @aleks. Thanks for the reply!

I’m using ‘test’ (small ‘T’). As I say, I’ve managed to get the metadata values to display but only by adding additional text. I guess there could be a bug which means there’s effectively a character limit on the Text metadata field type?

I’ve asked our IT dept. to raise a Squiz bug report.


(Lewis) #9

Yes @isimmons, that’s right.

(Lewis) #10

This seems to be a combination of case sensitivity on the metadata field name (I’ve switched it to all lower case) and caching. Since clearing the cache using the Clear Matrix Cache tool in the Tools menu and changing the case of the field name, the asset listing is pulling through the values and presenting them on the fronted.

Is there a best practices for setting up cache when it comes to metadata fields and values in Squiz? I’m not saying this resolves the problem but has at least let me move one a bit.

(Lewis) #11

Another update from today and case sensitivity doesn’t seem to play such a big part. Changing case hasn’t solved the problem and metadata values are being presented inconsistently - they’ll appear continuously one minute and then not the next, despite there being no changes to the underlying setup.

At present, I’ve simply trying to list of a series of metadata values saved against data record assets. There’s evidence that the asset listing is aware of the number of metadata values arriving from the data records but it doesn’t present their values on the frontend.

This was producing results yesterday and now today it isn’t.

I’ve tried clearing the cache, thinking that the asset listing is getting some sort of cached list of assets types from somewhere in the backend but that didn’t make any difference.

Any ideas @Bart?

(Bart Banda) #12

This sounds extremely local to your environment and I have no idea why such a basic implementation would just suddenly not. Best approach is to get help from Squiz Support for them to look into it further as I can’t think of anything that it can be based on what you have described. DId you log a ticket and if so did they get back to you?

(Lewis) #13

Thanks @Bart. I’ll pass it back to our IT dept. and ask them to raise a ticket.