I've added custom integration to the "Third party" according to the logic described here: WebformThirdPartySettingsManager and used as example third_party_settings/webform.honeypot.inc,
but I've used in my form "managed_file" form element. When I try to upload a file I get this error:
A fatal error occurred: The database connection is not serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Adjust your code so that is not necessary
Fix exactly will be the same as in http://cgit.drupalcode.org/yamlform/commit/?id=d42d0e0
But what we should do with public function afterBuild, should it be refactored to the static, and also in the interface too? How we deal then with $this->t() -> t() ?
For now I've added workaround to my code:
function _webform_file_download_form() {
...
if (isset($form['#after_build'][0][0]) && $form['#after_build'][0][0] instanceof WebformThirdPartySettingsManager) {
unset($form['#after_build'][0]);
}
}
Thanks for the great module!
Comments
Comment #2
vlad.dancerComment #3
jrockowitz commented@vlad.dancer We would need an example of the issue so that we can work on fixing it.
Comment #4
vlad.dancerSure.
Comment #5
frogdog_tech commentedupdate title
Comment #6
jrockowitz commented@vlad.dancer I can't determine where #after_build is being set from.
I did just tweak third party settings. @see #2875841: Hide third party tab (at least optionally).
Comment #7
vlad.dancer@jrockowitz
WebformThirdPartySettingsManager->buildForm()> I did just tweak third party settings
I hope I will not rector my code...
Comment #8
jrockowitz commentedThe latest dev release no longer has the WebformThirdPartySettingsManager::buildForm method because of #2875841: Hide third party tab (at least optionally).
Switch to the latest dev release or just applying the patch might solve your problems.
Comment #9
jrockowitz commentedBTW, there was a minor API change in #2875841: Hide third party tab (at least optionally).
You will need to change
file_download_form_webform_third_party_settings_form_alter()tofile_download_webform_third_party_settings_form_alter()Comment #10
vlad.dancerThanks for example. I'm going to close this issue.