Skip to content

Commit

Permalink
set default user route for Search module and add method for ModUtil::…
Browse files Browse the repository at this point in the history
…url() to get the method if available. closes #2506
  • Loading branch information
craigh committed Nov 7, 2015
1 parent 296e491 commit 1ec9e6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/util/ModUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,14 @@ private static function symfonyRoute($modname, $type, $func, $args, $ssl, $fragm
$router->getContext()->setScheme('https');
}

// check for default route provided by capabilities array, unshift to beginning of search array.
if ($func == 'index') {
$modInfo = ModUtil::getInfoFromName($modname);
if (isset($modInfo['capabilities'][$type]['route'])) {
array_unshift($routeNames, $modInfo['capabilities'][$type]['route']);
}
}

$found = false;
foreach ($routeNames as $routeName) {
try {
Expand Down
1 change: 1 addition & 0 deletions src/system/SearchModule/SearchModuleVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function getMetaData()
$meta['url'] = $this->__('search');
$meta['version'] = '1.5.4';
$meta['core_min'] = '1.4.0';
$meta['capabilities'] = ['user' => ['route' => 'zikulasearchmodule_user_form']];

$meta['securityschema'] = array('ZikulaSearchModule::' => 'Module name::');

Expand Down

0 comments on commit 1ec9e6a

Please sign in to comment.