Problem/Motivation

This is another approach to solving the max_input_vars problem.

The problem: when Drupal's core ajax functionality is used, ajax.js gathers up every html id on the page and adds it as POST data to the submission. On a large and complicated page, this can result in gathering and posting thousands of variables, which a) can often exceed the PHP max_input_vars value and b) is slow and bandwidth intensive.

Existing suggestions to solve the problem involve serializing the ids so they are send as one POST input variable. But often you'd rather just not send them at all.

Proposed resolution

Edit ajax.js to make gathering and sending the html ids optional.

Remaining tasks

None.

User interface changes

None.

API changes

May need some documentation, but the setting should be optional, so nothing breaks.

Data model changes

None.

Release notes snippet

Permits developers to add a setting that prevents ajax.js from gathering and sending html ids.

Issue fork drupal-3253601

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gbirch created an issue. See original summary.

anrikun’s picture

Bumping.

ram4nd’s picture

Status: Active » Needs review

apaderno made their first commit to this issue’s fork.

poker10’s picture

Status: Needs review » Needs work

Thanks for working on this. It seems like there is some problem with the MR, as it includes changes to .gitlab-ci.yml and some other unrelated changes (see https://git.drupalcode.org/project/drupal/-/merge_requests/1514/diffs) and therefore the pipeline is failing: https://git.drupalcode.org/issue/drupal-3253601/-/pipelines/144624 . Moving to Needs work.

avpaderno’s picture

Status: Needs work » Needs review

I apologize: I added the GitLab CI files because the issue fork did not contain them, hoping to enable GitLab CI for the merge request, but that showed to be a bad idea.

I created a new issue fork with the same changes the original issue fork contained.

apaderno changed the visibility of the branch 3253601-make-sending-ajaxhtmlids to hidden.

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.