You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In fact I cannot. We only saw this behaviour after using datatables after a while and in a grid with 350+ records, specific to one record only. The data in that record was comparable with data from other records, so it seems to happen only occasionally and not with every Laravel model / datatables record. When I did some research online, more people see this odd behaviour only in some situations, so it's not really predictable.
The code changes in my PRs result in the same outcome as the original code, but prevents these odd errors.
Summary of problem or feature request
I get an error "Undefined offset" when an object is used to generate the data tables when that object is casted to an array and uses string keys. It turns out that in this case, keys are not usable to get a value from the casted array as stated here: https://stackoverflow.com/a/11353855/1997303. While this behaviour is odd, it seems expected: http://www.php.net/language.types.array.php#language.types.array.casting.
More details about the exception:
Solution
I fixed this with a foreach loop.
Fix for 7.0: #1674
Fix for 6.0: #1675
Fix for 5.0: #1676
The text was updated successfully, but these errors were encountered: