I also have that bug, on specific usage:
When I try to edit any content type display, for example changing a text format, when ajax loads I first get an error message:
http ajax error 406.
Then the watchdog logs two errors: Invalid POST form datas and Notice : Undefined index: form_build_id in ajax_get_form() (line 326 in [...]/includes/ajax.inc).
I don't know if my issue is related, I tried to apply your patch, but it doesn't solve it.My configuration is D 7.95, php 7.4 and jquery 1.12
Everything was working fine two weeks ago but I don't know what could have caused this issue.I allow myself to raise the priority if this issue, given the important consequences. Has anyone else experienced the same?
- 🇮🇹Italy apaderno Brescia, 🇮🇹
system/ajax is not a path users should directly access. Visiting it would cause errors, as that is not how that path is supposed to be used, which is described in Ajax framework.
- Status changed to Needs work
7 months ago 10:00am 12 April 2024 - 🇸🇰Slovakia poker10
Agree with @apaderno, but I think in such case we can maybe consider adding something similar to mitigate potential PHP warnings written to log. This URL can be accessed by bots and can generate lot of messages to the watchdog in such case.
I am not sure if we should add another watchdog call in this case (as it is proposed in #2), but we can at least check, if the
form_build_id
is set, and if not, pass an empty string. This way it will stop processing later onwatchdog('ajax', 'Invalid form POST data.', array(), WATCHDOG_WARNING);
, but without any PHP warnings. Thanks! - Merge request !7478Issue #3331044: Notice: Undefined index: form_build_id in ajax_get_form() → (Open) created by poker10
- last update
7 months ago 2,180 pass - Status changed to Needs review
7 months ago 9:53pm 12 April 2024 - 🇸🇰Slovakia poker10
Created a MR with proposed fix from #5 + test.
Test only job failed: https://git.drupalcode.org/project/drupal/-/jobs/1315262
Regular pipeline is green: https://git.drupalcode.org/project/drupal/-/pipelines/145260 - Status changed to Fixed
6 months ago 11:24am 3 June 2024 - 🇬🇧United Kingdom mcdruid 🇬🇧🇪🇺
Great - agree it's good to prevent warnings when bots etc.. hit this path.
Thanks!
Automatically closed - issue fixed for 2 weeks with no activity.