Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8968175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:24:40+00:00 2026-06-15T17:24:40+00:00

I’m using Gedmo Doctrine Extensions , such as SoftDeletable, and at various points I

  • 0

I’m using Gedmo Doctrine Extensions, such as SoftDeletable, and at various points I need to disable this filter so that users can interact with soft deleted entities, or soft deleted relations of an entity.

This includes but is not limited to, once in a controller and again in a specific area of the SonataAdmin.

So far the solution I’ve found is to call getFilters() on the em and disable softdeleteable, which is fine.

However both sonata admin classes and controllers seem to go through multiple executions, which causes a fatal attempting to disable an already disabled filter, so I have to do this:

    if (array_key_exists('softdeleteable', $this->em->getFilters()->getEnabledFilters())) {
        $this->em->getFilters()->disable('softdeleteable');
    }

Which seems itself hacky to say the least.

But also, there are other problems, such as scoping of the command. I haven’t spotted any problems frontend yet, but in the admin, the multiple executions, one of which is to build the navigation (I think) means that the filter is always disabled, and only being able to do this directly on the em seems to me like it will cause a hell of a load of issues as soon as I don’t want the functionality disabled somewhere backend.

Is there a better way of doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:24:41+00:00Added an answer on June 15, 2026 at 5:24 pm

    Whilst at the time of writing, the answer was no, the functionality to disable filters on a per-entity basis has now been added, like so:

    // Enable / Disable filter filter, for specified entity (default is enabled for all)
    $filter = $em->getFilters()->enable('soft-deleteable');
    $filter->disableForEntity('Entity\Article');
    $filter->enableForEntity('Entity\Article');
    

    Documentation: https://github.com/l3pp4rd/DoctrineExtensions/blob/master/doc/softdeleteable.md

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I know there's a lot of other questions out there that deal with this
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I need to clean up various Word 'smart' characters in user input, including but
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.