Problem/Motivation

See #3566536: [meta] eliminate core .module files

Proposed resolution

Convert _content_translation_install_field_storage_definitions() to a protected method and remove the procedural function. This is safe according to https://www.drupal.org/about/core/policies/core-change-policies/bc-polic...

Remaining tasks

None.

User interface changes

None.

Introduced terminology

None.

API changes

Deprecated:

TBD

Data model changes

None.

Issue fork drupal-3566890

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

claudiu.cristea created an issue. See original summary.

claudiu.cristea’s picture

Issue summary: View changes

nicxvan’s picture

There is a deprecation being hit somewhere.

content_translation_language_configuration_element_process() is still being called directly.

nicxvan’s picture

Status: Active » Needs work
claudiu.cristea’s picture

Assigned: claudiu.cristea » Unassigned
Status: Needs work » Needs review

This is ready for review:

  • There are 2 CRs for this change
  • I had also to change the direction of some dependencies between modules because they were reverted
dcam’s picture

I left a couple of comments to consider.

You might need to add before/after examples to the two existing change records. I usually have to do it.

The addition of ContentTranslationManager->access() might need a change record. Maybe https://www.drupal.org/node/3567484 can be edited to serve both purposes.

claudiu.cristea’s picture

@dcam, thank you for review.

  • Applied the MR suggestion
  • Addressed the MR remarks
  • The addition of ContentTranslationManager->access() might need a change record.

    It seems it was already in https://www.drupal.org/node/3567484.

  • Added the Before/After examples in both CRs.

Ready for a new round of review/

claudiu.cristea’s picture

Ready for review, see my comment in #8.

dcam’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for considering my feedback.

It seems it was already in https://www.drupal.org/node/3567484.

I don't remember what I was thinking the other night when I wrote that comment. Maybe I thought that it needed its own change record separate from the deprecation or something. But it's OK the way it is now.

The new changes look good to me. RTBC.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

claudiu.cristea’s picture

Status: Reviewed & tested by the community » Needs work

Detected usages of _content_translation_install_field_storage_definitions(), https://git.drupalcode.org/search?group_id=2&scope=blobs&search=_content.... Let's deprecate it instead of deleting

claudiu.cristea’s picture

Status: Needs work » Needs review

Ready again for review.

berdir’s picture

Status: Needs review » Needs work

Left a few minor notes.

There are existing issues about some of those functions, such as #2155787: Introduce more flexible access control for content translation operations but they are _very_ old. Still, I think we might want to give the new content_translation maintainer a chance to comment on this.

There's also #3497534: [meta] Clean up content_translation hooks and legacy files that @nicxvan created, that's also about restructuring the hooks *and* remaining functions, the hook part is still something we want to refactor, so we can repurpose that I think.

claudiu.cristea’s picture

Status: Needs work » Needs review
Issue tags: +Needs subsystem maintainer review
Related issues: +#3497534: [meta] Clean up content_translation hooks and legacy files

There are existing issues about some of those functions, such as #2155787: Introduce more flexible access control for content translation operations but they are _very_ old. Still, I think we might want to give the new content_translation maintainer a chance to comment on this.

I've tagged the issue with "Needs subsystem maintainer review" to get a feedback. I'll also notify @penyaskito

There's also #3497534: [meta] Clean up content_translation hooks and legacy files that @nicxvan created, that's also about restructuring the hooks *and* remaining functions, the hook part is still something we want to refactor, so we can repurpose that I think.

@nicxvan, could you, please, take a look at #3497534: [meta] Clean up content_translation hooks and legacy files and see what still stands there?

penyaskito’s picture

re: #12: In contrib, there are 2 modules using it:

  • data_policy uses this in an upgrade path from 8.x-1.0-rc2 to their first stable release. They are at 2.0.0 already.
  • The other occurrence is social_language_modules_installed, in the submodule social_language from OpenSocial.

Both are part of OpenSocial (so easy to ask for feedback if needed).

As this was underscore prefixed, not sure if we really need to deprecate: the impacted surface is quite low, and this was using the procedural PHP version of "hey this is a private function subject to change without notice".


I haven't reviewed the MR itself, so leaving the tag Needs subsystem maintainer review for now.

nicxvan’s picture

Just a heads up we've worked with the core committer team to come up with a policy since there are so many functions to manage as part of this initiative.

We will deprecate all functions, if they are underscore the removal is drupal 12.

Edited to add that the description of the deprecation decisions are in the parent issue.

nicxvan’s picture

Status: Needs review » Needs work

I updated the deprecation versions, this needs a rebase.

claudiu.cristea’s picture

Status: Needs work » Needs review

Tests are green, ready for review.

nicxvan’s picture

I think this is pretty close, @penyaskito not sure if you've had a chance to review. I would also like to point out that I think @berdir added the tag so you could review whether we could deprecate and move the functions as is here of they should be addressed in the other issue.

In general we've been keeping the momentum and addressing them in issues like this, but if there is a pretty significant API change issue that has momentum already (or is pretty close and just needs a reroll) then we've made exceptions and resolved the functions in the older issue.

However looking at the other issue one of the remaining tasks is to still agree on an approach and is 13 years old, I'd push rather strongly to just deprecate and move them like we did here, then address that issue as follow up once everything is in classes.

penyaskito’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs subsystem maintainer review

Only had some nits about service injections that we better take care of at #3497534: [meta] Clean up content_translation hooks and legacy files, so ✅ from my side.

I think with this we also make the path forward easier for more granular access controls in #2155787: Introduce more flexible access control for content translation operations.

nod_’s picture

updated search link for #12: _content_translation_install_field_storage_definitions It seems like for D10+ modules there is only one usage. (the search engine doesn't index profiles) the matches from gitlab include modules that are not compatible with D10+

claudiu.cristea’s picture

Just a straight reroll

longwave’s picture

Status: Reviewed & tested by the community » Needs work

Sorry, needs another reroll.

claudiu.cristea’s picture

Status: Needs work » Reviewed & tested by the community

Rerolled

longwave’s picture

Status: Reviewed & tested by the community » Needs work

Tests failing:

Symfony\Component\DependencyInjection\Exception\RuntimeException: Cannot autowire service "Drupal\content_translation\Hook\ContentTranslationFormHooks": argument "$contentTranslationWidget" of method "__construct()" references class "Drupal\content_translation\ContentTranslationEnableTranslationPerBundle" but no such service exists.
claudiu.cristea’s picture

Status: Needs work » Needs review

Sorry, I was in a rush and my conflict resolution was wrong

penyaskito’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed the individual commits since #21 and CI is green, back to RTBC.

  • longwave committed 4e0930e0 on main
    refactor: #3566890 Deprecate and remove procedural code from...
longwave’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Applied to main, committed and pushed. Doesn't cherry-pick cleanly so keeping open for backport.

claudiu.cristea’s picture

Status: Patch (to be ported) » Needs review
claudiu.cristea’s picture

11.x MR is ready for review

penyaskito’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed the changes match what was committed to main.

Did you know? In gitlab UI, folders come first on commits vs files on a root folder, but the opposite for MRs. So annoying to compare.
Edit: so annoying I reported it https://gitlab.com/gitlab-org/gitlab/-/work_items/593851

  • longwave committed 2606e274 on 11.x
    refactor: #3566890 Deprecate and remove procedural code from...
longwave’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 2606e2747e9 to 11.x. Thanks!

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.

Status: Fixed » Closed (fixed)

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