Problem/Motivation

On a site in which we use this module, we found that the setting function tmgmt_extension_suit_entity_update was causing the jobs to be reopened on download of the translations.
On debugging, we found that the value of $old_hash always comes back as empty. And further the database table tmgmt_job_item doesn't have the column tes_source_content_hash as expected.

Proposed resolution

Add the column on the implementation of hook_install() and also add an update hook doing the same for existing installs.

Remaining tasks

Patch, review and release.

User interface changes

None

API changes

None

Data model changes

Adds a new column to the table tmgmt_job_item

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

AjitS created an issue. See original summary.

loparev’s picture

Hi @AjitS, thanks for the report.

I've researched this and found out that there is no need to implement hook_install, but new hook_update_N is required.

Here is the patch for TES and one for tmgmt_smartling. Could you please confirm it works for you?

loparev’s picture

StatusFileSize
new0 bytes
loparev’s picture

StatusFileSize
new1.89 KB

Sorry, once again

ajits’s picture

Status: Active » Needs work

@Loparev - thank you for the response and the patch. I tested it and found that the missing column was added to the desired table. However, I think the update hook misses out an important thing. The has the value NULL for all the job items after the update hook is executed. It means that for the first time all job items will be considered to be changed even when they might not be. In our case, I found that the Daily bucket job contained more that 50k words due to this which is obviously not the word count of the updated strings.

To fix this, I think the update hook should also contain logic which calculates the hash of the existing job items and populates the column with them. This will ensure the smooth working of the "Daily Bucket" jobs afterwards.

loparev’s picture

StatusFileSize
new2.15 KB
new774 bytes

Here is the patch

ravi.shankar’s picture

Status: Needs work » Needs review

  • Loparev committed a8b6c81 on 8.x-3.x
    Issue #3109696 by Loparev, AjitS: TMGMT Extension Suite setting doesn't...
ajits’s picture

Status: Needs review » Reviewed & tested by the community

@Loparev - thank you again! The patch works fine now. We are planning to push this change soon.

loparev’s picture

Status: Reviewed & tested by the community » Fixed

Great. Closing for now

ajits’s picture

@Loparev - My time for debugging and testing was sponsored time and I have selected the customer in the "Attribute this contribution" list. Can you please provide credit for the issue. Thank you for your help!

loparev’s picture

loparev’s picture

Done. Thanks!

ajits’s picture

@Loparev - thank you! In this case, just trying to encourage the client about contributions : ) And this helps.

Status: Fixed » Closed (fixed)

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

baikho made their first commit to this issue’s fork.