Skip to content

Commit ae8ed74

Browse files
teunbrandthomasp85
authored andcommitted
Fix partial match in deprecated guide arguments (#5603)
* fix partial match bug * report more informative call
1 parent 3126fc0 commit ae8ed74

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

R/guide-.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ new_guide <- function(..., available_aes = "any", super) {
5151
# Validate theme settings
5252
if (!is.null(params$theme)) {
5353
check_object(params$theme, is.theme, what = "a {.cls theme} object")
54-
validate_theme(params$theme)
54+
validate_theme(params$theme, call = caller_env())
5555
params$direction <- params$direction %||% params$theme$legend.direction
5656
}
5757

R/guide-legend.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ deprecated_guide_args <- function(
781781
unit(x, default.unit)
782782
}
783783

784-
theme <- theme %||% list()
784+
theme <- theme %||% theme()
785785

786786
# Resolve straightforward arguments
787787
theme <- replace_null(

R/theme.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,13 +529,13 @@ is_theme_validate <- function(x) {
529529
isTRUE(validate %||% TRUE)
530530
}
531531

532-
validate_theme <- function(theme, tree = get_element_tree()) {
532+
validate_theme <- function(theme, tree = get_element_tree(), call = caller_env()) {
533533
if (!is_theme_validate(theme)) {
534534
return()
535535
}
536536
mapply(
537537
validate_element, theme, names(theme),
538-
MoreArgs = list(element_tree = tree)
538+
MoreArgs = list(element_tree = tree, call = call)
539539
)
540540
}
541541

0 commit comments

Comments
 (0)