Problem/Motivation

The function locale_translation_manual_status() was a helper function for local_menu() that is no longer used anywhere in the D8 codebase. All hook_menu implementations have been removed.

The same functionality that was provided by this dead code is now provided by locale.translate_status in local.routing.yml which instantiates TranslationStatusForm in src/Form/TranslationStatusForm.php.

Proposed resolution

As suggested by #11 and #12, please follow the instructions on https://www.drupal.org/core/deprecation to deprecate locale_translation_manual_status function.

Remaining tasks

Comments

Jeremy created an issue. See original summary.

jeremy’s picture

Priority: Normal » Minor
Status: Active » Needs review
StatusFileSize
new1.29 KB

Attached patch simply removes unused code. As this is an internal helper function, I don't see the need for a CR -- nobody should be invoking this dead code from other modules.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mile23’s picture

Title: Remove locale_translation_manual_status() » Remove dead code locale_translation_manual_status()
Version: 8.3.x-dev » 8.4.x-dev
Priority: Minor » Normal
Status: Needs review » Needs work
Issue tags: -Quickfix +Needs reroll

Moving to 8.4.x because removing a function might be disruptive.

Patch no longer applies.

jofitz’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new1.26 KB

Re-rolled.

mile23’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. Thanks.

cilefen’s picture

cilefen’s picture

Oh it looks like this issue added the function back. I have not yet read about why.

webchick’s picture

Title: Remove dead code locale_translation_manual_status() » Deprecate dead code locale_translation_manual_status()
Status: Reviewed & tested by the community » Needs work

Talked to the release managers, and they said that we shouldn't remove these type of functions because they're not explicitly marked @internal, and therefore we have no idea if some esoteric contrib modules might be relying on then, and therefore it's safer to merely deprecate them, so we can find them again and ditch them for good in Drupal 9.

Here's the documentation (I think) on how to do so: https://www.drupal.org/core/deprecation

xjm’s picture

Yeah, to add to #11, it is extremely unlikely that anyone would actually use this, especially given what it actually does (eek!). But since it also costs us nothing to leave it there until the mass removal of @deprecated for D9, it's better to just be in the habit of marking things deprecated for later removal since we don't always think of everything when evaluating potential disruptions, and also to just set a good model for contributors.

xjm’s picture

Oh, and I should note that @webchick, @cilefen, and I discussed whether this should be treated as a controller since it was a page callback. But since it is not a controller and since no route uses it, it's technically just a weird global function. :)

vijaycs85’s picture

Issue summary: View changes
Issue tags: +Novice

Looks like we just missed it in #1978916: Convert locale_translate_page to a Controller there is a comment on #67 about it but not addressed anywhere after. Marking as Novice for depreciation task.

mile23’s picture

Issue tags: -Novice +@deprecated
gaurav.kapoor’s picture

Status: Needs work » Needs review
StatusFileSize
new446 bytes

Added the deprecation notice.Should @see and @trigger_error be added??

mile23’s picture

Status: Needs review » Needs work

Yes. Here's the deprecation documentation: https://www.drupal.org/core/deprecation#how-function

gaurav.kapoor’s picture

Status: Needs work » Needs review
StatusFileSize
new832 bytes
new860 bytes
gaurav.kapoor’s picture

Version: 8.4.x-dev » 8.5.x-dev

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

sutharsan’s picture

Status: Needs review » Needs work

Patch still applies.

+ * @deprecated in Drupal 8.0.0 and will be removed before 9.0.0.

Should now be "8.5.0"

googletorp’s picture

StatusFileSize
new832 bytes
new1.08 KB

Updated depricated version number from 8.0.0 to 8.5.0 per #21.

googletorp’s picture

Status: Needs work » Needs review
sutharsan’s picture

Status: Needs review » Needs work

Thanks for changing the version number.

  1. +++ b/core/modules/locale/locale.pages.inc
    @@ -13,9 +13,12 @@
    + * @deprecated in Drupal 8.5.0 and will be removed before 9.0.0.
    + * @see https://www.drupal.org/node/2551259
    

    Needs a blank line before @see. See https://www.drupal.org/docs/develop/coding-standards/api-documentation-a...

  2. +++ b/core/modules/locale/locale.pages.inc
    @@ -13,9 +13,12 @@
    +  @trigger_error('locale_translation_manual_status() is deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. Use locale_menu(). See https://www.drupal.org/node/2551259.', E_USER_DEPRECATED);
    

    locale_menu() no longer exist and should therefore not be given as replacement. I advise not to give any replacement here because the is none.

jofitz’s picture

Status: Needs work » Needs review
StatusFileSize
new811 bytes
new1015 bytes

Addressed comments in #24.

sutharsan’s picture

Status: Needs review » Reviewed & tested by the community

Interdiff looks good, patch looks good.
Issue summary checked Ok.

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for working on this.

This is linking to this issue's NID. It should be linking the relevant change record instead. We also need to tell people what to do instead. If there is no direct replacement, we should say that, and say why (or what code that previously used this function should do instead).

Thanks!

sutharsan’s picture

Issue summary: View changes
Issue tags: +Needs change record

Adding tasks to the issue summary.

sutharsan’s picture

Issue summary: View changes
mile23’s picture

Status: Needs work » Needs review
Issue tags: -Needs change record
StatusFileSize
new2.09 KB
new2.36 KB

Drafted change record: https://www.drupal.org/node/2931188

Updated @see to the CR.

Added a test to make sure the deprecation works since that's our policy: https://www.drupal.org/core/deprecation

Status: Needs review » Needs work

The last submitted patch, 30: 2551259_30.patch, failed testing. View results

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new2.03 KB
new813 bytes
1) Drupal\Tests\locale\Kernel\LocaleDeprecationsTest::testLocaleTranslationManualStatusDeprecation
@covers global method does not exist locale_translation_manual_status:

Oh yeah.... For kernel tests, the test listener runs in a different process than the test itself, so loaded include files aren't available to DrupalStandardsListener after the test finishes. Thus it can't verify that an extension's global function is available.

I guess we'll have to forgo the coveted declared coverage stats for this deprecated method.

1) Drupal\Tests\rest\Functional\EntityResource\View\ViewJsonCookieTest::testPatch
Exception: Warning: apcu_store(): Unable to allocate memory for pool.
Symfony\Component\ClassLoader\ApcClassLoader->findFile()() (Line: 128)

Pretty sure that's unrelated.

Status: Needs review » Needs work

The last submitted patch, 32: 2551259_32.patch, failed testing. View results

mile23’s picture

Status: Needs work » Needs review

Previous test fail unrelated.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

Looks solid.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 0308764 and pushed to 8.5.x. Thanks!

  • catch committed 0308764 on 8.5.x
    Issue #2551259 by Mile23, gaurav.kapoor, Jo Fitzgerald, googletorp,...

Status: Fixed » Closed (fixed)

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

quietone’s picture

publish the change record