Issue with a backend form

Hi,

suddenly, I have this error on one of my backend list.

any idea please?

Unsupported operand types: int - string
~/vendor/october/rain/src/Element/Form/FieldsetDefinition.php line 110
TypeError: Unsupported operand types: int - string in /var/www/html/vendor/october/rain/src/Element/Form/FieldsetDefinition.php:110
Stack trace:
#0 [internal function]: October\Rain\Element\Form\FieldsetDefinition::October\Rain\Element\Form\{closure}()
#1 /var/www/html/vendor/october/rain/src/Element/Form/FieldsetDefinition.php(111): uasort()
#2 /var/www/html/modules/backend/widgets/form/FieldProcessor.php(29): October\Rain\Element\Form\FieldsetDefinition->sortAllFields()
#3 /var/www/html/modules/backend/widgets/Form.php(727): Backend\Widgets\Form->processAutoOrder()
#4 /var/www/html/modules/backend/widgets/Form.php(179): Backend\Widgets\Form->defineFormFields()
#5 /var/www/html/modules/backend/behaviors/FormController.php(183): Backend\Widgets\Form->bindToController()
#6 /var/www/html/modules/backend/behaviors/FormController.php(342): Backend\Behaviors\FormController->initForm()
#7 [internal function]: Backend\Behaviors\FormController->update()
#8 /var/www/html/vendor/october/rain/src/Extension/ExtendableTrait.php(504): call_user_func_array()
#9 /var/www/html/vendor/october/rain/src/Extension/Extendable.php(55): October\Rain\Extension\Extendable->extendableCall()
#10 /var/www/html/modules/system/traits/DependencyMaker.php(29): October\Rain\Extension\Extendable->__call()
#11 /var/www/html/modules/backend/classes/Controller.php(392): Backend\Classes\Controller->makeCallMethod()
#12 /var/www/html/modules/backend/classes/Controller.php(274): Backend\Classes\Controller->execPageAction()
#13 /var/www/html/modules/backend/classes/BackendController.php(137): Backend\Classes\Controller->run()
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Backend\Classes\BackendController->run()
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\Routing\Controller->callAction()
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Illuminate\Routing\ControllerDispatcher->dispatch()
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\Routing\Route->runController()
#18 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\Routing\Route->run()
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#20 /var/www/html/plugins/vdlp/twofactorauthentication/classes/TwoFactorMiddleware.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#21 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Vdlp\TwoFactorAuthentication\Classes\TwoFactorMiddleware->handle()
#22 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Routing\Middleware\SubstituteBindings->handle()
#24 /var/www/html/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#25 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\View\Middleware\ShareErrorsFromSession->handle()
#26 /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#27 /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Session\Middleware\StartSession->handleStatefulRequest()
#28 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Session\Middleware\StartSession->handle()
#29 /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#30 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
#31 /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#32 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Cookie\Middleware\EncryptCookies->handle()
#33 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#34 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(799): Illuminate\Pipeline\Pipeline->then()
#35 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(776): Illuminate\Routing\Router->runRouteWithinStack()
#36 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(740): Illuminate\Routing\Router->runRoute()
#37 /var/www/html/vendor/october/rain/src/Router/CoreRouter.php(32): Illuminate\Routing\Router->dispatchToRoute()
#38 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(190): October\Rain\Router\CoreRouter->dispatch()
#39 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}()
#40 /var/www/html/plugins/zaxbux/securityheaders/classes/SecurityHeaderMiddleware.php(20): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#41 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Zaxbux\SecurityHeaders\Classes\SecurityHeaderMiddleware->handle()
#42 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#43 /var/www/html/vendor/october/rain/src/Foundation/Http/Middleware/CheckForMaintenanceMode.php(23): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
#44 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): October\Rain\Foundation\Http\Middleware\CheckForMaintenanceMode->handle()
#45 /var/www/html/plugins/zaxbux/securityheaders/classes/NonceGeneratorMiddleware.php(22): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#46 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Zaxbux\SecurityHeaders\Classes\NonceGeneratorMiddleware->handle()
#47 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#48 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\Pipeline\Pipeline->then()
#49 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(134): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#50 /var/www/html/index.php(70): Illuminate\Foundation\Http\Kernel->handle()

culprit seems to be this

    tag:
      tab: mytab
      span: auto
      type: relation
      nameFrom: name
      order: "name asc" <=
      emptyOption: "Choose a tag"

which uses to work in the past

Try using defaultSort instead.

The order should be an integer and specify the order number/position of the field as it appears in the form.

I think it may have worked in the past, but it was ineffectual.

thanks @daft
I actually updated the tag relation in this case and added "order" => "name asc" in there

1 Like