From 815eac6c50607ef2130199e614783f4a19d30eba Mon Sep 17 00:00:00 2001 From: andrepereiradasilva Date: Sun, 5 Jun 2016 22:19:47 +0100 Subject: [PATCH 1/4] do not hardcode link in warning message --- .../components/com_finder/helpers/finder.php | 27 +++++++++++++++++++ .../com_finder/views/index/view.html.php | 3 ++- .../language/en-GB/en-GB.com_finder.ini | 3 +-- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/administrator/components/com_finder/helpers/finder.php b/administrator/components/com_finder/helpers/finder.php index f8e389be7909b..c6bf51cd20d4b 100644 --- a/administrator/components/com_finder/helpers/finder.php +++ b/administrator/components/com_finder/helpers/finder.php @@ -50,6 +50,33 @@ public static function addSubmenu($vName) ); } + /** + * Gets the finder system plugin extension id. + * + * @return int The finder system plugin extension id. + * + * @since 3.6.0 + */ + public static function getFinderPluginId() + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('extension_id')) + ->from($db->quoteName('#__extensions')) + ->where($db->quoteName('folder') . ' = ' . $db->quote('content')) + ->where($db->quoteName('element') . ' = ' . $db->quote('finder')); + $db->setQuery($query); + try + { + $result = (int) $db->loadResult(); + } + catch (RuntimeException $e) + { + JError::raiseWarning(500, $e->getMessage()); + } + return $result; + } + /** * Gets a list of the actions that can be performed. * diff --git a/administrator/components/com_finder/views/index/view.html.php b/administrator/components/com_finder/views/index/view.html.php index 99e6c724e8dec..46f3587764d5d 100644 --- a/administrator/components/com_finder/views/index/view.html.php +++ b/administrator/components/com_finder/views/index/view.html.php @@ -52,7 +52,8 @@ public function display($tpl = null) if (!$this->pluginState['plg_content_finder']->enabled) { - JFactory::getApplication()->enqueueMessage(JText::_('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED'), 'warning'); + $link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . FinderHelper::getFinderPluginId()); + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED', $link), 'warning'); } elseif ($this->get('TotalIndexed') === 0) { diff --git a/administrator/language/en-GB/en-GB.com_finder.ini b/administrator/language/en-GB/en-GB.com_finder.ini index 79eab3daf5373..9cf51836dd5cc 100644 --- a/administrator/language/en-GB/en-GB.com_finder.ini +++ b/administrator/language/en-GB/en-GB.com_finder.ini @@ -161,8 +161,7 @@ COM_FINDER_INDEX_HEADING_LINK_URL_ASC="Raw URL ascending" COM_FINDER_INDEX_HEADING_LINK_URL_DESC="Raw URL descending" COM_FINDER_INDEX_NO_CONTENT="No content matches your search criteria." COM_FINDER_INDEX_NO_DATA="No content has been indexed." -; Change 'Content%20-%20Smart%20Search' to the value for PLG_CONTENT_FINDER in plg_content_finder.sys.ini for your language -COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED="Smart Search content plugin is not enabled. Changes to content will not update the Smart Search index if you do not enable this plugin." +COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED="The Smart Search Content Plugin is disabled. Changes to content will not update the Smart Search index." COM_FINDER_INDEX_PURGE_SUCCESS="All items have been successfully deleted." COM_FINDER_INDEX_SEARCH_DESC="Search in title, url and last updated date." COM_FINDER_INDEX_SEARCH_LABEL="Search Indexed Content" From 06933fba6fe2b2431abc0bb5562000fb34be9f81 Mon Sep 17 00:00:00 2001 From: andrepereiradasilva Date: Sun, 5 Jun 2016 22:20:12 +0100 Subject: [PATCH 2/4] cs --- administrator/components/com_finder/helpers/finder.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/administrator/components/com_finder/helpers/finder.php b/administrator/components/com_finder/helpers/finder.php index c6bf51cd20d4b..a847ef4f128ad 100644 --- a/administrator/components/com_finder/helpers/finder.php +++ b/administrator/components/com_finder/helpers/finder.php @@ -66,6 +66,7 @@ public static function getFinderPluginId() ->where($db->quoteName('folder') . ' = ' . $db->quote('content')) ->where($db->quoteName('element') . ' = ' . $db->quote('finder')); $db->setQuery($query); + try { $result = (int) $db->loadResult(); @@ -74,6 +75,7 @@ public static function getFinderPluginId() { JError::raiseWarning(500, $e->getMessage()); } + return $result; } From d8241e4c1854749643c9c5c63c57ec0a080c61e4 Mon Sep 17 00:00:00 2001 From: andrepereiradasilva Date: Sun, 5 Jun 2016 23:05:38 +0100 Subject: [PATCH 3/4] add " unless it is enabled." --- administrator/language/en-GB/en-GB.com_finder.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.com_finder.ini b/administrator/language/en-GB/en-GB.com_finder.ini index 9cf51836dd5cc..d99d29aaeaf31 100644 --- a/administrator/language/en-GB/en-GB.com_finder.ini +++ b/administrator/language/en-GB/en-GB.com_finder.ini @@ -161,7 +161,7 @@ COM_FINDER_INDEX_HEADING_LINK_URL_ASC="Raw URL ascending" COM_FINDER_INDEX_HEADING_LINK_URL_DESC="Raw URL descending" COM_FINDER_INDEX_NO_CONTENT="No content matches your search criteria." COM_FINDER_INDEX_NO_DATA="No content has been indexed." -COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED="The Smart Search Content Plugin is disabled. Changes to content will not update the Smart Search index." +COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED="The Smart Search Content Plugin is disabled. Changes to content will not update the Smart Search index unless it is enabled." COM_FINDER_INDEX_PURGE_SUCCESS="All items have been successfully deleted." COM_FINDER_INDEX_SEARCH_DESC="Search in title, url and last updated date." COM_FINDER_INDEX_SEARCH_LABEL="Search Indexed Content" From c066ecccda6ae929e8596b3935f2acd879131c22 Mon Sep 17 00:00:00 2001 From: andrepereiradasilva Date: Mon, 6 Jun 2016 20:26:10 +0100 Subject: [PATCH 4/4] updated language description --- administrator/language/en-GB/en-GB.com_finder.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.com_finder.ini b/administrator/language/en-GB/en-GB.com_finder.ini index d99d29aaeaf31..20987533127e6 100644 --- a/administrator/language/en-GB/en-GB.com_finder.ini +++ b/administrator/language/en-GB/en-GB.com_finder.ini @@ -161,7 +161,7 @@ COM_FINDER_INDEX_HEADING_LINK_URL_ASC="Raw URL ascending" COM_FINDER_INDEX_HEADING_LINK_URL_DESC="Raw URL descending" COM_FINDER_INDEX_NO_CONTENT="No content matches your search criteria." COM_FINDER_INDEX_NO_DATA="No content has been indexed." -COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED="The Smart Search Content Plugin is disabled. Changes to content will not update the Smart Search index unless it is enabled." +COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED="The Smart Search Content Plugin is disabled. Changes to content will not update the Smart Search index if you do not enable this plugin." COM_FINDER_INDEX_PURGE_SUCCESS="All items have been successfully deleted." COM_FINDER_INDEX_SEARCH_DESC="Search in title, url and last updated date." COM_FINDER_INDEX_SEARCH_LABEL="Search Indexed Content"