I am trying to update my webform module from 7.x-3.18 to 7.x-4.0-alpha6 and both a web update and drush updb get stuck in an infinite loop at webform_update_7401. My site has 199 webforms to update. The only way the update stops is if I kill it (after a few hours) or PHP runs out of memory. http://drupal.org/node/1609324 does not mention anything special that I needed to do for the update. Any help will be appreciated!

Comments

quicksketch’s picture

Title:Update infinite loop» Update infinite loop in webform_update_7401()
Category:support» bug
Status:Active» Needs review
StatusFileSize
new477 bytes

Thanks for the report! I think you've identified a bug. Could you try applying this patch to your installation of Webform and try running the update again (after restoring a DB backup)?

siwinski’s picture

Title:Update infinite loop in webform_update_7401()» Update infinite loop in webform_update_7401() and webform_update_7403()
StatusFileSize
new770 bytes

Thanks quicksketch! That worked for update 7401 but then I ran into the same issue with update 7403. Attached is a patch that combines the fix for both update functions. My 7.x-3.18 to 7.x-4.0-alpha6 update ran successfully after applying this patch.

quicksketch’s picture

Status:Needs review» Reviewed & tested by the community

That worked for update 7401 but then I ran into the same issue with update 7403.

Ha! Yes of course it would. Thanks for the update. This is ready to go.

runhrun’s picture

Thanks quicksketch and siwinski for the patches. Do you plan to update the webform.install file with the patch?

Demoshane’s picture

Ran into same, applying #2 didn't solve the issue with infinite loop.

Demoshane’s picture

Priority:Normal» Major

Increasing priority. As it stands after upgrading webform drush updatedb is infinitely looping and old webforms can't be modified as it leads to site error when trying to.

wodenx’s picture

Version:7.x-4.0-alpha6» 7.x-4.x-dev
Status:Reviewed & tested by the community» Needs review
StatusFileSize
new830 bytes

The patch in #2 worked for me, but should really have the $progess updated as well, as in the attached.

Demoshane’s picture

I'll test the patch asap. Will report back on monday.

Demoshane’s picture

Status:Needs review» Reviewed & tested by the community

#7 solved the issue.

noahadler’s picture

Wanted to add a minor note about the patch in #7: the array index is 'last_processed_nid' in the patch, but it should be 'last_nid_processed'. This took me a while to track down, so hopefully this note will help others.

quicksketch’s picture

Status:Reviewed & tested by the community» Fixed
StatusFileSize
new745 bytes

Thanks guys. I made the adjustment @noahadler suggested and committed a modified version of #7. Committed to 7.x-4.x.

Status:Fixed» Closed (fixed)

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