Motivation
Simplify content change tracking. We want to get rid of continuous jobs.

Possible solution
Track content changes manually on our own.

UPDATED
Added tests

CommentFileSizeAuthor
#22 interdiff_20-21.diff517 bytesloparev
#22 tmgmt_extension_suit-manual-change-tracking-21.diff36.84 KBloparev
#21 interdiff_19-20.diff7.93 KBloparev
#21 tmgmt_extension_suit-manual-change-tracking-20.diff36.84 KBloparev
#19 interdiff_18-19.diff7.59 KBloparev
#19 tmgmt_extension_suit-manual-change-tracking-19.diff28.84 KBloparev
#18 tmgmt_extension_suit-manual-change-tracking-18.diff20.41 KBloparev
#18 interdiff_12-18.diff1.6 KBloparev
#17 interdiff_12-17.diff1.52 KBloparev
#17 tmgmt_extension_suit-manual-change-tracking-17.diff20.47 KBloparev
#15 tmgmt_extension_suit-manual-change-tracking-15.diff20.58 KBloparev
#15 interdiff_12-15.diff1.64 KBloparev
#14 interdiff_12-14.diff924 bytesloparev
#14 tmgmt_extension_suit-manual-change-tracking-14.diff20.48 KBloparev
#12 interdiff.diff2.59 KBloparev
#12 tmgmt_extension_suit-manual-change-tracking-12.diff20.33 KBloparev
#11 interdiff.diff3.16 KBloparev
#11 tmgmt_extension_suit-manual-change-tracking-11.diff19.61 KBloparev
#10 interdiff.diff1.67 KBloparev
#10 tmgmt_extension_suit-manual-change-tracking-10.diff18.81 KBloparev
#9 interdiff.diff804 bytesloparev
#9 tmgmt_extension_suit-manual-change-tracking-9.diff17.64 KBloparev
#8 interdiff.diff4.07 KBloparev
#8 tmgmt_extension_suit-manual-change-tracking-7.diff17.69 KBloparev
#7 interdiff.diff3.44 KBloparev
#7 tmgmt_extension_suit-manual-change-tracking-7.diff17.06 KBloparev
#5 interdiff.diff7.42 KBloparev
#5 tmgmt_extension_suit-manual-change-tracking-5.diff15.94 KBloparev
#3 interdiff.diff752 bytesloparev
#3 tmgmt_extension_suit-manual-change-tracking-3.diff10.01 KBloparev
#2 interdiff.diff5.65 KBloparev
#2 tmgmt_extension_suit-manual-change-tracking-1.diff9.98 KBloparev
tmgmt_extension_suit-manual-change-tracking.diff9.86 KBloparev

Comments

Loparev created an issue. See original summary.

loparev’s picture

StatusFileSize
new9.98 KB
new5.65 KB
loparev’s picture

StatusFileSize
new10.01 KB
new752 bytes

Added accepted state as a filter

soul88’s picture

  1. +++ b/tmgmt_extension_suit.module
    @@ -204,28 +179,64 @@ function _tmgmt_extension_suit_get_job_item_hash(JobItemInterface $job_item) {
    +          if ($old_hash != $hash) {
    

    Please use strict comparison

  2. +++ b/tmgmt_extension_suit.module
    @@ -204,28 +179,64 @@ function _tmgmt_extension_suit_get_job_item_hash(JobItemInterface $job_item) {
    +        if (!empty($is_reopen_needed)) {
    

    is_reopen_needed is boolean. Why do we need "empty" function here?

loparev’s picture

StatusFileSize
new15.94 KB
new7.42 KB

Fixed review comments + added service "UniqueQueueItem". Also refactored adding items into download and check status queues (with new services).

loparev’s picture

Title: Manual content changes tracking instead of continuous job mechanism » Content changes tracking on our own instead of continuous job mechanism
loparev’s picture

StatusFileSize
new17.06 KB
new3.44 KB

Added hook update for old continuous jobs

loparev’s picture

StatusFileSize
new17.69 KB
new4.07 KB

One more patch

loparev’s picture

StatusFileSize
new17.64 KB
new804 bytes

Final one

loparev’s picture

StatusFileSize
new18.81 KB
new1.67 KB

Sorry, here is a correct one

loparev’s picture

StatusFileSize
new19.61 KB
new3.16 KB

Fixed error in Download queue worker

loparev’s picture

StatusFileSize
new20.33 KB
new2.59 KB

Fixed problem with downloading of untranslated strings: check if job is ready for download inside of check status worker. Plus fixed possible issue with duplicated queue items in check status queue and as a consequence download queue (type casting to int)

soul88’s picture

+++ b/tmgmt_extension_suit.module
@@ -204,28 +134,60 @@ function _tmgmt_extension_suit_get_job_item_hash(JobItemInterface $job_item) {
+    $select->condition('tji.state', [JobItemInterface::STATE_ACTIVE, JobItemInterface::STATE_REVIEW, JobItemInterface::STATE_ACCEPTED], 'IN');

Why do we need this filter here? Should we ignore the "INACTIVE" state?

loparev’s picture

StatusFileSize
new20.48 KB
new924 bytes

Should we ignore the "INACTIVE" state?

I think we have to. But..maybe it would be better to filter not job items but jobs? We are interested only in ACTIVE and FINISHED jobs.

BTW here is a patch that fixes a problem when job item hash isn't updated when it's state != new state.

loparev’s picture

StatusFileSize
new1.64 KB
new20.58 KB

Fixed filters

soul88’s picture

+++ b/src/Plugin/QueueWorker/JobDownload.php
index e69de29..da1fe26 100644
--- a/src/Plugin/QueueWorker/JobUpload.php

+++ b/tmgmt_extension_suit.module
@@ -204,28 +134,68 @@ function _tmgmt_extension_suit_get_job_item_hash(JobItemInterface $job_item) {
+            // We don't use JobItem::setState() method because it can invoke
+            // JobItem::save() by itself depends on condition "if current state
+            // != new state". We're just setting up state manually and call

We don't use JobItem::setState() because it doesn't always call JobItem::save(), and so the behaviour might be inconsistent.

loparev’s picture

StatusFileSize
new20.47 KB
new1.52 KB

Fix after review

loparev’s picture

StatusFileSize
new1.6 KB
new20.41 KB
loparev’s picture

StatusFileSize
new28.84 KB
new7.59 KB

Added tests

loparev’s picture

Issue summary: View changes
loparev’s picture

StatusFileSize
new36.84 KB
new7.93 KB

Upload queue support for clone job form.

loparev’s picture

StatusFileSize
new36.84 KB
new517 bytes

Fixed bug with "one job - many job items" case - wrong condition for JOIN statement. It was invisible for "one to one" case.

  • Loparev committed 294c50f on 8.x-1.x
    Issue #2866969 by Loparev: Content changes tracking on our own instead...
loparev’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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