saade / filament-fullcalendar

The Most Popular JavaScript Calendar as a Filament Widget
MIT License
269 stars 83 forks source link

Conflicting $record when using widget in a resource #209

Open jigar-dhulla opened 1 month ago

jigar-dhulla commented 1 month ago

I am trying to use this widget in a resource and $record property in InteractsWithRecords trait is conflicting with the resource record.

Our fetchEvents() implementation to fetch the events uses $this->record which populates the resource record correctly in the beginning. But when we click on any event, value of $this->record is overwritten by Event record.

I see a change was made in #41 , but it seems that was for an older version.

PrasadChinwal commented 1 month ago

Facing the same issue.

saade commented 1 month ago

Yes, unfortunately this is a know issue. I'm rewriting this implementation for v4

PrasadChinwal commented 1 month ago

@saade Do we have a workaround to not throw the error?

kamilst96 commented 2 weeks ago

Can't actively vouch for it, but this is my current workaround.

Install composer package: composer require cweagans/composer-patches

Add in composer.json:

"extra": {
        "patches": {
            "saade/filament-fullcalendar": {
                "Fix conflicting record": "https://github.com/kamilst96/filament-fullcalendar/commit/222533e69c154aa34e622122280b080ce50ce854.patch"
            }
        }
    },

The general idea is to replace references to ->record with ->eventRecord.

EDIT: I somehow smuggled laravel/pint into composer.json. It should pose no problem, but it was an accident.

LuciusAB commented 1 day ago

Also have this issue. Would be highly appreciated if it's possible to get it fixed, might be a while until V4 gets out?