I'm trying to uninstall "Field Layout" but I'm having errors in my terminal :

www.domaine.com@vps000000 ~/public_html $ drush pm-uninstall field_layout
 [error]  TypeError: Argument 1 passed to {closure}() must implement interface Drupal\field_layout\Display\EntityDisplayWithLayoutInterface, instance of Drupal\Core\Entity\Entity\EntityViewDisplay given in {closure}()

Comments

zenimagine created an issue. See original summary.

ahana92’s picture

Are you talking about uninstalling the module "field layout"? Field Layout is a contributed module in drupal 7 and still not available in drupal 8. The machine name for the module is fieldlayout. So for uninstalling you can try giving drush pm-uninstall fieldlayout

ahana92’s picture

ahana92’s picture

Assigned: Unassigned » ahana92
ahana92’s picture

seems like you are trying to uninstall core field_layout module, I m trying to reproduce

zenimagine’s picture

Yes, I am talking about the experimental module of drupal core 8

ahana92’s picture

Status: Active » Needs review
StatusFileSize
new428 bytes

While installing the module field_layout, we are installing the module layout_builder. In the .install file of the layout_builder you will see this line $field_layout = $display->getThirdPartySettings('field_layout');
The layout_builder module is dependent on field_layout module. So adding a dependency of field_layout module on layout_builder module solved the issue. We need to uninstall the layout_builder module first as its dependent on the other one. After that try to uninstall the field_layout module. I have attached the patch for it.

ahana92’s picture

Assigned: ahana92 » Unassigned
cilefen’s picture

Component: field system » layout_builder.module
tim.plunkett’s picture

Title: Can not uninstall "Field Layout" » Can not uninstall Field Layout while Layout Builder is installed
Version: 8.5.0 » 8.6.x-dev
Component: layout_builder.module » field_layout.module
StatusFileSize
new1.65 KB

Layout Builder has no dependency on Field Layout.
LB does read the Field Layout configuration during install, if it exists.
But it does not need it to function.

I believe the issue is that once LB is installed, the logic within field_layout_uninstall() can fail.

zenimagine’s picture

I have to apply which patch to uninstall "Field Layout" from Drupal 8.5 ?

zenimagine’s picture

StatusFileSize
new36.01 KB

The patch does not work, unable to uninstall this module.

The module tries to uninstall the list below and displays a blank page.

If I refresh my page, the screenshot error appears.

Configuration updates
The listed configuration will be updated.
Affichage du formulaire de l'entité

block_content.basic.default
block_content.parallax.default
block_content.section.default
comment.annonce.default
comment.article.default
comment.demande.default
comment.discussion.default
comment.evenement.default
comment.itineraire.default
comment.produit.default
comment.recette.default
comment.service.default
commerce_order.abonnement.default
commerce_order.produit.default
commerce_order.service.default
commerce_order_item.abonnement.add_to_cart
commerce_order_item.abonnement.default
commerce_order_item.produit.add_to_cart
commerce_order_item.produit.default
commerce_order_item.service.add_to_cart
commerce_order_item.service.default
commerce_product.abonnement.default
commerce_product.produit.default
commerce_product.service.default
commerce_product_variation.abonnement.default
commerce_product_variation.produit.default
commerce_product_variation.service.default
commerce_shipment.default.default
commerce_store.administrateur.default
commerce_store.professionnel.default
flagging.like_group.default
flagging.like_node.default
flagging.like_product.default
flagging.like_store.default
flagging.report_comment.default
flagging.report_group.default
flagging.report_node.default
flagging.report_product.default
flagging.report_profile.default
flagging.report_store.default
group.administrateur.default
group.personnel.default
group.professionnel.default
group_content.administrateur-group_membership.default
group_content.personnel-group_membership.default
group_content.personnel-group_node-discussion.default
group_content.personnel-group_node-itineraire.default
group_content.professionnel-group_membership.default
media.audio.default
media.file.default
media.image.default
media.video.default
node.annonce.default
node.article.default
node.demande.default
node.discussion.default
node.evenement.default
node.guide.default
node.itineraire.default
node.page.default
node.question.default
node.recette.default
paragraph.bp_accordion.default
paragraph.bp_accordion_section.default
paragraph.bp_blank.default
paragraph.bp_block.default
paragraph.bp_carousel.default
paragraph.bp_column_wrapper.default
paragraph.bp_columns.default
paragraph.bp_columns_three_uneven.default
paragraph.bp_columns_two_uneven.default
paragraph.bp_image.default
paragraph.bp_modal.default
paragraph.bp_simple.default
paragraph.bp_tab_section.default
paragraph.bp_tabs.default
paragraph.bp_view.default
paragraph.evenement_programmations.default
paragraph.itineraire_poi.default
paragraph.recette_instructions.default
private_message.private_message.default
private_message_thread.private_message_thread.default
profile.customer.default
profile.professionnel.default
taxonomy_term.guide_categories.default
taxonomy_term.produit_labels.default
taxonomy_term.profil_sexe.default
taxonomy_term.recette_ingredients.default
taxonomy_term.recette_types.default
user.user.default

