Cms: Cached metadata has empty data property

Created on 11 Nov 2020  路  6Comments  路  Source: statamic/cms

Bug Description

When asset metadata is fetched from the cache the data key is overwritten with an empty collection in:

if ($this->meta) {
    return array_merge($this->meta, ['data' => $this->data->all()]);
}

.. as $this->data isn't hydrated.

How to Reproduce

  • Add metadata to asset ( eg. alt text )
  • View asset and check that metadata is used
  • Reload page to get cached version and check metadata is gone

Extra Detail

Pull request

Environment

Statamic 3.0.26 Pro
Laravel 7.29.3
PHP 7.4.9

assets bug critical

All 6 comments

thanks, i just bumped into this

Just run into this as well. Worked fine on Statamic 3.0.25.

I can confirm this is a bug, likely related to the changes made in #2828.

Should be fixed in 3.0.27, let us know if you have any issues going forward!

Broken again in 3.0.46? :-/ @jesseleite

.meta/B0002040_2.jpg.yaml

data:
  text: "Image description"
  alt: "Alt text"
size: 15246105
 ```

**Antlers**
```html
{{ images }}
    <img src="{{ url }}" alt="{{ alt }}" />
{{ /images }}

Output
```html

````

Broken again in 3.0.46? :-/ @jesseleite

.meta/B0002040_2.jpg.yaml


data:

  text: "Image description"

  alt: "Alt text"

size: 15246105

 ```



**Antlers**

```html

{{ images }}

    <img src="{{ url }}" alt="{{ alt }}" />

{{ /images }}

Output

```html

````

Hey! If it's broken again, would you mind opening a fresh issue. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jimblue picture jimblue  路  3Comments

aerni picture aerni  路  4Comments

aerni picture aerni  路  3Comments

wm-simon picture wm-simon  路  3Comments

AndreasSchantl picture AndreasSchantl  路  3Comments