Large Backdrop CMS forms can send a long ajax_html_ids[] list with each AJAX
POST. In multipart requests, every ID adds its own field headers and boundary.
On hosts with a small non-file request-body limit (often 128 KiB), an image
Remove button, Select Existing button, or another AJAX form control may fail
with HTTP 400 or 413 even though no large file is being uploaded.
This module sends the same complete list of IDs as one comma-separated
ajax_html_ids[] value. Backdrop core's backdrop_html_id() already supports
this representation. It preserves Backdrop's duplicate-ID protection while
removing repeated multipart field overhead. It does not alter saved content,
change PHP or firewall settings, or disable security checks.
- Place this directory at
modules/md_compact_ajax_idsin a Backdrop 1.x site and enable MD Compact AJAX IDs atadmin/modules. - Clear Backdrop's cache so the new JavaScript is included.
- On a large edit form, retry the failing AJAX action. In the browser's
Network panel, compare the POST status and
Content-Lengthbefore and after enabling the module.
There are no settings. Disable the module to restore Backdrop's standard AJAX request format.
- Applies to Backdrop AJAX requests that generate an
ajax_html_ids[]list. - Keeps the original list if an ID contains a comma or the value is not an array, avoiding an ambiguous conversion.
- Cannot help when the rest of the form alone exceeds the host's limit, or when a request fails for an unrelated reason. Check the server/WAF logs in those cases.
- Does not replace a host-specific ModSecurity rule or change its policy.
For technical background, see Backdrop's
backdrop_html_id() documentation
and ModSecurity's SecRequestBodyNoFilesLimit documentation.
Joshua McCormack — McCormackDesigns.net
Created for Backdrop CMS by Joshua McCormack. This is an original module, not a Drupal 7 port. No third-party assets are included.
GPL v2 or later. See LICENSE.txt.