Problem/Motivation

I have exported the configuration of the module and noticed that the default hidden values are also exported with it, Which are not required.

submit: 'Save configuration'
form_build_id: form-LKA-CzUdBzcv8fsHTmYJEshKMVX7MFkMS_EM2hBfxI4
form_token: DqbBG2Zc0XVZkMXH5Gt9cPESRPFzYQ66xLa2DvjnLr8
form_id: content_moderation_link_settings
op: 'Save configuration'

Steps to reproduce

Save the config form and export the configuration.

Proposed resolution

Skip the unnecessary form values.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 3379956-2.patch1 KBkeshavv

Comments

keshavv created an issue. See original summary.

keshavv’s picture

Status: Active » Needs review
StatusFileSize
new1 KB

Added patch, please review.

  • mandclu committed 579698c0 on 1.0.x
    Issue #3379956 by keshavv: Export config will also exported unnecessary...
mandclu’s picture

Status: Needs review » Fixed

@keshavv thanks for identifying this, and for providing a fix. It seems like it might be easier to take more of an allowlist approach than the provided denylist. In fact, with a little refactoring it would probably be possible to make sure only the intended fields get saved, without managing multiple arrays. That said, the provided code solves the challenge, so the refactoring I have in mind can be a future improvement.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.