Entité d'affichage

block_content.basic.default
block_content.parallax.default
block_content.section.default
comment.annonce.default
comment.article.default
comment.demande.default
comment.demande.full
comment.discussion.default
comment.evenement.default
comment.itineraire.default
comment.produit.default
comment.recette.default
comment.service.default
commerce_order.abonnement.default
commerce_order.produit.default
commerce_order.service.default
commerce_order_item.abonnement.default
commerce_order_item.produit.default
commerce_order_item.produit.teaser
commerce_order_item.service.default
commerce_product.abonnement.default
commerce_product.abonnement.teaser
commerce_product.abonnement.teaser_relation
commerce_product.produit.default
commerce_product.produit.teaser
commerce_product.produit.teaser_relation
commerce_product.service.default
commerce_product.service.teaser
commerce_product.service.teaser_relation
commerce_product_variation.abonnement.cart
commerce_product_variation.abonnement.default
commerce_product_variation.abonnement.teaser
commerce_product_variation.produit.cart
commerce_product_variation.produit.default
commerce_product_variation.produit.teaser
commerce_product_variation.service.cart
commerce_product_variation.service.default
commerce_product_variation.service.teaser
commerce_shipment.default.default
commerce_shipment.default.user
commerce_store.personnel.default
commerce_store.personnel.product_default
commerce_store.personnel.product_teaser_relation
commerce_store.personnel.teaser_relation
commerce_store.professionnel.default
commerce_store.professionnel.product_default
commerce_store.professionnel.product_teaser_relation
commerce_store.professionnel.teaser
commerce_store.professionnel.teaser_relation
flagging.like_group.default
flagging.like_node.default
flagging.like_product.default
flagging.like_store.default
flagging.report_comment.default
flagging.report_group.default
flagging.report_node.default
flagging.report_product.default
flagging.report_profile.default
flagging.report_store.default
group.personnel.default
group.personnel.node_default
group.personnel.node_teaser_relation
group.personnel.teaser
group.personnel.teaser_relation
group.professionnel.default
group_content.administrateur-group_membership.default
group_content.personnel-group_membership.default
group_content.personnel-group_node-article.default
group_content.professionnel-group_membership.default
media.audio.default
media.file.default
media.video.default
node.annonce.default
node.annonce.teaser
node.annonce.teaser_relation
node.article.default
node.article.rss
node.article.search_index
node.article.search_result
node.article.teaser
node.article.teaser_relation
node.demande.default
node.demande.teaser
node.discussion.default
node.discussion.teaser
node.discussion.teaser_relation
node.evenement.default
node.evenement.teaser
node.evenement.teaser_relation
node.guide.default
node.guide.teaser
node.itineraire.default
node.itineraire.teaser
node.itineraire.teaser_relation
node.page.default
node.page.teaser
node.question.default
node.question.teaser
node.recette.default
node.recette.teaser
node.recette.teaser_relation
paragraph.bp_accordion.default
paragraph.bp_accordion_section.default
paragraph.bp_blank.default
paragraph.bp_block.default
paragraph.bp_carousel.default
paragraph.bp_column_wrapper.default
paragraph.bp_columns.default
paragraph.bp_columns_three_uneven.default
paragraph.bp_columns_two_uneven.default
paragraph.bp_image.default
paragraph.bp_modal.default
paragraph.bp_simple.default
paragraph.bp_tab_section.default
paragraph.bp_tabs.default
paragraph.bp_view.default
paragraph.evenement_programmations.default
paragraph.itineraire_poi.default
paragraph.recette_ingredients.default
paragraph.recette_instructions.default
private_message.private_message.default
private_message.private_message.inbox
private_message_thread.private_message_thread.default
private_message_thread.private_message_thread.inbox
profile.customer.default
profile.personnel.default
profile.personnel.statut
profile.personnel.teaser
profile.personnel.utilisateur
profile.professionnel.default
taxonomy_term.guide_categories.default
taxonomy_term.produit_labels.default
taxonomy_term.profil_sexe.default
taxonomy_term.recette_ingredients.default
taxonomy_term.recette_types.default
user.user.compact
user.user.contact
user.user.default
user.user.private_message_author

