From ae218a7b65cd4c18d92aed23ec97a4121cb98289 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Mon, 6 May 2013 09:08:28 -0400 Subject: [PATCH] Maximum tag length is now configurable (resolves VUFIND-805). --- config/vufind/config.ini | 8 +++++++- module/VuFind/config/module.config.php | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/config/vufind/config.ini b/config/vufind/config.ini index c28b4c82e8b..118d32ca467 100644 --- a/config/vufind/config.ini +++ b/config/vufind/config.ini @@ -853,4 +853,10 @@ treeSearchLimit = 100 ;email_subject = "VuFind Feedback" ; This is the information for where feedback emails are sent from. ;sender_email = "noreply@vufind.org" -;sender_name = "VuFind Feedback" \ No newline at end of file +;sender_name = "VuFind Feedback" + +; This section allows configuration of VuFind's social features +[Social] +; This controls the maximum length of a single tag; it should correspond with the +; field size in the tags database table. +max_tag_length = 64 \ No newline at end of file diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 77ddc3d3db1..8fb8b2a3a62 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -278,7 +278,10 @@ $config = array( ); }, 'VuFind\Tags' => function ($sm) { - return new \VuFind\Tags(); + $config = $sm->get('VuFind\Config')->get('config'); + $maxLength = isset($config->Social->max_tag_length) + ? $config->Social->max_tag_length : 64; + return new \VuFind\Tags($maxLength); }, 'VuFind\Translator' => function ($sm) { $factory = new \Zend\I18n\Translator\TranslatorServiceFactory(); -- GitLab