Problem/Motivation

After bulk adding, i have the job item for "TMGMT Demo" (from tmgmt_demo) but the item does not show up on the sources overview as pending item. I guess the reason is that the job is in one of the new continuous job states. But that's wrong.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Denchev created an issue. See original summary.

miro_dietiker’s picture

The reason is, as stated in other issues, our API to load the last active item is not returning items from the continuous job.

miro_dietiker’s picture

Component: Core » User interface
Priority: Normal » Major
Issue tags: +Usability

Much confusing in using the UI.

thenchev’s picture

Assigned: Unassigned » thenchev

looking into this

thenchev’s picture

Status: Active » Needs review
StatusFileSize
new757 bytes

If this is the right solution i can make a test coverage.

berdir’s picture

Yes, that is correct. But we have at least one additional function that has a similar condition.

In fact, you should check and review all active/unprocessed checks/references and checks like that and check if it should apply to continuous as well.

berdir’s picture

Status: Needs review » Needs work
thenchev’s picture

Status: Needs work » Needs review
StatusFileSize
new1.1 KB
new482 bytes

Didn't notice other places that i can change. I can use some more details if there are more.

berdir’s picture

If that's the only ones then fine, still needs tests. We should be able to extend some of the existing continuous UI tests, visit the sources page and confirm you see a link to an existing job item there.

thenchev’s picture

StatusFileSize
new867 bytes
new1.95 KB

Test.

Status: Needs review » Needs work

The last submitted patch, 10: active_items_of-2685479-10.patch, failed testing.

thenchev’s picture

Hmm... weird, this is green on localhost

mbovan’s picture

  1. +++ b/sources/content/src/Tests/ContentEntitySourceUiTest.php
    @@ -671,6 +671,10 @@ class ContentEntitySourceUiTest extends EntityTestBase {
    +    $items = $continuous_job->getItems();
    +    $item = reset($items);
    

    There was a problem in Collect a while ago, that order was not guaranteed with reset() function. The problem especially occurred on Test bot.

    But, it seems that you have only one element here...

  2. +++ b/tmgmt.module
    @@ -153,7 +153,7 @@ function tmgmt_job_item_load_latest($plugin, $item_type, $item_id, $source_langu
    +    ->condition('tj.state', array(Job::STATE_UNPROCESSED, Job::STATE_ACTIVE, Job::STATE_CONTINUOUS), 'IN')
    

    To be consistent, I would say "array()" or "[]" syntax for both conditions.

  3. +++ b/tmgmt.module
    @@ -440,7 +440,7 @@ function tmgmt_translator_load_available($job) {
    +      ->condition('state', [Job::STATE_ACTIVE, Job::STATE_CONTINUOUS], 'IN')
    

    You can remove 1 extra tab here.

thenchev’s picture

Status: Needs work » Needs review
StatusFileSize
new1.94 KB
new1.15 KB

Addressed the code style and yes, only one item. Debugged the test seems fine here. So im not sure...

Status: Needs review » Needs work

The last submitted patch, 14: active_items_of-2685479-14.patch, failed testing.

johnchque’s picture

Status: Needs work » Needs review
StatusFileSize
new2.03 KB

Let's add some debug and see if the icon is found.

Status: Needs review » Needs work

The last submitted patch, 16: active_items_of-2685479-16-debug.patch, failed testing.

johnchque’s picture

Status: Needs work » Needs review
StatusFileSize
new2.04 KB

Lets add a new debug to see what is going on here. :)

Status: Needs review » Needs work

The last submitted patch, 18: active_items_of-2685479-18-debug.patch, failed testing.

johnchque’s picture

Status: Needs work » Needs review
StatusFileSize
new1.93 KB

I knew it, testbot!, checking the link the testbot adds a '/checkout' preffix to the link. Maybe asserting in this way can also work.

johnchque’s picture

StatusFileSize
new660 bytes

Interdiff with patch 14. :)

berdir’s picture

Status: Needs review » Needs work
+++ b/sources/content/src/Tests/ContentEntitySourceUiTest.php
@@ -671,6 +671,10 @@ class ContentEntitySourceUiTest extends EntityTestBase {
     $this->assertUniqueText(t("1 continuous job item has been created."));
 
+    $items = $continuous_job->getItems();
+    $item = reset($items);
+    $this->assertRaw('/admin/tmgmt/items/' . $item->id(), 'Link to job item available.');
+

Why not use assertLinkByHref() ? It by default does a partial match, so it shouldn't matter if it has /checkout or not.

thenchev’s picture

Status: Needs work » Needs review
StatusFileSize
new725 bytes
new1.91 KB

Changed to assertLinkByHref

  • Berdir committed 10d3146 on 8.x-1.x authored by Denchev
    Issue #2685479 by Denchev, yongt9412: Active items of continuous jobs...
berdir’s picture

Status: Needs review » Fixed

That looks good now, yes.

Status: Fixed » Closed (fixed)

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