Problem/Motivation

Hi,

I'm trying to uninstall the commerce_stock_local module but can't. It needs to remove "commerce_stock_always_in_stock field values", as reported on the uninstall screen, but it fails with a WSOD and error:
Error: Call to undefined method Drupal\Core\Config\Entity\ConfigEntityType::isSubclassOf() in Drupal\commerce_stock_local\Form\PrepareUninstallForm->submitForm() (line 90 of /var/www/XXX/modules/contrib/commerce_stock/modules/local_storage/src/Form/PrepareUninstallForm.php).

Stacktrace:

#0 [internal function]: Drupal\commerce_stock_local\Form\PrepareUninstallForm->submitForm()
#1 /var/www/XXX/core/lib/Drupal/Core/Form/FormSubmitter.php(129): call_user_func_array()
#2 /var/www/XXX/core/lib/Drupal/Core/Form/FormSubmitter.php(67): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers()
#3 /var/www/XXX/core/lib/Drupal/Core/Form/FormBuilder.php(597): Drupal\Core\Form\FormSubmitter->doSubmitForm()
#4 /var/www/XXX/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm()
#5 /var/www/XXX/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#6 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#7 /var/www/XXX/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#8 /var/www/XXX/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#9 /var/www/XXX/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#10 /var/www/XXX/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#11 /var/www/XXX/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#12 /var/www/XXX/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#13 /var/www/XXX/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#14 /var/www/XXX/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#15 /var/www/XXX/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#16 /var/www/XXX/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\ContentLength->handle()
#17 /var/www/XXX/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#18 /var/www/XXX/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#19 /var/www/XXX/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#20 /var/www/XXX/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#21 /var/www/XXX/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#22 /var/www/XXX/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#23 /var/www/XXX/index.php(19): Drupal\Core\DrupalKernel->handle()
#24 {main}

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

AlfTheCat created an issue. See original summary.

abhishek_gupta1 made their first commit to this issue’s fork.

abhishek_gupta1’s picture

Status: Active » Needs review

@AlfTheCat, I have make some changes corresponding the issue. please kindly review the MR

alfthecat’s picture

@abhishek_gupta1 fantastic, very grateful for that patch. Worked perfectly, thank you.

gogowitsch made their first commit to this issue’s fork.

gogowitsch’s picture

Status: Needs review » Reviewed & tested by the community

I ran into the exact same problem.

I can confirm that MR !20 worked. I simplified the code by replacing $this->entityTypeManager->getDefinition($entity_type->id()) with $entity_type.

oana.hulpoi’s picture

Hi,
I run into the same issue. This patch works as expected.
Thank you,

mediengenosse’s picture

Bug ist still persistant. Patch works like expected.

guy_schneerson made their first commit to this issue’s fork.

  • guy_schneerson committed c124c73e on 3.x
    #3416637 - 3.x fix for Cant uninstall commerce_stock_always_in_stock
    
guy_schneerson’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

gogowitsch’s picture

Thanks for marking this as fixed.

Please review the contribution record. Thanks! 😇🙏

guy_schneerson’s picture

Sure thing, and thanks for your contribution :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.