Remove deprecated core module Place Blocks (block_place) -module code.

See https://www.drupal.org/project/drupal/issues/3062281#comment-13249967

Release notes snippet

The Place Blocks experimental module has been removed from core. (It was already hidden with no further development since Drupal 8.6.0, and was formally deprecated in Drupal 8.8.0.). See the change record on Place Blocks for replacement suggestions.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rpsu created an issue. See original summary.

Version: 9.x-dev » 9.0.x-dev

The 9.0.x branch will open for development soon, and the placeholder 9.x branch should no longer be used. Only issues that require a new major version should be filed against 9.0.x (for example, removing deprecated code or updating dependency major versions). New developments and disruptive changes that are allowed in a minor version should be filed against 8.9.x, and significant new features will be moved to 9.1.x at committer discretion. For more information see the Allowed changes during the Drupal 8 and 9 release cycles and the Drupal 9.0.0 release plan.

rpsu’s picture

This can proceed now. #3084471: Remove/fix legacy tests after Place Blocks -module removal should be taken into account as well.

ravi.shankar’s picture

Status: Active » Needs review
FileSize
23.75 KB

I have tried to remove block_place module, please review.

rpsu’s picture

I am not fully certain if the Legacy* -tests introduced in #3062281: Deprecate block_place module for removal in Drupal 9 are supposed to be left around, or just remove the (only) module that is excluded in the non-Legacy* tests around.

As of now they serve no purpose, however they may hold some future value. All the modules that are utilizing the trait DeprecatedModulesTestTrait blindly enable every core module for their tests, and introducing some other mechanism to locate the deprecated AND/OR experimental module might be a good option in the near future. If that is the case, the trait could be used, or extended/updated to provide list of suitable set of modules to be enabled.

JeroenT’s picture

Patch no longer applied. Created a reroll.

JeroenT’s picture

@rpsu,

Briefly discussed with @borisson_ and @wimleers. They suggested keeping that trait for now since it's possible that some modules will be marked deprecated in Drupal 9. If not, we can still remove the trait later.

Berdir’s picture

Agree with that too, we'll eventually deprecate modules again.

I confirmed that there is no mention of block_place left after applying the patch.

But I think we can include #3084471: Remove/fix legacy tests after Place Blocks -module removal here as well and unmark these tests?

Gábor Hojtsy’s picture

Agreed, closed #3084471: Remove/fix legacy tests after Place Blocks -module removal as duplicate. @berdir: I don't think we would unmark them, we would remove the legacy ones, no? At least they would be doing the same test twice once we remove block_place from the trait's list.

Berdir’s picture

Depends on the test, but my understanding is that some of these tests are only legacy because they can't avoid touching the block_place module and triggering that message? Typically because they just loop overall modules and install them for things. So we still need their test coverage, but now they shouldn't trigger any deprecation messages anymore?

catch’s picture

Title: Remove Place Blocks -module code » Remove Place Blocks module
Priority: Normal » Critical
Issue tags: +Drupal 9.0.0-beta1 requirement

Bumping to critical since this has to happen before beta (or we'd have to update all the deprecation messages).

With the legacy tests, we already have modules we're about to deprecate in Drupal 9 for Drupal 10, so I'm not sure we can actually unmark everything. Although we could unmark and remark maybe to see what's really necessary? See #3111645: Uninstall entity_reference module and prevent it being enabled again, remove deprecated code for an example, but that shouldn't requite @legacy anywhere since there's not really any PHP code left to deprecate.

Berdir’s picture

entity_reference does, as far as I see, have any code left with @trigger_error()'s in it, so it shouldn't actually trigger anything. The trait is now an empty list of modules, it already doesn't do anything now, so we can definitely remove the usages.

I realized that all usages of the trait come with a subclass that tests not only the legacy modules but all the modules including legacy again, so I definitely think we should clean that up and only if really necessary add it back. (I didn't know that in #8). Not a huge deal for the kernel tests, but HelpTopicsSyntaxTest is no joke.

I never understood the "aggressive" @trigger_error() approach in block_place, as we didn't actually deprecate the API's, just move them out of core, and a single hook_requirements() just like we did now in entity_reference.module would have been enough IMHO :)

rpsu’s picture

If all usages of this trait will be gone should the trait be documented slightly better? For the some future day we'll deprecate something in core (#3111645: Uninstall entity_reference module and prevent it being enabled again, remove deprecated code 's follow up for Drupal 10 for example).

Berdir’s picture

Not sure, maybe in a follow-up that's not a beta blocker?

I don't think entity_reference will need this, as we can just remove it in D10, but there might be other modules, although I'll try to push for a simpler approach. To be perfectly clear, I do not mean to say anything negative about the work you did, you simply did what was required to get it committed and prepared for its removal from core.

rpsu’s picture

Yes, none taken :) - I am perfectly aware how things evolved.

