In votingapi_update_8302(), every vote is retrieved from the table before operating on them one by one. This can easily exhaust the allowed memory for PHP if you have large numbers of votes. Any update hook that might operate on many items should make use of the sandbox to iterate progressively through the dataset.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | batch-update-3068504-6.patch | 1.87 KB | mrinalini9 |
| #3 | 3068504-3-batch-update.patch | 1.99 KB | tr |
| #2 | update-hook-8302-issue-3068504-2.patch | 1.11 KB | kevin.dutra |
Comments
Comment #2
kevin.dutra commentedComment #3
tr commentedTesting output shows some coding standards problems - no need to introduce new problems with the patch, and there are only a few other problems in that file that are easy to clean up while we're at it. This is a re-roll with only those coding standards fixes added - no functional changes were made.
I've looked at the code and compared it with similar code that I know is working and it looks good to me. I HAVEN'T tested an actual update because I don't have an old database to test it on - a manual test should be done at least once to verify that the code actually runs.
Comment #4
pifagorComment #5
mrinalini9 commentedComment #6
mrinalini9 commentedRerolled patch #3, please review.
Comment #7
tr commentedvotingapi_update_8302()was removed as part of #3143266: Error: Call to undefined method Drupal\Core\Entity\EntityDefinitionUpdateManager::applyUpdates() in votingapi_update_8301(), so this issue is no longer relevant.