Laravel-Backpack / activity-log

MIT License
23 stars 6 forks source link

[Bug] Update model with relations is not logged #42

Closed stamimy closed 3 months ago

stamimy commented 3 months ago

Bug report

What I did

I have Pets and Skills tables just like in the Demo Site.

Basically Pet can have multiple Skills. But when I update a Pet's Skills, the Skills changes are not recorded in the activity logs.

This only affect data in relation. If I update Pet's name then it works (the changes are recorded in activity logs)

What I expected to happen

The Skills data is recorded in the activity logs.

What happened

The Skills data is not recorded

What I've already tried to fix it

Tried to follow from spatie docs, and its github page, nothing works.

Context to replicate the bug - Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

### PHP VERSION:
8.3.8

### PHP EXTENSIONS:
Core, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, mysqlnd, PDO, xml, bcmath, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, iconv, igbinary, imagick, imap, intl, ldap, exif, msgpack, mysqli, pcov, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, redis, shmop, SimpleXML, soap, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, memcached, swoole, Zend OPcache, xdebug

### LARAVEL VERSION:
11.11.1.0

### BACKPACK PACKAGE VERSIONS:
backpack/activity-log: 2.0.4
backpack/basset: 1.3.4
backpack/crud: 6.7.17
backpack/devtools: 3.1.5
backpack/editable-columns: 3.0.9
backpack/generators: v4.0.5
backpack/permissionmanager: 7.2.1
backpack/pro: 2.2.4
backpack/settings: 3.1.1
backpack/theme-tabler: 1.2.10

I have no idea whether this related to this issue https://github.com/spatie/laravel-activitylog/issues/1281 ? if so, any workaround?

Thanks

karandatwani92 commented 3 months ago

Hey @stamimy

It's not a BUG. You see only what you configured to be logged. This package only provides a UI for entries logged by spatie/laravel-activitylog. Spatie's Activitylog docs is the right place to know how to configure to log related entries.

If you find a solution for this, please comment below to help others. Thanks