On a Webform using the PdvRecordMap handler, when the owner's vault is passphrase-locked the form correctly shows the "Unlock my vault" prompt and hides the record store-consent checkboxes. But a pdv_file element's "Save or update this file in my vault for reuse" checkbox is still rendered, even though a write cannot succeed while the vault is locked.

Steps to reproduce

  1. Enable an owner passphrase and lock the vault.
  2. Open a Webform that maps a pdv_file element with #offer_vault_save (for example the consent-required onboarding demo form).
  3. The unlock prompt appears and the record store-consent boxes are hidden, but the file "Save ... for reuse" checkbox remains.

Cause

The pdv_file save controls (save_to_vault / save_kind) are composite children built in the element #process pass, which runs after the handler's alterForm. At the time hideSaveControls() runs they are not yet keys in the form array, so hiding them by key is a no-op. The record store-consent checkboxes are real top-level elements, so they hide correctly.

Fix

Clear #offer_vault_save on every pdv_file element on the locked and unreachable-vault paths. The composite reads that flag when it later builds its children (PdvFile::saveToVaultElement returns nothing when it is falsy), so the save controls are never emitted: the same lever that already self-hides them for an anonymous submitter. A kernel test covers the locked case.

Issue fork pdv-3595220

Command icon 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

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review

  • mably committed 4388e3d7 on 1.x
    fix: #3595220 Passphrase-locked vault still shows the pdv_file "Save to...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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