My point is that if this trait is kept for future purposes and nothing is actually using it now (ie. all Legacy* tests using it are removed) this appears as dead piece of code unless it contains a reasoning why it exists, and how to use it. Or would this be clear enough in - say - 3 years? I am thinking of a issue reference in the docblock or a couple of sentences of why it exists/how it is intended to be used.

Thoughts on this?

Berdir’s picture

@catch suggested to just remove the trait and also suggested to change the deprecation approacg in block_place to be less "aggressive", meaning no @trigger_error() in the module file, similar to my change in #3062302: Properly deprecate the entity reference module. (In a follow-up)

There is a single use of it currently in contrib, in a migrate module.

We'll also need a change record for the removal of that trait.

andypost’s picture

But this trait could be useful in 9.x release cycle, other then that needs CR

Status: Needs review » Needs work

The last submitted patch, 16: 3084472-16.patch, failed testing. View results

Berdir’s picture

Status: Needs work » Needs review
FileSize
46.42 KB
929 bytes

One class still had the trait.

Status: Needs review » Needs work

The last submitted patch, 19: 3084472-19.patch, failed testing. View results

Berdir’s picture

Status: Needs work » Needs review
FileSize
46.76 KB
729 bytes

And now also removed the call to that method..

rpsu’s picture

Status: Needs review » Reviewed & tested by the community

Provided the trait should be gone and not saved for the future purposes, RTBC

rpsu’s picture

oh man, pre-release of CR [#3116386] is there but I can't see how to attach it here?

rpsu’s picture

Never mind, magic happened anyway behind the scenes.

catch’s picture

I think we need the follow-up to remove the .module trigger_error() from place blocks in 8.8 and 8.9 before we can commit this, but looks good otherwise.

alexpott’s picture

At first sight this issue removing deprecated modules trait looks odd but actually I think if we do need to implement something like that in D9 then we should do it better.

One thought is that essentially we're doing the thing that causes #2917600: update_fix_compatibility() puts sites into unrecoverable state so it would be great to have that fixed.

catch’s picture

alexpott’s picture

Looks like only 3 contrib projects are going to be affected - not too bad... http://grep.xnddx.ru/search?text=-%20block_place&filename=

webchick’s picture

Is someone in contact with the https://www.drupal.org/project/block_place maintainers to replace the content of their repo with this module once (or before) this patch goes in?

EDIT: Yep, looks like this was taken care of in #3062281: Deprecate block_place module for removal in Drupal 9.

  • catch committed 262b7fc on 9.0.x
    Issue #3084472 by Berdir, JeroenT, ravi.shankar, rpsu: Remove Place...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 262b7fc and pushed to 9.0.x. Thanks!

catch’s picture

Issue tags: -Needs change record
rpsu’s picture

the https://www.drupal.org/project/block_place is in place but the package naming collision (core vs. contrib) still seems to exist, leading to failing test builds. #3083638: Ensure that simpletest and block_place do not get special core treatement should take care of that, hopefully before the first D9 beta release.

xjm’s picture

Issue tags: +9.0.0 release notes
rpsu’s picture

CR is now updated (version 9.0.0-alpha2) and published.

Status: Fixed » Closed (fixed)

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

heddn’s picture

I'm not sure we wanted to remove Drupal\Tests\DeprecatedModulesTestTrait. I was using it to filter out deprecated modules from my tests since 8.6 or 8.7 and prepare my module for 9.x compatibility. But now with its removal, my tests fall over miserably. Could/should probably re-add it.

See CR https://www.drupal.org/node/3116386.

rpsu’s picture

9.0.x/9.1.x branches do not include deprecated core modules so there should be no need to use the trait?

#3124762: Add 'lifecycle' key to .info.yml files aims finally to have a similar way to filter in/out deprecated, experimental etc. modules based on their current status, effectively providing a way to replace the removed trait.

heddn’s picture

My point isn't so much that there aren't any deprecated modules in D9, nor that a new way to discover deprecated modules will be available. My point is that a non internal test layer was removed without first deprecating it.

However, I'd propose that additional modules in D9 will also be deprecated. And a test trait like what was removed would still be useful. But that's beside the point, right?

rpsu’s picture

yes, I agree. Perhaps the original trait should've been documented as internal - even if I was planning to have it around still with D9.

For D9 there will be a (permanent) way to filter modules based on their statuses in a similar fashion as we had.

pameeela’s picture

Issue tags: +Needs release note

Anyone able to update the IS with a release notes snippet, briefly summarising the effects of this change?

rpsu’s picture

I'm not sure what you mean with this:

update the IS

pameeela’s picture

Oh, IS means issue summary. The release notes snippet is part of the issue summary template and should be included for issues that have a potentially disruptive change.

xjm’s picture

Issue summary: View changes
Issue tags: -Needs release note

Updated with a correct release note, and polished this in the 9.0.0-alpha2 release notes.