October: Dashboard page won't load when using Object list editor type

Created on 20 Jun 2019  路  11Comments  路  Source: octobercms/october

  • OctoberCMS Build: 456
  • PHP Version: 7.3.6

Description:

The dashboard page won't load after using a reportwidget with a property which uses the object list type. You get the message: ErrorException: substr() expects parameter 1 to be string, array given.

Steps To Reproduce:

  1. Use a reportwidget with a property which uses the object list type
  2. Fill in the reportwidget properties
  3. Reload the dashboard page
Completed Bug

Most helpful comment

@LukeTowers, No problem. I鈥檒l add an example tomorrow

All 11 comments

@SebastiaanKloos code example of the report widget that doesn't work please.

@LukeTowers You can add this property to the report widget

'filter' => [
                'title'             => 'Where',
                'type'              => 'objectList',
                'titleProperty'     => 'column',
                'itemProperties'    => [
                    [
                        'property'  => 'column',
                        'title'     => 'Column',
                        'type'      => 'string',
                    ],
                    [
                        'property'  => 'type',
                        'title'     => 'Type',
                        'type'      => 'dropdown',
                        'default'   => '=',
                        'options'   => [
                            '='     => '=',
                            '!='    => '!=',
                            'null' => 'is null',
                            'notNull' => 'is not null',
                        ],
                    ],
                    [
                        'property'  => 'value',
                        'title'     => 'Value',
                        'type'      => 'string',
                    ],
                ],
            ],

@SebastiaanKloos could you add an example to the test plugin?

@LukeTowers, No problem. I鈥檒l add an example tomorrow

@LukeTowers I have added it to the test plugin

@w20k could you take a look when able?

@LukeTowers sure! Added to my Todo's.
Confirmed.

@LukeTowers found the cause:
https://github.com/octobercms/october/blob/4e92686c1a7de662840fa160b7348003f5ba817d/modules/backend/widgets/ReportContainer.php#L453

$widget->property return an array and Lang::get is waiting for a string.

Screenshot:
Screenshot 2019-07-09 at 15 41 16

Minor note:
https://github.com/octobercms/october/blob/4e92686c1a7de662840fa160b7348003f5ba817d/modules/backend/widgets/ReportContainer.php#L433 - var name is overwritten (not a bug though, yet 馃槃 )

@w20k out of curiosity can you post a screenshot of what the widget's inspector looks like? I don't think I've used the objectList type before.

@LukeTowers was the first time for me to test this functionality. Haven't seen it yet.
Do you know is there an option to make Algolia on octobercms.com to parse those doc files as well - modules/system/assets/ui/docs? Or they're not visible at all? Not sure yet, how our docs system works)

Screenshots:
Screenshot 2019-07-10 at 10 38 03
Screenshot 2019-07-10 at 10 43 17

@w20k not sure about algolia, you'd have to talk to @daftspunk about it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oppin picture oppin  路  3Comments

EbashuOnHolidays picture EbashuOnHolidays  路  3Comments

mittultechnobrave picture mittultechnobrave  路  3Comments

mittultechnobrave picture mittultechnobrave  路  3Comments

lukaszbanas-extremecoding picture lukaszbanas-extremecoding  路  3Comments