gloriaswebtech’s picture

StatusFileSize
new2.08 KB

I was installing this module and had the same issue on install. I then tried to uninstall it and had the same results. I fixed it on version 8.5 with the following code. It is not very efficient, but loading from the EntityDisplayBase class produced a content entity type error due to it being abstract and not having a ContentEntityType annotation. Unless there has been some major change, I think this will suffice until it can be optimized. Hope this helps :)

Status: Needs review » Needs work

The last submitted patch, 13: 2954776-layout_install-13.patch, failed testing. View results

gloriaswebtech’s picture

StatusFileSize
new1.97 KB
tim.plunkett’s picture

Can you provide interdiffs from my patch in #10 and explain the differences?

gloriaswebtech’s picture

Sorry about the failed attempts. I am really new to the patch process and was trying my best to get it up there. However, after you, tim.plunkett, mentioning your patch #10 and asking for interdiffs, I no longer feel the need to get mine up there. Yours is more efficient with EntityDisplayInterface. I did not see that the first time I came to this issue (I just knew it had to do with some entities not implementing the EntityDisplayWithLayoutInterface).

agileadam’s picture

Thanks Tim. #10 worked for me.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new1.65 KB

Reuploading #10.

dqd’s picture

git apply -v 2954776-layout_install-19.patch
Checking patch core/modules/field_layout/field_layout.install...
Applied patch core/modules/field_layout/field_layout.install cleanly.
drupal module:uninstall field_layout
 The following module(s) were uninstalled successfully: "field_layout"
 You should execute now the following command: "composer remove vendor/package"
 // cache:rebuild
 Rebuilding cache(s), wait a moment please.
 [OK] Done clearing cache(s).

RTBC from me.

shaktik’s picture

StatusFileSize
new168.33 KB

I have tested this patch for uninstalling "Field Layout" from Drupal 8.5.4 is also working fine.

zenimagine’s picture

Does the patch work with 8.5 ?

zenimagine’s picture

OK I tested and it works on 8.5 thank you

tedbow’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

The fix looks good but could we add a simple test to LayoutBuilderFieldLayoutCompatibilityTest.

Right now this would fail without the patch:

public function testFieldLayoutUninstall() {
    $this->installLayoutBuilder();
    $this->container->get('module_installer')->uninstall(['field_layout']);
  }

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

neclimdul’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new2.84 KB
new2.84 KB
new1.23 KB
new2.83 KB

How bout this?

The last submitted patch, 26: 2954776-26-install_FAIL.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

The last submitted patch, 26: 2954776-26-uninstall_FAIL.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Status: Needs review » Needs work

The last submitted patch, 26: 2954776-26.patch, failed testing. View results

neclimdul’s picture

Status: Needs work » Needs review
StatusFileSize
new2.83 KB

trying again.

Shevchuk’s picture

Patch from #30 works fine on 8.6.0-rc1

saranraj.g’s picture

#30 patch works fine on 8.6.1

perarg’s picture

#30 did the job! Thank you on 8.6.1

dqd’s picture

Status: Needs review » Reviewed & tested by the community

So, RTBC?

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 68f9fd50e8 to 8.7.x and 170c6a60f2 to 8.6.x. Thanks!

Credited @tedbow for a review comment that helped get test coverage.
@Gtucker6, @ahana92 posted patches but didn't get credit because their patches didn't contribute to the issue being fixed as far as I can see.
@shaktik thanks for testing the patch but screenshots of the patch applying are not necessary because we have automated tests that tell us if the patch applied. I appreciate that you also showed a successful uninstall of the field layout module but the screenshot did not indicate that layout builder was installed.

  • alexpott committed 68f9fd5 on 8.7.x
    Issue #2954776 by neclimdul, tim.plunkett, zenimagine, tedbow: Can not...

  • alexpott committed 170c6a6 on 8.6.x
    Issue #2954776 by neclimdul, tim.plunkett, zenimagine, tedbow: Can not...

Status: Fixed » Closed (fixed)

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

zenimagine’s picture

Issue summary: View changes