Problem/Motivation

We need to deprecate \Drupal\layout_builder\QuickEditIntegration and refactor it so that quickedit contrib provides the integration with layout builder, so it can be removed in Drupal 10.

Steps to reproduce

N/A

Proposed resolution

  • Move \Drupal\layout_builder\QuickEditIntegration to \Drupal\quickedit\LayoutBuilderIntegration
  • Deprecate \Drupal\layout_builder\QuickEditIntegration
  • Move hook references to QuickEditIntegration to quickedit module
  • Refactor LayoutBuilderEntityViewDisplay::getQuickEditSectionComponent in to quickedit module.
  • Provide tests to satisfy jsonapi and rest modules

Remaining tasks

User interface changes

None

API changes

\Drupal\layout_builder\QuickEditIntegration is deprecated in favour of \Drupal\quickedit\LayoutBuilderIntegration.

Data model changes

None

Release notes snippet

The Quick Edit integration for Layout Builder is now provided by the Quick Edit module. This has been backported to 9.4.2 to retain as much parity as possible with the contributed version of Quick Edit.

Issue fork drupal-3264633

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Spokje created an issue. See original summary.

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

mstrelan’s picture

Status: Active » Needs work

Here's a start. Haven't tried to refactor \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::getQuickEditSectionComponent and haven't tested it at all.

dww’s picture

Thanks, y'all! Standing by to commit whatever's supposed to go into QE contrib into place. ;) I'll try to review the core patches as they arrive...

Spokje’s picture

Thanks, y'all! Standing by to commit whatever's supposed to go into QE contrib into place. ;) I'll try to review the core patches as they arrive...

Ah, the everlasting optimism of the youth... ;)

mstrelan’s picture

The test passed, but I don't really know what it is testing, nor what the integration provides. In manual testing before the patch I could quickedit the body field of a node that was rendered with layout builder but with the patch I couldn't.

mstrelan’s picture

Issue summary: View changes

Update on manual testing. Previously I still had the contrib module in place, so I was not actually testing the patch. I have tested again today with the steps below and the integration appears to be working:

  1. Enable layout builder for article content type
  2. Create an article node with some text in the body
  3. Quickedit the node. If the integration works you can update the body field. Without the integration you can only change the title.

That just leaves LayoutBuilderEntityViewDisplay::getQuickEditSectionComponent to be refactored in to quickedit module.

xjm’s picture

mstrelan’s picture

There are actually at least three tests that cover the layout builder / quickedit integration:

  • \Drupal\Tests\quickedit\Functional\LayoutBuilderQuickEditTest
  • \Drupal\Tests\quickedit\FunctionalJavascript\LayoutBuilderIntegrationTest
  • \Drupal\Tests\quickedit\FunctionalJavascript\LayoutBuilderQuickEditTest

I have updated the MR to move all remaining quickedit references in layout_builder. Let's see what the testbot thinks.

mstrelan’s picture

The latest commit 18f61cf5 should make the remaining tests pass, but they really don't provide any value. I believe #3043245: Allow marking a config schema types to be marked as "internal" (to avoid exposing them via HTTP APIs) would mean we could remove them. They also shouldn't need to exist in contrib because the test coverage tests won't be looking for them.

mstrelan’s picture

Status: Needs work » Needs review
mstrelan’s picture

Issue summary: View changes
tim.plunkett’s picture

From a Layout Builder perspective, this looks great. I didn't have a chance to review it from a BC perspective, but untagging for subsystem maintainer review for now.

mstrelan’s picture

Don't know why that's failing now when it was passing before and is passing locally. I merged in 9.4.x and made some minor adjustments, let's try again.

mstrelan’s picture

This makes a lot more sense now that I see #3263654: Move all HAL tests to the module in preparation of removal in D10. So the question is should the hal tests for quickedit live in the hal module since both modules are moving to contrib?

catch’s picture

So the question is should the hal tests for quickedit live in the hal module since both modules are moving to contrib?

If we move the hal tests for quickedit to hal, then it means hal needs to get removed from core before quickedit, otherwise its tests would start to break. Since they're both very close, it shouldn't matter.

mstrelan’s picture

The way the coverage checker test is written means the tests have to live in hal for now as per the last commit in this MR.

bbrala’s picture

I just did a subtree split for hal (awww xD), but can always just force push a new split since there was no real work done yet.

mstrelan’s picture

@bbrala I don't think hal in contrib would need to include these tests. They can possibly exist in quickedit contrib but they really only exist right now to make core tests happy.

bbrala’s picture

Hmm, ok, we'll see. Feels like i rather split the exact state it is at the point it is removed. So if there is extra tests added, i'd split with those, then remove in contrib if needed.

But that might be extra work that is not needed, IF the tests live in a separate file to other HAL tests.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Great, thanks! And thanks for confirming my suspicions @larowlan, good to be able to point to the actual place for that :)

dww’s picture

Assigned: Unassigned » dww
Status: Reviewed & tested by the community » Needs review

