[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [ENH] Sublist: parse wiki argvariables in the sublist wiki content, leave only...
"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <68e625a5eb38b_2cdffd449662@gitlab-sidekiq-low-urgency-cpu-bound-v2-8b69f8fc4-nl6h2.mail> |
Victor Emanouilov pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki
Commits:
b99a18f6 by Victor Emanouilov at 2025-10-08T11:49:36+03:00
[ENH] Sublist: parse wiki argvariables in the sublist wiki content, leave only specifically formatted fields in the resultset, add sublist results to parent entry when there is only one entry and no reverse mappign is used
- - - - -
2 changed files:
- lib/core/Search/Formatter.php
- lib/core/Search/Formatter/Sublist/Executor.php
Changes:
=====================================
lib/core/Search/Formatter.php
=====================================
@@ -61,7 +61,7 @@ class Search_Formatter
. $this->render($this->plugin, $list, Search_Formatter_Plugin_Interface::FORMAT_WIKI);
}
- public function getPopulatedList($list, $preload = true)
+ public function getPopulatedList($list, $preload = true, $onlyPreloaded = false)
{
global $prefs;
@@ -121,6 +121,10 @@ class Search_Formatter
}
foreach ($pre as $k => $rawValue) {
+ if ($preload && $onlyPreloaded && ! in_array($k, $fields)) {
+ continue;
+ }
+
$finalValue = null;
// process multilingual fields
=====================================
lib/core/Search/Formatter/Sublist/Executor.php
=====================================
@@ -182,6 +182,9 @@ class Executor
}
}
}
+
+ TikiLib::lib('parser')->parse_wiki_argvariable($body);
+
return $body;
}
@@ -213,7 +216,7 @@ class Executor
foreach ($this->formatterPlugins as $name => $plugin) {
$sf->addSubFormatter($name, $plugin);
}
- $formatted = $sf->getPopulatedList($result, true);
+ $formatted = $sf->getPopulatedList($result, true, true);
foreach ($formatted as $entry) {
foreach ($this->reverseMapping as $i => $mappings) {
@@ -261,6 +264,16 @@ class Executor
}
}
}
+ // add to a single parent record when no match mapping is set (useful for retrieving records in an aggregate random parent record)
+ if (empty($this->reverseMapping) && count($this->data) == 1 && isset($this->data[0])) {
+ if ($this->record->isMultiple()) {
+ $arr = $this->data[0][$key] ?? [];
+ $arr[] = $entry;
+ $this->data[0][$key] = $arr;
+ } else {
+ $this->data[0][$key] = $entry;
+ }
+ }
}
foreach ($this->data as $i => $row) {
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/b99a18f6de31282fa0f9dce3602bff9619281c3c
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/b99a18f6de31282fa0f9dce3602bff9619281c3c
You're receiving this email because of your account on gitlab.com.
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs