- ๐ณ๐ฟNew Zealand ericgsmith
Setting to needs review.
Please note the pipeline is failing as the gitlab ci config is to test the current major - which is Drupal 11 - but this module is not Drupal 11 compatabile.
I run the pipeline with the variable set to test on the previous major (i.e test on Drupal 10) and we can see the test passing here https://git.drupalcode.org/issue/xls_serialization-3362321/-/pipelines/3...
- ๐ณ๐ฟNew Zealand ericgsmith
This issue is not only applicable to the rest export - it is also applicable to the excel export and views data export modules when authentication is in place.
I have fixed this with 2 changes
I have made changes so the encoder more flexible for the data it is provided with. At the start of encode the encoder is casting everything to an array, but from that point it assumes that it has a nested array. It also makes an assumption that the row keys are numeric - but they do not have to be. So changes have been make to fix the type errors.
Once the issues in encode were fixed the endpoint was still returning errors:
Exception: Deprecated function: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated Drupal\Core\EventSubscriber\ActiveLinkResponseFilter->onResponse()() (Line: 85)
This is due to this module using an event subscriber to add the format. This was one common, but now the recommend approach is to use a service provider to register the formats as middleware. CSV serialization implemented the same change ๐ PHP 8.1 deprecated function warning Fixed which is based on how several other serializers are doing this, e.g:
- https://git.drupalcode.org/project/hal/-/blob/2.x/src/HalServiceProvider...
- https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/jsona...
- https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/file/...
- https://git.drupalcode.org/project/csv_serialization/-/blob/4.x/src/CsvS... - @ericgsmith opened merge request.
- First commit to issue fork.