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

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68c84af8c2057_2c2d9d788454e@gitlab-sidekiq-low-urgency-cpu-bound-v2-679dd6fdf9-jk2cn.mail>

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
cf862a42 by Henock at 2025-09-15T17:13:01+00:00
[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

- - - - -


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
=====================================
@@ -16,6 +16,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/cf862a4211e7b0ab68c58f02e2c87d22aca37773

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/cf862a4211e7b0ab68c58f02e2c87d22aca37773
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
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.