Problem/Motivation
1) Error for view preview and PHP 8 :
TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in implode() (line 22 of web/modules/contrib/jsonapi_views/jsonapi_views.module)
See https://www.php.net/manual/en/function.implode.php
Since PHP 8.0.0 : Passing the separator after the array is no longer supported.
2) Warnings when you valide a preview with filter :
Warning: Undefined array key "sort_by" in jsonapi_views_views_preview_info_alter() (line 27 of modules/contrib/jsonapi_views/jsonapi_views.module).
Warning: Undefined array key "sort_order" in jsonapi_views_views_preview_info_alter() (line 30 of modules/contrib/jsonapi_views/jsonapi_views.module).
Steps to reproduce
1) Edit a view and see log.
2) add exposed filter fill the input and click Preview.
Proposed resolution
Change implode arguments order, and test existence of array keys.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3228973-remove-preview-error-and-warning.patch | 961 bytes | tty11 |
Comments
Comment #2
tty11A patch for fix error and warning.
Comment #3
tty11Comment #4
decipheredTests are currently broken in Drupal 9.2, re-running in 9.1
Comment #5
decipheredLGTM
Comment #7
deciphered