Power-Components / livewire-powergrid

⚡ PowerGrid generates modern, powerful and easy-to-customize data tables using Laravel Livewire.
https://livewire-powergrid.com
MIT License
1.41k stars 206 forks source link

[TEMPORARY FIX] Data Export doesn't work when using withAvg() #1560

Closed dansysanalyst closed 1 month ago

dansysanalyst commented 1 month ago

⚡ PowerGrid - Pull Request

Welcome and thank you for your interest in contributing to our project!. You must use this template to submit a Pull Request or it will not be accepted.


Motivation

Description

This Pull Request is a temporary fix for problems exporting data under certain conditions, for example when using withAvg(). While I had this problem in the Demo, I could not replicate the bug in the tests.

In the bug I encountered, the Exception is thrown because WithExport tries to access a field that doesn't exist. This doesn't prevent data being exported, as existing fields will be included in the CSV/XLS. However, the Exception will impact the user experience.

I decided to add a rescure() to let the application continue running, but this is NOT A FIX and we should continue investigating the issue.

Related Issue(s): https://github.com/Power-Components/livewire-powergrid/issues/1540

Documentation

This PR requires Documentation update?