craft-retour icon indicating copy to clipboard operation
craft-retour copied to clipboard

Short Link field in table listing view causing error "Return value must be of type string, null returned"

Open turnstylerj opened this issue 10 months ago • 2 comments

Describe the bug

Assigning a Short Link field to an Asset field layout and configuring the default Table Columns (tableAttributes in project config) to include the Short Link field causes a server error on asset upload (on Servd platform) with the following log:

[web.ERROR] [TypeError] nystudio107\retour\fields\ShortLink::getTableAttributeHtml(): Return value must be of type string, null returned

To reproduce

Steps to reproduce the behaviour:

  1. Assign a Short Link field to an asset volume
  2. Set the Short Link field to display in the table columns
  3. Upload an asset

Expected behaviour

Short link value is displayed in the table column

Versions

  • Plugin version: 4.1.15
  • Craft version: 4.8.4

turnstylerj avatar Apr 18 '24 16:04 turnstylerj

What are you expecting it to display here? A read-only version of the Short Link URL?

khalwat avatar Apr 18 '24 17:04 khalwat

Yeah, just a read-only version for reference would be great. Even better if it can be a hyperlink for easy access like the entry/asset link globe icon.

turnstylerj avatar Apr 18 '24 17:04 turnstylerj

Fixed in the above commits.

Craft CMS 3:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-retour": "dev-develop as 3.2.16”,

Then do a composer clear-cache && composer update

…..

Craft CMS 4:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-retour": "dev-develop-v4 as 4.1.17”,

Then do a composer clear-cache && composer update

…..

Craft CMS 5:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-retour": "dev-develop-v5 as 5.0.1”,

Then do a composer clear-cache && composer update

khalwat avatar Jun 13 '24 05:06 khalwat