Problem/Motivation

We have defined the LocalTaskInterface, but is not used by LocalTask, so we LocalTask must implement that interface.
Also we have to move the task constants definitions from tmgmt_local.module to this interface.
And to a general clean up of the interface and LocalTask.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

edurenye created an issue. See original summary.

edurenye’s picture

edurenye’s picture

Status: Active » Needs review
StatusFileSize
new28.01 KB

Done.

berdir’s picture

Status: Needs review » Needs work
  1. +++ b/translators/tmgmt_local/includes/tmgmt_local.pages.inc
    @@ -230,7 +230,7 @@ function tmgmt_local_translation_form_save_as_completed_submit($form, FormStateI
       }
       if ($all_done) {
    -    $task->setStatus(TMGMT_LOCAL_TASK_STATUS_COMPLETED);
    +    $task->setStatus(LocalTask::STATUS_COMPLETED);
    

    why not use the interface here and elswhere?

  2. +++ b/translators/tmgmt_local/src/Entity/LocalTask.php
    @@ -462,19 +389,30 @@ class LocalTask extends ContentEntityBase implements EntityChangedInterface, Ent
    +   */
    +  public static function getStatuses() {
    +    return $statuses = array(
    

    $statuses doesn't do anything here.

  3. +++ b/translators/tmgmt_local/tmgmt_local.module
    @@ -395,22 +370,6 @@ function tmgmt_local_task_statistic(LocalTask $task, $key) {
    - * @return array
    - *   A list of all available statuses.
    - */
    -function tmgmt_local_task_statuses() {
    

    Note that we are in beta now. Which means that strictly speaking, we are not allowed to do API changes anymore, as someone else might rely on this.

    I think local translator is still fresh enough so that this isn't a big issue. But in future, please keep old functions and instead mark them as @deprecated. See how core does it.

miro_dietiker’s picture

I think we discussed that local translator is an early port and is more in an experimental state.
We went through the local translator and it's clear that it is not yet cleanly converted and missing interfaces at all. Constants are for instance still as define() instead of added to the interface.

I wouldn't like to see the cleanup being limited by the beta discussion and vote for unlimited cleanup in local translator.

edurenye’s picture

edurenye’s picture

Status: Needs work » Needs review
StatusFileSize
new28.57 KB
new617 bytes

I don't get the first point @Berdir, I changed it everywhere.
Fixed the second.
Nothing to do with the third as @miro_dietiker said.

berdir’s picture

Status: Needs review » Needs work

Discussed point 1.

edurenye’s picture

Status: Needs work » Needs review
StatusFileSize
new29.51 KB
new8.32 KB

Done.

Status: Needs review » Needs work

The last submitted patch, 9: fix_and_cleanup_of-2650778-9.patch, failed testing.

edurenye’s picture

Status: Needs work » Needs review
StatusFileSize
new28.96 KB
new1.74 KB

Ups, I changed to much.

berdir’s picture

Status: Needs review » Fixed

Thanks, committed.

  • Berdir committed f552351 on 8.x-1.x authored by edurenye
    Issue #2650778 by edurenye: Fix and cleanup of LocalTaskInterface
    

Status: Fixed » Closed (fixed)

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