craft-retour
craft-retour copied to clipboard
Short Link field in table listing view causing error "Return value must be of type string, null returned"
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:
- Assign a Short Link field to an asset volume
- Set the Short Link field to display in the table columns
- 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
What are you expecting it to display here? A read-only version of the Short Link URL?
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.
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