Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ShowOpeartion with soft delete not working #4998

Closed
rickyviz opened this issue Mar 27, 2023 · 6 comments
Closed

ShowOpeartion with soft delete not working #4998

rickyviz opened this issue Mar 27, 2023 · 6 comments
Assignees
Labels

Comments

@rickyviz
Copy link

Bug report

I use soft delete on a specific model, for trashed . on ShowOpeartion return query false, because id not found,

What I expected to happen

??

What happened

can't correct query on show operation on deleted data (Soft deleted)

What I've already tried to fix it

  function setupShowOperation()
    {
        // $this->crud->addClause('withTrashed');
        $this->setupListOperation();
        $this->crud->query = $this->crud->query->withTrashed();
   }

Is it a bug in the latest version of Backpack?

Backpack 4

@welcome
Copy link

welcome bot commented Mar 27, 2023

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication channels:

  • Bug Reports, Feature Requests - Github Issues (here);
  • Quick help (How do I do X) - Gitter Chatroom;
  • Long questions (I have done X and Y and it won't do Z wtf) - Stackoverflow, using the backpack-for-laravel tag;
  • Showing off something you've made, asking for opinion on Backpack/Laravel matters - Reddit;

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

--
Justin Case
The Backpack Robot

@phpfour phpfour self-assigned this Mar 29, 2023
@phpfour
Copy link
Contributor

phpfour commented Mar 29, 2023

Hello @rickyviz, please check if you have the below flag set to true in your config file at: config/backpack/operations/show.php:

CleanShot 2023-03-30-00 45 12

You wouldn't need to override the setupShowOperation if the above is set correctly.

@phpfour phpfour moved this to Needs Testing, Review or Docs in This week Mar 29, 2023
@rickyviz
Copy link
Author

@phpfour i can't find config/backpack/operations/show.php

@phpfour
Copy link
Contributor

phpfour commented Mar 30, 2023

@rickyviz Can you please run php artisan backpack:version and share the output ? If that doesn't work, can you share your composer.json file?

@rickyviz
Copy link
Author

@phpfour thanks for response

LARAVEL VERSION:

v8.83.23

BACKPACK VERSION:

4.1.71
this composer.json
"backpack/crud": "4.1.*",
"backpack/filemanager": "^1.1",
"backpack/permissionmanager": "^6.0",
"barryvdh/laravel-dompdf": "^0.9.0",

@pxpm
Copy link
Contributor

pxpm commented Mar 31, 2023

@rickyviz sorry it's not available in that version.

We fixed it in v5 and left that bug behind because the fix was a breaking change, that we could only push on a new version (v5).

You have in this PR the logs of what changed, you may want to try to re-implement it in your application manually if updating is not possible.

Cheers

@pxpm pxpm closed this as completed Mar 31, 2023
@github-project-automation github-project-automation bot moved this from Needs Testing, Review or Docs to Done in This week Mar 31, 2023
@tabacitu tabacitu removed this from This week Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants