Winter\Storm\Database\Relations\BelongsToMany::shouldSelect(): Argument #1 ($columns) must be of type array, int given
Closed this issue · 2 comments
goldmont commented
Winter CMS Build
1.2
PHP Version
8.1
Database engine
MySQL/MariaDB
Plugins installed
No response
Issue description
Hi,
After upgrading to version 1.2.6, backend forms with relations don't work anymore:
Winter\Storm\Database\Relations\BelongsToMany::shouldSelect(): Argument #1 ($columns) must be of type array, int given, called in /var/www/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php on line 922
How can I solve? Thanks.
Steps to replicate
- Set-up a belongs-to-many relation
- Add relation partial to a form
Workaround
No response
mjauvin commented
I cannot replicate this, can you provide a way to replicate this using Winter.Test
plugin ?
You can install the plugin with composer like this:
composer require winter/wn-test-plugin
goldmont commented
I cannot replicate this, can you provide a way to replicate this using
Winter.Test
plugin ?You can install the plugin with composer like this:
composer require winter/wn-test-plugin
Hi,
Removing the recordsPerPage
property from my config_relation.yaml
seems solving the issue.
My config_relation.yaml
:
assignees:
label: calcom.management::lang.models.task.tab.assignees.relation_name
manage:
recordsPerPage: 20
showSearch: true
showSorting: true
showSetup: false
noRecordsMessage: 'backend::lang.list.no_records'
defaultSort:
column: last_name
direction: asc
list:
columns:
username:
label: 'calcom.auth::lang.users.list.username'
type: text
searchable: true
sortable: true
first_name:
label: 'calcom.auth::lang.users.list.first_name'
type: text
searchable: true
sortable: true
last_name:
label: 'calcom.auth::lang.users.list.last_name'
type: text
searchable: true
sortable: true
view:
toolbarButtons: add|remove
recordsPerPage: 20
showSearch: true
showSorting: true
showSetup: false
noRecordsMessage: 'backend::lang.list.no_records'
defaultSort:
column: last_name
direction: asc
list:
columns:
username:
label: 'calcom.auth::lang.users.list.username'
type: text
searchable: true
sortable: true
first_name:
label: 'calcom.auth::lang.users.list.first_name'
type: text
searchable: true
sortable: true
last_name:
label: 'calcom.auth::lang.users.list.last_name'
type: text
searchable: true
sortable: true