neos / neos-development-collection

The unified repository containing the Neos core packages, used for Neos development.
https://www.neos.io/
GNU General Public License v3.0
260 stars 221 forks source link

BUG: Media Browser: Asset usage is not displayed for Assets from Asset Sources #3989

Open lorenzulrich opened 1 year ago

lorenzulrich commented 1 year ago

Is there an existing issue for this?

Current Behavior

If an used Asset from an Asset Source is clicked in the Media Browser, the button showing the number of usages is missing.

Expected Behavior

The usage count should be displayed.

Steps To Reproduce

  1. Use a Neos instance with an Asset Source.
  2. Link an Asset from an Asset Source so it has one usage.
  3. Click the Asset in the Media Browser --> Usage count is not displayed below the metadata table

Environment

- Flow: 7.3
- Neos: 7.3
- PHP: 8.1

Anything else?

I'm not sure if this was a deliberate decision or if it just went missing. Adding the respective lines from the Edit template to the Show template solves the problem in my case:

<f:if condition="{assetProxy.asset.inUse}">
<f:link.action action="relatedNodes" arguments="{asset:assetProxy.asset}" addQueryString="true" class="neos-button">
    {neos:backend.translate(id: 'relatedNodes', quantity: '{assetProxy.asset.usageCount}', arguments: {0: assetProxy.asset.usageCount}, package: 'Neos.Media.Browser')}
</f:link.action>
</f:if>
bwaidelich commented 1 year ago

Thanks for reporting. This was most probably not a deliberate choice and we stumbled upon the same issue