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
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | interdiff-4-6.txt | 774 bytes | loparev |
| #6 | tmgmt_extension_suit-3109696-6.patch | 2.15 KB | loparev |
| #4 | tmgmt_extension_suit-3109696-4.patch | 1.89 KB | loparev |
| #3 | tmgmt_extension_suit-3109696-3.patch | 0 bytes | loparev |
Issue fork tmgmt_extension_suit-3109696
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
Comment #2
loparev commentedHi @AjitS, thanks for the report.
I've researched this and found out that there is no need to implement
hook_install, but newhook_update_Nis required.Here is the patch for TES and one for tmgmt_smartling. Could you please confirm it works for you?
Comment #3
loparev commentedComment #4
loparev commentedSorry, once again
Comment #5
ajits@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
NULLfor 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.
Comment #6
loparev commentedHere is the patch
Comment #7
ravi.shankar commentedComment #9
ajits@Loparev - thank you again! The patch works fine now. We are planning to push this change soon.
Comment #10
loparev commentedGreat. Closing for now
Comment #11
ajits@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!
Comment #12
loparev commentedComment #13
loparev commentedDone. Thanks!
Comment #14
ajits@Loparev - thank you! In this case, just trying to encourage the client about contributions : ) And this helps.