When the vault is reachable, PdvRecordMap::alterForm behaves well. When it is entirely unreachable (the access-resolve client call fails, or a misconfigured / down client reports "Vault access is not available"), the form degrades poorly: it still shows the read grant prompt with its "Use my vault data for this form" link AND the save-to-vault checkboxes, alongside a separate "Vault access is not available" message. None of those can work, so the UI is misleading:
- The grant link is a dead end: it leads to the consent flow, which also cannot reach the vault.
- The save checkboxes (
#pdv_record_storeand thepdv_file#offer_vault_save) invite a write that will fail at submit.
Not the problem (working as designed):
- Declining READ but still ticking save to WRITE is legitimate (orthogonal scopes; write consent happens at submit).
- Offering the read grant even when the user owns no item of a kind is intentional (keys on access, not presence; unlocks future prefill + file reuse).
Proposed: when the vault is unreachable/unusable (client failure on the access resolve), degrade the way the kill-switch already does, but with a clear cause:
- Show a single, clear message ("the vault is temporarily unavailable; this form cannot prefill or save right now") instead of the grant prompt + link.
- Hide or disable the save-to-vault checkboxes, so the save UI never lingers on a form that cannot touch the vault.
- Decide explicitly whether the passphrase-locked case (currently shows the unlock prompt but keeps the save boxes) should follow the same path.
- Anonymous users:
alterFormcurrently returns early whencurrentUser->id() === 0, so the save checkboxes still render with no vault behind them. Eventually add a dedicated "log in to prefill from or save to your vault" message and suppress the vault controls for anonymous users too.
Surfaced during the Tugboat demo work (#3594391): a misconfigured vault client made the vault unreachable, and the form showed the grant link plus "Vault access is not available" while the save checkboxes stayed visible. The demo is fixed separately; this is the general UX hardening.
Issue fork pdv-3594410
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
Comment #2
mably commentedComment #4
mably commentedComment #6
mably commented