rename locale batch operation callbacks to match the API methods they call

Created on 21 February 2024, 5 months ago
Updated 1 July 2024, 12 days ago

Problem/Motivation

locale_config_batch_set_config_langcodes() and locale_config_batch_refresh_name() are batch operation callbacks which are just wrappers around API methods on the LocaleConfigManager.

However, the names don't match up at all which is confusing:

function locale_config_batch_set_config_langcodes(&$context) {
  Locale::config()->updateDefaultConfigLangcodes();

and:

function locale_config_batch_refresh_name(array $names, array $langcodes, &$context) {
  SNIP
  $context['results']['stats']['config'] += Locale::config()->updateConfigTranslations($names, $langcodes);

Steps to reproduce

Proposed resolution

Rename both callbacks to 'locale_config_batch_' + snake case version of the API method it calls.

No BC handling is necessary as batch API callbacks are internal.

Remaining tasks

  • Update the merge request to retain the procedural functions that wrap the new methods, and add a deprecation โ†’ (see #5).
  • Fix the coding standards error in the pipeline job (see #16).

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Localeย  โ†’

Last updated 1 day ago

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @joachim
  • First commit to issue fork.
  • Pipeline finished with Success
    5 months ago
    Total: 510s
    #101515
  • Status changed to RTBC 5 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim

    Thanks for the MR. Looks goo!

  • Status changed to Needs work 4 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    These are procedural functions without a leading underscore, we should leave the old one as wrappers and deprecate them.

  • Assigned to PrabuEla
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia PrabuEla chennai
  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia PrabuEla chennai
  • Assigned to secretsayan
  • Pipeline finished with Failed
    4 months ago
    Total: 185s
    #112090
  • First commit to issue fork.
  • Pipeline finished with Failed
    4 months ago
    Total: 177s
    #112093
  • Pipeline finished with Failed
    4 months ago
    Total: 182s
    #118349
  • Pipeline finished with Failed
    4 months ago
    Total: 216s
    #118362
  • Pipeline finished with Failed
    4 months ago
    Total: 558s
    #123343
  • Pipeline finished with Failed
    4 months ago
    Total: 181s
    #129603
  • Status changed to Needs review 2 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States analaura@cellar-door.io Houston, TX
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim

    Someone should rebase the branch before a novice works on it -- it looks like it's been merged rather than rebased, which is going to make the history messy.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States TravisCarden

    Actually, I think it just conflicts with ๐Ÿ“Œ Deprecate Drupal\locale\Locale and its one method Fixed . I'll rebase it onto the commit right before that, but someone will need to advise on the new direction. I.e., does the new scope becoming reconciling it with the afore-mentioned #3422915? Or is this no longer a novice issue--or even obsolete?

  • Pipeline finished with Failed
    2 months ago
    Total: 174s
    #166717
  • Status changed to Needs work 2 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    MR currently have some phpcs errors.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States xjm

    I agree with #11 and #12; this is not Novice for right now. Thanks!

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim

    Rebased on 11.x and resolved the conflict.

    This is good for novices again -- see #5 for what needs doing.

  • Pipeline finished with Failed
    2 months ago
    Total: 222s
    #167237
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States xjm

    Agreed, thanks @joachim!

    There is also a coding standards issue to resolve:

    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     16 | ERROR | [x] Opening brace should be on the same line as the declaration
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    Time: 16.64 secs; Memory: 8MB
    PHP CODE SNIFFER REPORT SUMMARY
    -------------------------------------------------------------------------------
  • Pipeline finished with Failed
    19 days ago
    Total: 572s
    #206832
  • Pipeline finished with Failed
    19 days ago
    Total: 563s
    #206855
  • Pipeline finished with Failed
    19 days ago
    Total: 189s
    #206941
  • Pipeline finished with Success
    19 days ago
    Total: 612s
    #206957
  • Issue was unassigned.
  • Status changed to Needs review 18 days ago
  • Status changed to Needs work 12 days ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Left some comments on the MR.

Production build 0.69.0 2024