- Issue created by @Paul Dudink
- Status changed to Closed: won't fix
almost 2 years ago 6:34pm 24 February 2023 - πΊπΈUnited States jrockowitz Brooklyn, NY
I hesitate to change how a handler's postSave() method works. It will most likely cause issues for other people.
- Status changed to Needs review
almost 2 years ago 7:54am 27 February 2023 - π³π±Netherlands ricardopeters
Would it be an idea, to document somewhere that the actual committing(saving) actually happens after the postSave, so any code that breaks the flow will abandon the save? Maybe it's an edge case, but at least having it down in writing might alert people.
- πΊπΈUnited States jrockowitz Brooklyn, NY
I am always open to documentation improvements. Would you be able to create a PR with a suggestion?
- First commit to issue fork.
- Assigned to renatog
- Merge request !311Issue #3344266: Webform handler postSave() method is triggered before completing the database transaction β (Merged) created by renatog
- Issue was unassigned.
- π§π·Brazil renatog Campinas
- π§π·Brazil renatog Campinas
- π³π±Netherlands ricardopeters
Nice! I just thought of this part:
breaks the PHP execution it may cause a fail in the final save.
I would change it up to this:
breaks the PHP execution it may prevent the sql transaction from committing.
Or do you guys think that's a tad to technical for the documentation? In my opinion it shed's a light on why it wouldn't be saved.
@jrockowitz
I hesitate to change how a handler's postSave() method works. It will most likely cause issues for other people.
Just checking, because your answer seems to contradict what actually happened:
Our code has not changed for years, but suddenly broke after updating Webform and/or Drupal core.If you know for sure that this change in handling the postSave() is being caused by a change in Drupal core, than I think it's fine to simply document it.
However if not, I think it still should be investigated as a bug, because contrary to what you say this possible bug most likely cause issues for other people; fixing it will fix it :)Could you elaborate on your vision about this? Don't you think that a postSave() should be an actual post-save, and not a before-commit-save?
- Status changed to Needs work
almost 2 years ago 11:22am 1 March 2023 - π§π·Brazil renatog Campinas
breaks the PHP execution it may prevent the sql transaction from committing.
Totally makes sense. Agreed
- Status changed to Needs review
almost 2 years ago 11:24am 1 March 2023 - π§π·Brazil renatog Campinas
MR updated with that suggestion at #10: https://git.drupalcode.org/project/webform/-/merge_requests/311
- π¬π§United Kingdom rviner
This causes a problem in the use case i've got.
I'm using the webform rest module to trigger a get submission on PostSave but it always get the previous data as it hasn't been committed to the database yet.
- last update
9 months ago 536 pass -
jrockowitz β
committed 49eacf68 on 6.2.x authored by
renatog β
Issue #3344266: Webform handler postSave() method is triggered before...
-
jrockowitz β
committed 49eacf68 on 6.2.x authored by
renatog β
- Status changed to Fixed
9 months ago 1:39pm 6 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.