Skip to content

v3.4.137

Choose a tag to compare

@radialmonster radialmonster released this 17 Jul 01:10
· 25 commits to main since this release

Fix explicitly-cleared variation resources silently re-inheriting the parent product's.

get_drive_resources() and variation_has_own_resources() both treated a variation's
_wgdp_drive_resources meta of "[]" identically to the meta being unset, then fell
through to the parent product's resource list. save_variation_meta() stores exactly
"[]" when an admin removes all files from a variation's Drive-resources panel
(revoking that variation's existing entitlements in the process), so the empty list
was indistinguishable from "never configured."

Failure scenario: a variation has its own resource [fileA]; the admin clears it,
intending the variation to grant nothing going forward. The save correctly revokes
the fileA entitlements, but the next order for that variation falls through to the
parent product's resource list (e.g. [fileB]) and silently grants fileB — a file
never attached to this variation.

Fix: track an explicit "_wgdp_drive_resources_explicit_empty" sentinel whenever a
variation's resource list is intentionally saved as empty, and check it before
falling back to the parent, mirroring how variation_has_own_resources() already
distinguishes "no own list" from "defines its own (possibly empty) list."