Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hi. I have a form where I call field_attach_form. Devel wont display form_state from _valdiate or _submit of such form. If I comment out the field_attach_form function everything is ok and devel will display form_state. Any ideas ?
Comments
Comment #1
salvisNo ideas from me, but I'm interested in getting a patch if you look into it...
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedI was able to work around this problem by:
Comment #3
salvisWhat is wrong with
?
I don't know what exactly needs to be in $_SESSION['state'], but it probably ought to be preserved.
Comment #4
bleen CreditAttribution: bleen commentedI have seen issues where this happens when the data in form state is too large for the $_SESSION var to handle.
Comment #5
itarato CreditAttribution: itarato commentedI was testing this issue and managed to reproduce the problem. I was using dpm() dumping the form_state variables and indeed it did not appear.
I was checking out the code and it turned out MySQL is the bottleneck, it simply cannot save that large data. (My dpm() with the form status generated a 4.5M large text blob. _drupal_session_write() wants to write it into the db.)
I think it's a normal behavior, as a solution the my.cnf can be adjusted by increasing the max_allowed_packet size:
[mysqld]
max_allowed_packet = 8M
Comment #6
bleen CreditAttribution: bleen commentedPersonally I would love to see a message saying "variable x could not be displayed because it was too large"
Something to tell me in not crazy.
Comment #7
salvisCurrently we delegate dpm() to drupal_set_message(). I'm not aware of any way to detect that it has failed.
There's hope in #1853112: Replacement for Krumo?.
Comment #8
moshe weitzman CreditAttribution: moshe weitzman commentedI don't think it is prudent or reasonable for devel to check the mysql settings and warn if it can't insert a particular debug message. Drupal doesn't do that on its inserts.
Comment #9
salvisBTW, in these situations I try kpr() and it usually works.