I’ve found that with that plugin you can also input pivot data in many relationships as mentioned here in the docs.
As you can see in the docs, it can select from pivot data, but what I want is also to truncate the text from pivot data
So I make it like this
teams:
label: Team
view:
list:
columns:
name:
label: Name
pivot[team_color]:
label: Team color
select: 'IF(CHAR_LENGTH(team_color) > 100, CONCAT(LEFT(team_color, 100),"..."), team_color)'
manage:
list:
columns:
name:
label: Name
pivot:
form:
fields:
pivot[team_color]:
label: Team color
But what I get is this error
Call to a member function getTable() on null
~/modules/backend/widgets/Lists.php line 503
How do I solve this ?
or are there any other ways to achieve this result ?
Effectively the model cannot make the relation (probably pivot). We will need to try to reproduce it using the Test plugin.
It’s possible that select is not compatible with the pivot relationship. So a workaround could be to remove the select and replace it with a partial type and truncate the text using PHP instead. Here is a link to the partial list column: