Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Config keys stored with wrong type flag, reset after every upgrade

Chiusa
#9,100 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #9169 di @vitormattos — integrata

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
mariadb, php, sql
Ambito
backend, databases

Direzione di ricerca

The three keys add_footer, identification_documents and groups_request_sign are stored in oc_appconfig with the wrong type flag. Start by finding where the libresign app writes and reads these keys, then compare the typed getter used in each path. The effective-policies endpoint at /ocs/v2.php/apps/libresign/api/v1/policies/effective reproduces the warnings. Done means each key is written and read with one matching type and the warnings no longer appear after an upgrade.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

Config keys stored with wrong type flag, reset after every upgrade

To reproduce
Config keys stored with wrong type flag, reset after every upgrade

Environment

  • Nextcloud 35.0.2, LibreSign 15.0.8
  • MariaDB 10.11.14, PHP 8.4 (FPM), Ubuntu 24.04

Problem
Three app config keys contain JSON objects, but their type flag in
oc_appconfig is set to BOOL or ARRAY. LibreSign then reads the same keys
with different types in different code paths, which floods the log with
warnings on every request:

configkey stored type stored value (shortened)
add_footer 32 (BOOL) {"enabled":false,"writeQrcodeOnFooter":true,…}
identification_documents 32 (BOOL) {"enabled":false,"approvers":["admin"]}
groups_request_sign 64 (ARRAY) {"allowGroups":[…]}

Example log messages (each key is requested both as string and as array):

  • Config value libresign/add_footer is stored as boolean but was requested as string
  • Config value libresign/add_footer is stored as boolean but was requested as array
  • Config value libresign/identification_documents is stored as boolean but was requested as string
  • Config value libresign/groups_request_sign is stored as array but was requested as string

Seen on GET /ocs/v2.php/apps/libresign/api/v1/policies/effective and on the
admin settings page.

Recurrence
Setting the type to MIXED (2) silences the warnings:

UPDATE oc_appconfig SET type = 2
 WHERE appid = 'libresign'
   AND configkey IN ('add_footer','identification_documents','groups_request_sign');

The flags are reset to 32/64/32 after upgrades. Observed twice:

  • after Nextcloud 34 → 35.0.1 (September 2026)
  • after Nextcloud 35.0.1 → 35.0.2 together with LibreSign 15.0.7 → 15.0.8 (October 2026)

A LibreSign-only update (15.0.6 → 15.0.7) did not reset them.

Expected
Each key is stored with a type that matches its content and is always read
with that same type (e.g. JSON objects stored as ARRAY or STRING and read via
the matching typed getter). If the keys are declared in a config lexicon,
the declared type should match the actual content.

Expected behavior

No response

Screenshots

No response

Operational System

Linux

Browser Type and Version

All

Libresign Version

15.0.8

Nextcloud Server Version

Nextcloud Hub 26 Summer (35.0.2)

Logs from Nextcloud Server

Zeit : 16. Oktober 2026 - 06:58:12 UTC * IP : XXX * Benutzer : XXX * App : libresign * Methode : GET * URL : /ocs/v2.php/apps/libresign/api/v1/policies/effective *

Grund : Config value libresign/identification_documents is stored as boolean but was requested as string

Zeit : 16. Oktober 2026 - 06:58:12 UTC * IP : XXX * Benutzer : XXX * App : libresign * Methode : GET * URL : /ocs/v2.php/apps/libresign/api/v1/policies/effective *

Grund : Config value libresign/identification_documents is stored as boolean but was requested as array

Zeit : 16. Oktober 2026 - 06:58:12 UTC * IP : XXX * Benutzer : XXX * App : libresign * Methode : GET * URL : /ocs/v2.php/apps/libresign/api/v1/policies/effective *

Grund : Config value libresign/groups_request_sign is stored as array but was requested as string

Zeit : 16. Oktober 2026 - 06:58:12 UTC * IP : XXX * Benutzer : XXX * App : libresign * Methode : GET * URL : /ocs/v2.php/apps/libresign/api/v1/policies/effective *

Grund : Config value libresign/add_footer is stored as boolean but was requested as array

Zeit : 16. Oktober 2026 - 06:58:12 UTC * IP : XXX * Benutzer : XXX * App : libresign * Methode : GET * URL : /ocs/v2.php/apps/libresign/api/v1/policies/effective *

Grund : Config value libresign/add_footer is stored as boolean but was requested as string

Logs from Developers tools

No response

Additional context

No response

Lingua principale
PHP
Stelle
835
Fork
167
Merge medio
1g 3h
PR unite (30g)
379

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di LibreSign/libresign

Tutte le issue di LibreSign/libresign

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.