Edge Modules > Disable Caching form broken

Created on 17 February 2023, almost 2 years ago
Updated 29 February 2024, 10 months ago

Problem/Motivation

Disable caching form seems broken. It doesn't have a starting set of fields to populate to Add them to begin with. When I do show them with a minor code tweak, add button fails, etc, etc.

Steps to reproduce

Go to Edge Modules. Click Disable Caching. Form comes up, with just "Disable caching for", and then the Add button, with nothing in between.

Proposed resolution

Tweak to get the initial blank fields: in DisableCacheForm(), first for loop goes to <=, not just <
I continued with filling that out, hitting the Add button.
Ok, after that, DisableCacheForm->buildForm doesn't see newly passed values in $form_state. So then the line $form_state->get('rules') is false, and we set rules to 0, which is messed up, and addRule method doesn't know what $rules['actions'] are, and fails there.
That's about as far as I got in debugging before stopping for time.

Note: even on clicking the button, buildForm() gets executed before addRule().

Also, setting rules to a number vs an array of values - does it make sense?

πŸ› Bug report
Status

Needs review

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States orimk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024