Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Trying to fix bug in tagmodules_index. CAREFUL: This commit may not w…

…ork property
  • Loading branch information...
commit fc7a752ce0e98357cdc6f8b648fe2ad7f2bd1edc 1 parent 680b620
@shakty authored
Showing with 14 additions and 5 deletions.
  1. +13 −4 patterns.module
  2. +1 −1  tests/system/system.test
View
17 patterns.module
@@ -842,18 +842,27 @@ function patterns_get_tagmodules_index($tag_name = NULL, $data = NULL, $key = NU
}
}
}
-
+ // We may need to rebuild the index just for the specific tag
+ else if (!empty($tag_name) && !empty($data)) {
+ $module = $tag_modules[$tag_name]['module'];
+ if (!empty($module)) {
+ $tag_modules[$tag_name] = module_invoke($module, 'patterns', $data);
+ }
+ }
+
+
+
// Part of tag
- if (!is_null($tag_name) && !is_null($key)) {
+ if (!empty($tag_name) && !empty($key)) {
return $tag_modules[$tag_name][$key];
}
// Full tag
- if (!is_null($tag_name)) {
+ if (!empty($tag_name)) {
return $tag_modules[$tag_name];
}
// All the values of key=$key from all tags
- if (!is_null($key)) {
+ if (!empty($key)) {
$out = array();
foreach ($tag_modules as $tag => $value) {
if (isset($value[$key])) {
View
2  tests/system/system.test
@@ -111,7 +111,7 @@ class PatternsSystemTestCase extends PatternsTestCase {
// Check for variables after running the pattern.
$this->assertIdentical(variable_get('cache', NULL), 1, t('cache variable should be 1.'));
$this->assertIdentical(variable_get('anonymous', NULL), 'Anonymous2', t("Anonymous variable should be 'Anonymous2'."));
-
+
}
public function testTheme() {
Please sign in to comment.
Something went wrong with that request. Please try again.