I suspect this is RTBC, but I’d like to take a look before this happens in core, not just when this is all hitting QE contrib. I botched this on help topics, and only noticed some problems late. Trying to be more proactive this time.

Spokje’s picture

Thanks @dww, I looked at this briefly, and didn't want to postpone this on my findings, but now you have put it back on NR, I've got a few tiny nits to pick.

dww’s picture

Assigned: dww » Unassigned
Status: Needs review » Needs work

The CR looks good (reviewed it while checking links on deprecation messages), although don't we usually put the exact release something was introduced in? Should it not be 9.4.0-alpha1, not just 9.4.0?

Meanwhile, I opened about a dozen new MR threads. Mostly nits and probably-out-of-scope stuff, but a couple of points that are legit reasons this needs work before commit.

Thanks,
-Derek

mstrelan’s picture

Updated the test groups and added the moduleExists check.

The CR looks good (reviewed it while checking links on deprecation messages), although don't we usually put the exact release something was introduced in? Should it not be 9.4.0-alpha1, not just 9.4.0?

In the codebase I searched core for other deprecations and there are plenty of 9.4.0 deprecations and zero for 9.4.0-alpha1. There are also plenty of CRs for 9.4.0 and only one for 9.4.0-alpha1.

catch’s picture

In the codebase I searched core for other deprecations and there are plenty of 9.4.0 deprecations and zero for 9.4.0-alpha1

Yes this is correct, we always do the next stable release.

dww’s picture

Status: Needs work » Needs review

Thanks! Looks like this is ready for re-review. Can’t respond to specifics now, but I hope to look later today...

quietone’s picture

Changing parent to the issue tracking the steps to deprecate quickedit.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

catch’s picture

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

This is going to need a 10.x version without the HAL changes, since HAL module is already removed.

mstrelan’s picture

Status: Needs work » Needs review

Merged 9.5.x in to the existing MR and cherry-picked the commits in to a new 10.0.x MR. Best to review the 9.5.x MR as it has existing comments.

mstrelan’s picture

Status: Needs review » Needs work
Issue tags: -Needs reroll

Needs work as per latest MR feedback

mstrelan’s picture

Status: Needs work » Needs review

Updated deprecation message in 9.x PR and removed the class in 10.x PR. Updated CR.

larowlan’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me, reviewed both PRs and can't find anything that's worth holding this up on.

There's a few unresolved threads in the 9x PR but I think they're technically resolved.

mstrelan’s picture

Status: Reviewed & tested by the community » Needs review

Setting back to NR since I added another commit

larowlan’s picture

Status: Needs review » Reviewed & tested by the community

@mstrelan and I discussed whether using the layout builder class constant in quickedit was safe in the case where layout builder was disabled and decided to go with the string to be safe. Back to RTBC

  • catch committed fe516c1 on 10.0.x
    Issue #3264633 by mstrelan, Spokje, dww, larowlan, catch, tim.plunkett,...
  • catch committed 9423cae on 9.5.x
    Issue #3264633 by mstrelan, Spokje, dww, larowlan, tim.plunkett, xjm:...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed the respective MRs to 10.0.x and 9.5.x, thanks!

  • catch committed 5020329 on 9.4.x
    Issue #3264633 by mstrelan, Spokje, dww, larowlan, tim.plunkett, xjm:...
catch’s picture

Version: 9.5.x-dev » 9.4.x-dev

I've backported this to 9.4.x, because not having it there is causing issues with contrib quickedit + 9.4.x

While this introduced a couple of deprecations, it's not API surface we expect anyone to be using, so I think we should treat it similar to a constructor deprecation to fix a bug. If it turns out there's a problem, there's time to revert before the next patch release of core, but we'd then need do diverge contrib quickedit further from the core version which further increases the chance of more bugs.

xjm’s picture

Issue tags: +9.5.0 release notes
xjm’s picture

Issue tags: +Needs release note
catch’s picture

Issue summary: View changes
Issue tags: +9.4.2 release notes

Tagging for 9.4.2 release notes.

Spokje’s picture

Issue tags: -9.5.0 release notes

Changed and published CR from 9.5.0 to 9.4.2.

Which raises the question: Should we update the deprecation notices in the code to mention 9.4.2 instead of 9.5.0?

Spokje’s picture

As discussed with catch on Slack (https://drupal.slack.com/archives/C014CT1CN1M/p1656055522793509) a follow-up to update the deprecation errors to 9.4.2 instead of 9.5.0 is needed.

Here it is: #3292413: Update deprecation error made in [#3264633] from 9.5.0 to 9.4.2

  • catch committed 2fc70d9 on 9.5.x
    Issue #3292413 by Spokje: Update deprecation error made in [#3264633]...

  • catch committed 8c6c72c on 9.4.x
    Issue #3292413 by Spokje: Update deprecation error made in [#3264633]...
xjm’s picture

Issue summary: View changes

Adding CR link to the release note. Thanks!

Status: Fixed » Closed (fixed)

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

Wim Leers’s picture

Issue tags: -Needs release note

Release note was already added in #51 👍