[TikiWiki-commits] [Git][tikiwiki/tiki][30.x] [FIX] Installer: Empty home page after a new install

"luci \(@luciash\) via TikiWiki-cvs" <[email protected]> Sat, 18 Jul 2026 21:14:33 +0000
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a5becb984de6_383ad978158f9@gitlab-sidekiq-low-urgency-cpu-bound-v2-76655d7f68-xt4v6.mail>

luci pushed to branch 30.x at Tiki Wiki CMS Groupware / Tiki


Commits:
4b1f61bd by luci at 2026-07-18T21:05:49+00:00
[FIX] Installer: Empty home page after a new install
---
* [FIX] Installer: Empty home page after a new install
---
* [FIX] Installer: Empty home page after a new install

See merge request tikiwiki/tiki!10749


(cherry picked from commit d069860a4cf6e1564e1a319b2f2794e124018b9b)

e5d308bb [FIX] Installer: Empty home page after a new install

Co-authored-by: Landry Bitege <[email protected]>

See merge request tikiwiki/tiki!10752

- - - - -


3 changed files:

- installer/tiki-installer.php
- lib/setup/wiki.php
- lib/wiki/wikilib.php


Changes:

=====================================
installer/tiki-installer.php
=====================================
@@ -652,6 +652,9 @@ if ($install_step == '9') {
     TikiLib::lib('cache')->empty_cache();
     if ($install_type == 'scratch') {
         initialize_prefs(true);
+        // Create the home page now, so it exists before anything resolves the site home url. Otherwise
+        // sefurl() falls back to the edit url and the admin lands on an empty editor instead of the home page.
+        TikiLib::lib('wiki')->createDefaultHomePage();
         TikiLib::lib('unifiedsearch')->rebuild();
         $u = isset($defaultpass) ? 'tiki-change_password.php?user=admin&oldpass=' . $defaultpass . '&newuser=y' : 'tiki-change_password.php?user=admin&newuser=y';
         $tikilib = TikiLib::lib('tiki');


=====================================
lib/setup/wiki.php
=====================================
@@ -63,69 +63,7 @@ if (
     }
 
     // If the HomePage does not exist, create it
-    if ($check && ! empty($_REQUEST['page']) && ! $tikilib->page_exists($_REQUEST['page'])) {
-        $homePageLang = Language::getCurrentLanguage();
-        $profilesLink = 'tiki-admin.php?profile=&categories%5B%5D=30.x&categories%5B%5D=Featured+profiles' .
-                                        '&repository=http%3a%2f%2fprofiles.tiki.org%2fprofiles&page=profiles&preloadlist=y&list=List#step2';
-
-        // Default HomePage content
-        $homePageContent = '';
-        $is_html = false;
-        if (($prefs['feature_wysiwyg'] === 'y') && $prefs['wysiwyg_htmltowiki'] !== 'y') {
-            $is_html = true;
-
-            // FIXME: Still relies on wiki syntax not parsed, in particular if wysiwyg_wiki_parsed is disabled
-            $homePageContent .= '<h1>' . tr('Congratulations') . "</h1>\n";
-            $homePageContent .= tr('This is the default homepage for your Tiki. If you are seeing this page, your installation was successful.') . "\n\n<br>";
-            $homePageContent .= tr('You can change this page after logging in. Please review the [http://doc.tiki.org/Wiki-syntax|wiki syntax] for editing details.') . "\n\n\n<br>";
-            $homePageContent .= '<h2>' . tr('Get started') . ".</h2>\n";
-            $homePageContent .= tr('To begin configuring your site:') . "\n";
-            $homePageContent .= "<ul>\n";
-            $homePageContent .= "<li>" . tr('1) Log in with your newly created password.') . "</li>\n";
-            $homePageContent .= "<li>" . tr('2) Manually [tiki-admin.php?page=features|Enable specific Tiki features] that you didn\'t enable with the Admin wizard.') . "</li>\n";
-            $homePageContent .= "<li>" . tr('3) Run [tiki-admin.php?page=profiles|Tiki Profiles] to quickly get up and running.') . "</li>\n";
-            $homePageContent .= "</ul>\n\n<br>";
-            $homePageContent .= '<h2>' . tr('Need help?') . "</h2>\n";
-            $homePageContent .= tr('For more information:') . "\n<br>";
-            $homePageContent .= '*' . tr('[https://tiki.org/Introduction|Learn more about Tiki].') . "\n<br>";
-            $homePageContent .= '*' . tr('[https://tiki.org/|Get help], including the [http://doc.tiki.org|official documentation] and [http://tiki.org/forums|support forums].') . "\n<br>";
-            $homePageContent .= '*' . tr('[https://tiki.org/Join|Join the Tiki community].') . "\n<br>";
-        } else {
-            $homePageContent .= '!' . tr('Congratulations') . "\n";
-            $homePageContent .= tr('This is the default homepage for your Tiki. If you are seeing this page, your installation was successful.') . "\n\n";
-            $homePageContent .= tr('You can change this page after logging in. Please review the [http://doc.tiki.org/Wiki-syntax|wiki syntax] for editing details.') . "\n\n\n";
-            $homePageContent .= '!!' . tr('Get started.') . "\n";
-            $homePageContent .= tr('To begin configuring your site:') . "\n";
-            $homePageContent .= "{FANCYLIST()}\n";
-            $homePageContent .= tr('1) Log in with your newly created password.') . "\n";
-            $homePageContent .= tr('2) Manually [tiki-admin.php?page=features|Enable specific Tiki features] that you didn\'t enable with the Admin wizard.') . "\n";
-            $homePageContent .= tr('3) Run [tiki-admin.php?page=profiles|Tiki Profiles] to quickly get up and running.') . "\n";
-            $homePageContent .= "{FANCYLIST}\n\n";
-            $homePageContent .= '!!' . tr('Need help?') . "\n";
-            $homePageContent .= tr('For more information:') . "\n";
-            $homePageContent .= '*' . tr('[https://tiki.org/Introduction|Learn more about Tiki].') . "\n";
-            $homePageContent .= '*' . tr('[https://tiki.org/|Get help], including the [http://doc.tiki.org|official documentation] and [http://tiki.org/forums|support forums].') . "\n";
-            $homePageContent .= '*' . tr('[https://tiki.org/Join|Join the Tiki community].') . "\n";
-        }
-
-        $tikilib->create_page(
-            $_REQUEST['page'],
-            0,
-            $homePageContent,
-            $tikilib->now,
-            'Tiki initialization',
-            'admin',
-            '0.0.0.0',
-            '',
-            $homePageLang,
-            $is_html,   // is_html
-            null,
-            $is_html ? 'y' : 'n',   // wysiwyg,
-            ''
-        );
-
-        TikiLib::lib('wiki')->set_page_hide_title($prefs['wikiHomePage'], 0);   // set the page title of the Home Page to hidden
-
-        unset($homePageContent, $homePageLang);
+    if ($check && ! empty($_REQUEST['page'])) {
+        TikiLib::lib('wiki')->createDefaultHomePage($_REQUEST['page']);
     }
 }


=====================================
lib/wiki/wikilib.php
=====================================
@@ -1831,6 +1831,89 @@ class WikiLib extends TikiLib
         TikiLib::lib('attribute')->set_attribute('wiki page', $pageName, 'tiki.wiki.page_hide_title', $isHideTitle);
     }
 
+    /**
+     * Create the default home page, with the introduction content shown on a brand new Tiki.
+     *
+     * @param string $pageName  The page to create. Defaults to the wikiHomePage preference.
+     * @return bool             True when the page was created, false when it already exists or no name is known.
+     */
+    public function createDefaultHomePage($pageName = '')
+    {
+        global $prefs;
+
+        $tikilib = TikiLib::lib('tiki');
+
+        if (empty($pageName)) {
+            $pageName = $prefs['wikiHomePage'];
+        }
+
+        if (empty($pageName) || $tikilib->page_exists($pageName)) {
+            return false;
+        }
+
+        $homePageLang = Language::getCurrentLanguage();
+
+        // Default HomePage content
+        $homePageContent = '';
+        $is_html = false;
+        if (($prefs['feature_wysiwyg'] === 'y') && $prefs['wysiwyg_htmltowiki'] !== 'y') {
+            $is_html = true;
+
+            // FIXME: Still relies on wiki syntax not parsed, in particular if wysiwyg_wiki_parsed is disabled
+            $homePageContent .= '<h1>' . tr('Congratulations') . "</h1>\n";
+            $homePageContent .= tr('This is the default homepage for your Tiki. If you are seeing this page, your installation was successful.') . "\n\n<br>";
+            $homePageContent .= tr('You can change this page after logging in. Please review the [http://doc.tiki.org/Wiki-syntax|wiki syntax] for editing details.') . "\n\n\n<br>";
+            $homePageContent .= '<h2>' . tr('Get started') . ".</h2>\n";
+            $homePageContent .= tr('To begin configuring your site:') . "\n";
+            $homePageContent .= "<ul>\n";
+            $homePageContent .= "<li>" . tr('1) Log in with your newly created password.') . "</li>\n";
+            $homePageContent .= "<li>" . tr('2) Manually [tiki-admin.php?page=features|Enable specific Tiki features] that you didn\'t enable with the Admin wizard.') . "</li>\n";
+            $homePageContent .= "<li>" . tr('3) Run [tiki-admin.php?page=profiles|Tiki Profiles] to quickly get up and running.') . "</li>\n";
+            $homePageContent .= "</ul>\n\n<br>";
+            $homePageContent .= '<h2>' . tr('Need help?') . "</h2>\n";
+            $homePageContent .= tr('For more information:') . "\n<br>";
+            $homePageContent .= '*' . tr('[https://tiki.org/Introduction|Learn more about Tiki].') . "\n<br>";
+            $homePageContent .= '*' . tr('[https://tiki.org/|Get help], including the [http://doc.tiki.org|official documentation] and [http://tiki.org/forums|support forums].') . "\n<br>";
+            $homePageContent .= '*' . tr('[https://tiki.org/Join|Join the Tiki community].') . "\n<br>";
+        } else {
+            $homePageContent .= '!' . tr('Congratulations') . "\n";
+            $homePageContent .= tr('This is the default homepage for your Tiki. If you are seeing this page, your installation was successful.') . "\n\n";
+            $homePageContent .= tr('You can change this page after logging in. Please review the [http://doc.tiki.org/Wiki-syntax|wiki syntax] for editing details.') . "\n\n\n";
+            $homePageContent .= '!!' . tr('Get started.') . "\n";
+            $homePageContent .= tr('To begin configuring your site:') . "\n";
+            $homePageContent .= "{FANCYLIST()}\n";
+            $homePageContent .= tr('1) Log in with your newly created password.') . "\n";
+            $homePageContent .= tr('2) Manually [tiki-admin.php?page=features|Enable specific Tiki features] that you didn\'t enable with the Admin wizard.') . "\n";
+            $homePageContent .= tr('3) Run [tiki-admin.php?page=profiles|Tiki Profiles] to quickly get up and running.') . "\n";
+            $homePageContent .= "{FANCYLIST}\n\n";
+            $homePageContent .= '!!' . tr('Need help?') . "\n";
+            $homePageContent .= tr('For more information:') . "\n";
+            $homePageContent .= '*' . tr('[https://tiki.org/Introduction|Learn more about Tiki].') . "\n";
+            $homePageContent .= '*' . tr('[https://tiki.org/|Get help], including the [http://doc.tiki.org|official documentation] and [http://tiki.org/forums|support forums].') . "\n";
+            $homePageContent .= '*' . tr('[https://tiki.org/Join|Join the Tiki community].') . "\n";
+        }
+
+        $tikilib->create_page(
+            $pageName,
+            0,
+            $homePageContent,
+            $tikilib->now,
+            'Tiki initialization',
+            'admin',
+            '0.0.0.0',
+            '',
+            $homePageLang,
+            $is_html,   // is_html
+            null,
+            $is_html ? 'y' : 'n',   // wysiwyg,
+            ''
+        );
+
+        $this->set_page_hide_title($pageName, 0);   // set the page title of the Home Page to hidden
+
+        return true;
+    }
+
     public function get_without_namespace($pageName)
     {
         global $prefs;



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

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