From 283cca3f73e1ab32ca51cd63cc48cdc18bd63bd5 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Tue, 24 Apr 2018 13:58:14 -0400 Subject: [PATCH] Pass driver object to label function. - Progress on VUFIND-1267. --- .../VuFind/src/VuFind/View/Helper/Root/RecordDataFormatter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/VuFind/src/VuFind/View/Helper/Root/RecordDataFormatter.php b/module/VuFind/src/VuFind/View/Helper/Root/RecordDataFormatter.php index 8fc80ff8c15..df5bd32ca08 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/RecordDataFormatter.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/RecordDataFormatter.php @@ -102,7 +102,8 @@ class RecordDataFormatter extends AbstractHelper } // Allow dynamic label override: $label = is_callable($current['labelFunction'] ?? null) - ? call_user_func($current['labelFunction'], $data) : $field; + ? call_user_func($current['labelFunction'], $data, $driver) + : $field; $result[$label] = [ 'value' => $text, 'context' => $current['context'] ?? [], -- GitLab