[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][ENH] Improve Module Git details: show clearer message when not a Git install

"MAGENE Sem Joel \(@Jomagene\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69c570dd7ab8a_3b18ee0865347@gitlab-sidekiq-low-urgency-cpu-bound-v2-7c95f9c947-zb9nk.mail>

MAGENE Sem Joel pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
b00db0de by MAGENE Sem Joel at 2026-03-26T17:37:58+00:00
[BP][ENH] Improve Module Git details: show clearer message when not a Git install
---
* [ENH] Improve Module Git details: show clearer message when not a Git install
---
* [FIX] Git detail msg when git in not installed

* Improve Module Git details: show clearer message when not a Git install

See merge request tikiwiki/tiki!8554

(cherry picked from commit cf862a4211e7b0ab68c58f02e2c87d22aca37773)

See merge request tikiwiki/tiki!9863

- - - - -


2 changed files:

- modules/mod-func-git_detail.php
- templates/modules/mod-git_detail.tpl


Changes:

=====================================
modules/mod-func-git_detail.php
=====================================
@@ -33,6 +33,9 @@ function module_git_detail($mod_reference, $module_params)
     $gitlib = TikiLib::lib('git');
     $error = '';
     $content = [];
+    include_once('lib/setup/twversion.class.php');
+    $TWV = new TWVersion();
+    $version = $TWV->getVersion();
 
     try {
         $content = $gitlib->get_info();
@@ -44,6 +47,16 @@ function module_git_detail($mod_reference, $module_params)
         $error = $e->getMessage();
     }
 
+    if (empty($content)) {
+        $content = [
+            'version' => $version,
+            'commit' => 'N/A',
+            'date' => 'N/A',
+            'branch' => 'N/A',
+            'remote' => 'N/A',
+        ];
+    }
+
     $smarty->assign('error', $error);
     $smarty->assign('content', $content);
 }


=====================================
templates/modules/mod-git_detail.tpl
=====================================
@@ -18,6 +18,8 @@ style="{$module_params.style}"
         <span class="date">{tr}from{/tr} {$content.mdate|tiki_short_datetime}</span>
     </div>
 {else}
-    {tr}No Git checkout or unable to determine last update{/tr}
+    <div class="mod-git_detail cvsup">
+        <span class="label">{tr}Tiki version:{/tr} {$content.version}&nbsp;
+    </div>
 {/if}
 {/tikimodule}



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/b00db0de1afa72bc5a35b8920da5b8ca4c953f49

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/b00db0de1afa72bc5a35b8920da5b8ca4c953f49
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.