# BlueSpiceConfigManager: PluggableAuth json edits dont reactivate save button

**URL:** <https://community.bluespice.com/t/bluespiceconfigmanager-pluggableauth-json-edits-dont-reactivate-save-button/345>\
**Category:** Bugs\
**Created:** [November 13, 2025, 11:05pm UTC](https://community.bluespice.com/t/bluespiceconfigmanager-pluggableauth-json-edits-dont-reactivate-save-button/345 "2025-11-13T23:05:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![SaiCode](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@SaiCode](https://community.bluespice.com/u/SaiCode)\
**Post date:** [November 13, 2025, 11:05pm UTC](https://community.bluespice.com/t/bluespiceconfigmanager-pluggableauth-json-edits-dont-reactivate-save-button/345/1 "2025-11-13T23:05:10Z")

</div>

**Describe the issue / Steps to reproduce:**

When i change the PluggableAuth Data object (JSON) value, the Save button does not recognize i changed it.

I always have to delete the entry and re add it as a new entry.

**Expected behavior:**  
Recognize i changed it.

**What was the error message/error log?**  
Did the screen show an error? Did you look at any error logs? This info will speed up the solution process.

**Screenshots**

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/bluespice/original/1X/e0d9aeabd640530e88b8dea3858412707c43f6d9.png)

If applicable, add screenshots to help explain your problem.

**System info:**  
[view system requirements](https://en.wiki.bluespice.com/wiki/Setup:System_requirements)

Bluespice via Docker,

| BlueSpiceConfigManager | 5.1.3 |
| --- | --- |

---

<div class="post-metadata">

**Author:** ![rvogel](https://avatars.discourse-cdn.com/v4/letter/r/eada6e/32.png) [@rvogel](https://community.bluespice.com/u/rvogel)\
**Post date:** [November 17, 2025, 6:55am UTC](https://community.bluespice.com/t/bluespiceconfigmanager-pluggableauth-json-edits-dont-reactivate-save-button/345/2 "2025-11-17T06:55:12Z")

</div>

Thanks for reporting. We’ll try to reproduce.

---

<div class="post-metadata">

**Author:** ![huaj1ng](https://dub1.discourse-cdn.com/flex017/user_avatar/community.bluespice.com/huaj1ng/32/116_2.png) [@huaj1ng](https://community.bluespice.com/u/huaj1ng)\
**Post date:** [November 17, 2025, 6:57pm UTC](https://community.bluespice.com/t/bluespiceconfigmanager-pluggableauth-json-edits-dont-reactivate-save-button/345/3 "2025-11-17T18:57:16Z")

</div>

Hello SaiCode,

thanks for the feedback. One further detail I would like to confirm:

did you see any error message / failed network request in the developer’s tool of your browser, when you try to save your config?

Greetings,

Hua

---

<div class="post-metadata">

**Author:** ![SaiCode](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@SaiCode](https://community.bluespice.com/u/SaiCode)\
**Post date:** [November 18, 2025, 2:21pm UTC](https://community.bluespice.com/t/bluespiceconfigmanager-pluggableauth-json-edits-dont-reactivate-save-button/345/4 "2025-11-18T14:21:56Z")

</div>

There are no errors. The button stays simply disabled.

Find the following gif attached:

![librewolf_iHJOXYKU3s](https://europe1.discourse-cdn.com/flex017/uploads/bluespice/original/1X/cf5eefad68bc73f31dc639bd797065c796644f7e.gif)

I need to modify something else on the page for the change to be recognized.

Also perhaps improve the input there to be a Textarea or even real json editor so i dont need to modify it like this.

---

<div class="post-metadata">

**Author:** ![huaj1ng](https://dub1.discourse-cdn.com/flex017/user_avatar/community.bluespice.com/huaj1ng/32/116_2.png) [@huaj1ng](https://community.bluespice.com/u/huaj1ng)\
**Post date:** [November 24, 2025, 5:31pm UTC](https://community.bluespice.com/t/bluespiceconfigmanager-pluggableauth-json-edits-dont-reactivate-save-button/345/5 "2025-11-24T17:31:12Z")

</div>

Hello SaiCode,

thanks for your feedback. An internal bug ticket is created to track this issue, and we will let you know when a fix is included in a future release.

Greetings,  
Hua

---

<div class="post-metadata">

**Author:** ![RSDancey](https://dub1.discourse-cdn.com/flex017/user_avatar/community.bluespice.com/rsdancey/32/25_2.png) [@RSDancey](https://community.bluespice.com/u/RSDancey)\
**Post date:** [January 9, 2026, 5:21pm UTC](https://community.bluespice.com/t/bluespiceconfigmanager-pluggableauth-json-edits-dont-reactivate-save-button/345/6 "2026-01-09T17:21:53Z")

</div>

I have the same error, and additionally, if I delete the entire config and make a new one the fields restore to the previous (deleted) config profile; in other words there is no way to actually change these fields once they’ve been saved for the first time.

---

<div class="post-metadata">

**Author:** ![RSDancey](https://dub1.discourse-cdn.com/flex017/user_avatar/community.bluespice.com/rsdancey/32/25_2.png) [@RSDancey](https://community.bluespice.com/u/RSDancey)\
**Post date:** [September 1, 2026, 6:01pm UTC](https://community.bluespice.com/t/bluespiceconfigmanager-pluggableauth-json-edits-dont-reactivate-save-button/345/7 "2026-09-01T18:01:38Z")

</div>

## 1. Save button doesn’t reactivate when editing a JSON value (the original report)

`KeyValueInputWidget` emits `change` in exactly two places:

- `BlueSpiceFoundation/resources/bluespice.oojs/ui/widget/KeyValueInputWidget.js:270` — in `onAddClick()`
- `.../KeyValueInputWidget.js:332` — in `onDeleteClick()`

`BlueSpiceConfigManager/resources/ui/pages/ConfigPage.js:92` is what enables the Save button, and it only listens for that `change` event.

Nothing connects the _inputs of an existing row_ to it. `getForm()` (`KeyValueInputWidget.js:111`, `addToWidgets` at `:117`) stores the key/value widgets but never subscribes to  
their `change`, and `ObjectInputWidget.createInputs()` (`ObjectInputWidget.js:15–33`) builds its sub-widgets without re-emitting `change` either.

So typing into “Plugin name”, “Data object (JSON)” or “Group sync settings (JSON)” on a saved row is genuinely invisible to the form — which is exactly why the button stays grey  
and why the only workaround is delete + re-add (that path _does_ go through `onAddClick`/`onDeleteClick`).

**Fix direction:** have `ObjectInputWidget` emit `change` when any sub-widget changes, and have `getForm()` connect the key and value widgets to re-emit `change` when  
`addToWidgets` is set. I have not implemented or tested this one, unlike the two below.

* * *

## 2. Saved config is silently corrupted when re-rendered — this is the “fields restore to the previous profile” problem

This is the one I reported on 9 January, and it’s a one-character-class bug.

`BlueSpiceFoundation/src/Html/OOUI/KeyObjectInputWidget.php:42`, in `getValueInput()`:

```php
if ( $conf['type'] === 'json' ) {
    $value[$key] = is_string( $value[$key] )
        ? $value[$key]
        : FormatJson::encode( $value ); // encodes the WHOLE entry
}

```

It encodes `$value` (the entire entry) instead of `$value[$key]` (that field’s own value). And because the result is assigned back into `$value[$key]`, the corruption compounds  
across loop iterations — the second JSON field gets the already-corrupted first one nested inside it.

With this stored:

```json
{"Login with Google":{"plugin":"OpenIDConnect","data":{"providerURL":"https://accounts.google.com","clientID":"…","clientsecret":"…"},"groupsyncs":[]}}

```

the form renders as:

```auto
Button label => Login with Google ✓
Plugin name => OpenIDConnect ✓
Data object (JSON) => {"plugin":"OpenIDConnect","data":{…},"groupsyncs":[]} ✗ the whole entry
Group sync settings (JSON) => {"plugin":"OpenIDConnect","data":"{\"plugin\":\"… ✗ that again, nested

```

Press Save from that state and the garbage is written back to `bs_settings3`. In our `bs-config-manager` log this shows up as a working config going straight to empty:

```auto
DistributionConnectorPluggableAuthConfig: {full config} -> {}

```

That is why the fields appear to “restore to the previous profile” and why the config can never be edited after the first save.

**Fix** (verified — after this, the sub-fields round-trip correctly):

```diff
--- a/src/Html/OOUI/KeyObjectInputWidget.php
+++ b/src/Html/OOUI/KeyObjectInputWidget.php
@@ -39,7 +39,7 @@
                              if ( $conf['type'] === 'json' ) {
                                      $value[$key] = is_string( $value[$key] )
                                              ? $value[$key]
- : FormatJson::encode( $value );
+ : FormatJson::encode( $value[$key] );
                              }

```

After the patch:

```auto
Data object (JSON) => {"providerURL":"https://accounts.google.com","clientID":"…","clientsecret":"…"}
Group sync settings (JSON) => []

```

Note this widget is generic, but `PluggableAuth/Config.php` is the only config definition in the distribution that uses `TYPE_JSON` sub-fields (`EventBus/EventServices.php` uses  
only `TYPE_TEXT`/`TYPE_NUMBER`), so PluggableAuth is the only visible victim.

* * *

## 3. Saving drops you back on the first tab

After saving, the ConfigManager jumps to Administration instead of staying on Authentication, which makes a successful save look like it did nothing.

`BlueSpiceConfigManager/resources/ui/panel/ConfigManager.js:134`:

```js
if ( !this.selectedPage || !configPages.includes( this.selectedPage ) ) {
if ( !this.selectedPage || !configPages.includes( this.selectedPage ) ) {

```

The booklet’s `select` handler sets `this.selectedPage = item.data` — a page **name string** — but this compares it against `configPages`, an array of `ConfigPage` **objects**.  
The check can never match, so every store reload falls through to `selectFirstSelectablePage()`. The `else` branch calling `setPage( this.selectedPage )` confirms a string was  
intended.

**Fix:**

```diff
--- a/resources/ui/panel/ConfigManager.js
+++ b/resources/ui/panel/ConfigManager.js
@@ -132,9 +132,10 @@
      this.bookletLayout.addPages( configPages );

- if ( !this.selectedPage || !configPages.includes( this.selectedPage ) ) {
+ const configPageNames = configPages.map( ( configPage ) => configPage.getName() );
+ if ( !this.selectedPage || !configPageNames.includes( this.selectedPage ) ) {
              this.bookletLayout.selectFirstSelectablePage();
- this.selectedPage = this.bookletLayout.getCurrentPage();
+ this.selectedPage = this.bookletLayout.getCurrentPage().getName();
      } else {
              this.bookletLayout.setPage( this.selectedPage );
      }

```

* * *

## One more, smaller

`JsonArrayInputWidget.getValue()` wraps `JSON.parse` in a try/catch and returns `{}` on failure, and the widget has no `getValidity()`, so it is skipped by  
`validateAddNewForm()` entirely. A typo in “Data object (JSON)” is therefore accepted silently and saved as empty, with no error shown anywhere. That supports the earlier  
suggestion in this thread for a proper JSON editor — or at minimum, validation that refuses to save unparseable input.

Also worth noting: `ConfigManager.js`’s save handler only checks `response.error`. The `configmanager` save task returns `success: false` with `result.message` when a record  
fails validation, which the UI never surfaces — so a rejected save reports nothing at all to the user.
