199ocero / activity-timeline

Add timelines to custom pages or infolist entries effortlessly. Plus, it teams up smoothly with Spatie Activitylog for easy tracking.
https://filamentphp.com/plugins/jaocero-activity-timeline
MIT License
65 stars 18 forks source link

[Bug]: Cast array error #25

Closed zajinx closed 7 months ago

zajinx commented 8 months ago

What happened?

Unable to display timeline activity if one of the fields is cast as an array, for example the tags column is a text colum in mysql but it's using cast to array in laravel

How to reproduce the bug

create a model that has a text column, cast that column as an array edit the model, change something go to view timeline

Package Version

1.2

PHP Version

8.3

Laravel Version

11

Which operating systems does with happen with?

Windows

Notes

protected $casts = [ 'start_date' => 'datetime', 'end_date' => 'datetime', 'target_date' => 'datetime', 'tags' => 'array', ];

Error Type: TypeError PHP 8.3.2 11.0.7 htmlspecialchars(): Argument #1 ($string) must be of type string, array given

Error Location: The error occurred in the file /home/planner/public_html/planner/vendor/jaocero/activity-timeline/src/Concerns/HasSetting.php at line 176.

Error Message: The error message indicates that the function htmlspecialchars() was called with an argument that must be a string, but an array was given instead.

henryavila commented 7 months ago

I've created the PR #26 that solve this probelm.

@199ocero could you accept the PR?