Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug] Unable to add ShowOperation to UserCrudController #3707

Closed
olipayne opened this issue May 8, 2021 · 2 comments
Closed

[Bug] Unable to add ShowOperation to UserCrudController #3707

olipayne opened this issue May 8, 2021 · 2 comments
Labels

Comments

@olipayne
Copy link
Contributor

olipayne commented May 8, 2021

Bug report

What I did

In attempt to make the User entries viewable, not just editable, I added ShowOperation to UserCrudController

What I expected to happen

The Preview button to display and work

What happened

Preview button works, upon clicking returns Call to undefined method Illuminate\Notifications\DatabaseNotification::identifiableAttribute()

What I've already tried to fix it

Removing the Notifiable trait from User fixes it, however then my User is not notifiable

Backpack, Laravel, PHP, DB version

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

### PHP VERSION:
PHP 8.0.5 (cli) (built: Apr 29 2021 16:01:35) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.5, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.5, Copyright (c), by Zend Technologies

### LARAVEL VERSION:
v8.40.0@a654897ad7f97aea9d7ef292803939798c4a02a4

### BACKPACK VERSION:
4.1.43@973e8ab33d42f02272f65e9688ea250fc9502d3d
@olipayne olipayne added the triage label May 8, 2021
@olipayne
Copy link
Contributor Author

olipayne commented May 8, 2021

After digging in more, it looks like this is caused by CRUD::set('show.setFromDb', true);. As it's trying to guess the column attribute to display, which this trait adds but doesn't have (?), it trips up here - https://flareapp.io/share/95JzxVM5#F64

After defining setupShowOperation() on UserCrudController with only the fields I want, it works just fine.

@promatik
Copy link
Contributor

Hi @olipayne!

This is probably already fixed with #3643 PR.
It was merged but not yet tagged, it will be soon.

In the meanwhile, you can copy the fix to your source code, it will temporarily solve it until the next update.
Let us know if it does the job 🙌

I'll close this issue for now, if it doesn't fix your issue, please let me know ✌
Sorry for the trouble.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants