<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us">
  <title type="text">In the trenches</title>
  <subtitle type="text">News about the front line. What&amp;#039;s upcoming in the next major release from the developer&amp;#039;s point of view.&#13;
&#13;
No marketing allowed.</subtitle>
  <logo>https://dev.tiki.org/dl652</logo>
  <updated>2026-08-08T08:18:40+00:00</updated>
  <generator uri="https://getlaminas.org" version="2">Laminas_Feed_Writer</generator>
  <link rel="alternate" type="text/html" href="https://dev.tiki.org/"/>
  <link rel="self" type="application/atom+xml" href="https://dev.tiki.org/tiki-blog_rss.php?blogId=3"/>
  <id>https://dev.tiki.org/</id>
  <entry>
    <title type="html"><![CDATA[Some Tiki Flavour Shortcuts]]></title>
    <summary type="html"><![CDATA[<p>I should have added these many moons ago, imagine the wasted seconds typing these commands every day, over and over...
</p>
<div class="codecaption">Add this to your .bashrc, .zshrc etc</div><div class="codelisting_container"><div class="icon_copy_code far fa-clipboard" tabindex="0"  data-clipboard-target="#codebox3" ><span class="copy_code_tooltiptext">Copy to clipboard</span></div><pre class="codelisting"  data-theme="off"  data-syntax="shell"  data-wrap="1"  dir="ltr"  style="white-space:pre-wrap; overflow-wrap: break-word; word-wrap: break-word;" id="codebox3" ><div class="code">alias tsu=&#039;sh setup.sh -n build; php console.php d:u;  php console.php c:c;&#039;
alias tcc=&#039;php console.php cache:clear&#039;
alias tir=&#039;php console.php index:rebuild --log -p&#039;
alias tdu=&#039;php console.php database:update&#039;</div></pre></div>
<p>Enjoy!</p>
]]></summary>
    <published>2026-07-08T10:22:00+00:00</published>
    <updated>2026-07-08T10:22:00+00:00</updated>
    <link rel="alternate" type="text/html" href="https://dev.tiki.org/blogpost43-Some-Tiki-Flavour-Shortcuts"/>
    <id>https://dev.tiki.org/blogpost43-Some-Tiki-Flavour-Shortcuts</id>
  </entry>
  <entry>
    <title type="html"><![CDATA[Backport policy and templates notes]]></title>
    <summary type="html"><![CDATA[<p>Further to <a id="mentioned-benoitg-section-1" title="User Information" href="user11915" class="userlink ajaxtips" data-ajaxtips="tiki-user-info?username=benoitg"><b>@Benoit Grégoire</b></a>'s <a class="wiki external" target="_blank" title="External link" href="https://pad.evoludata.com/unsb2NCAQpiL6HCBtbf34A" rel="external"> article</a><img src="img/icons/green_question.png" alt="Question" width="16" height="16" name="link-external" title="Question" class="icon" />, here are some MR's for backports i'm currently or recently been involved in.
</p>

<h3 class="showhide_heading d-flex justify-content-start" id="Combined_backport_of_the_various_fixes_trying_to_resolve_regressions_from_sections_refactoring"> <a class="wiki external" target="_blank" title="External link" href="https://gitlab.com/tikiwiki/tiki/-/merge_requests/10569" rel="external">Combined backport of the various fixes trying to resolve regressions from sections refactoring</a><img src="img/icons/green_question.png" alt="Question" width="16" height="16" name="link-external" title="Question" class="icon"&nbsp;/><a href="#Combined_backport_of_the_various_fixes_trying_to_resolve_regressions_from_sections_refactoring" class="heading-link" aria-label="heading link"><span class="icon icon-link fas fa-link "   ></span></a></h3>
<ul><li> This is attempting to correct regressions caused by <span><strong><a class="wiki external" target="_blank" title="External link" href="https://gitlab.com/tikiwiki/tiki/-/merge_requests/8658" rel="external">!8658 <span class="icon icon-gitlab fab fa-gitlab "   ></span></a><img src="img/icons/green_question.png" alt="Question" width="16" height="16" name="link-external" title="Question" class="icon" /></strong></span>, <span><strong><a class="wiki external" target="_blank" title="External link" href="https://gitlab.com/tikiwiki/tiki/-/merge_requests/9802" rel="external">!9802 <span class="icon icon-gitlab fab fa-gitlab "   ></span></a><img src="img/icons/green_question.png" alt="Question" width="16" height="16" name="link-external" title="Question" class="icon" /></strong></span>, <span><strong><a class="wiki external" target="_blank" title="External link" href="https://gitlab.com/tikiwiki/tiki/-/merge_requests/9703" rel="external">!9703 <span class="icon icon-gitlab fab fa-gitlab "   ></span></a><img src="img/icons/green_question.png" alt="Question" width="16" height="16" name="link-external" title="Question" class="icon" /></strong></span> (which i think was reverted), and maybe others.
</li><li> Release blocker: <a class="wiki"   href="item8949-Admin-theme-is-used-for-whole-site-theme-switch-module-doesn't-work" rel="">item8949-Admin-theme-is-used-for-whole-site-theme-switch-module-doesn't-work</a> and others arising.
<p>
</li></ul></p>
<h3 class="showhide_heading d-flex justify-content-start" id="map_fixes_and_updates_for_upgrading_cartograf_to_tiki_30_"> <a class="wiki external" target="_blank" title="External link" href="https://gitlab.com/tikiwiki/tiki/-/merge_requests/10415" rel="external">map fixes and updates for upgrading cartograf to tiki 30+</a><img src="img/icons/green_question.png" alt="Question" width="16" height="16" name="link-external" title="Question" class="icon"&nbsp;/><a href="#map_fixes_and_updates_for_upgrading_cartograf_to_tiki_30_" class="heading-link" aria-label="heading link"><span class="icon icon-link fas fa-link "   ></span></a></h3>
<ul><li> This was intended to go in Tiki 30.0 but reality, and the size of the challenge, means it won't make it but would be a good addition to 30.1 and the funding for it depends on that.
</li><li> It finally upgrades the rest of the mapping features to be able to run on a supported version of OpenLayers, the previous version OL2 having been removed in <span><strong><a class="wiki external" target="_blank" title="External link" href="https://gitlab.com/tikiwiki/tiki/-/merge_requests/5534" rel="external">!5534 <span class="icon icon-gitlab fab fa-gitlab "   ></span></a><img src="img/icons/green_question.png" alt="Question" width="16" height="16" name="link-external" title="Question" class="icon" /></strong></span> in 2024, without replacement code being added.
</li><li> These features were developed for <a class="wiki external" target="_blank" title="External link" href="http://profiles.tiki.org/CartoGraf" rel="external">Cartograf</a><img src="img/icons/green_question.png" alt="Question" width="16" height="16" name="link-external" title="Question" class="icon" /> and are still in use on <a class="wiki external" target="_blank" title="External link" href="https://cartograf.learnquebec.ca" rel="external"> cartograf.learnquebec.ca</a><img src="img/icons/green_question.png" alt="Question" width="16" height="16" name="link-external" title="Question" class="icon" />, run by <a class="wiki external" target="_blank" title="External link" href="https://www.learnquebec.ca/" rel="external">LEARN</a><img src="img/icons/green_question.png" alt="Question" width="16" height="16" name="link-external" title="Question" class="icon" /> who are funding the upgrade. The development server is available here <a class="wiki external" target="_blank" title="External link" href="https://cartografdev.learnquebec.ca" rel="external"> cartografdev.learnquebec.ca</a><img src="img/icons/green_question.png" alt="Question" width="16" height="16" name="link-external" title="Question" class="icon" /> and is running on the <span><strong><a class="wiki external" target="_blank" title="External link" href="https://gitlab.com/tikiwiki/tiki/-/merge_requests/10415" rel="external">!10415 <span class="icon icon-gitlab fab fa-gitlab "   ></span></a><img src="img/icons/green_question.png" alt="Question" width="16" height="16" name="link-external" title="Question" class="icon" /></strong></span> branch.
<p>
</li></ul></p>
<h3 class="showhide_heading d-flex justify-content-start" id="Full_list_too_many_to_analyse_now_here"> Full list (too many to analyse now)&nbsp;here<a href="#Full_list_too_many_to_analyse_now_here" class="heading-link" aria-label="heading link"><span class="icon icon-link fas fa-link "   ></span></a></h3>
<ul><li> <a class="wiki external" target="_blank" title="External link" href="https://gitlab.com/tikiwiki/tiki/-/merge_requests/?sort=updated_desc&amp;state=merged&amp;author_username=jonnybradley&amp;label_name%5B%5D=Backported&amp;first_page_size=20" rel="external">gitlab.com/tikiwiki/tiki/-/merge_requests/ jonnybradley Backported</a><img src="img/icons/green_question.png" alt="Question" width="16" height="16" name="link-external" title="Question" class="icon" />
<p>
</li></ul><br />I suppose one fairly easy category to define is for [FIX]es in master to be backported to latest stable, where relevant (i.e. the thing being fixed is in the XX.x branch). This is especially so before the release of XX.0, as we are, for example, trying to do now.</p>
]]></summary>
    <published>2026-06-29T09:10:00+00:00</published>
    <updated>2026-06-29T09:10:00+00:00</updated>
    <link rel="alternate" type="text/html" href="https://dev.tiki.org/blogpost42-Backport-policy-and-templates-notes"/>
    <id>https://dev.tiki.org/blogpost42-Backport-policy-and-templates-notes</id>
  </entry>
  <entry>
    <title type="html"><![CDATA[Is this blog title still appropriate?]]></title>
    <summary type="html"><![CDATA[<p>With the amount of active military conflict going on these days i feel uncomfortable with the name of this blog, sitting in comfort here, "just typing".
<br />Anyone else? Or am i just boing over sensitive?
</p>

<p>Anyway, wanted to collate some notes on backports so thought this would be a good place to do it (and consume some dog food!)
</p>

<p>
<br />P.s. Didn't take long, clicked preview (as the nice ajax preview i added a while ago seems to have gone**) and:
</p>
<div class="codelisting_container"><div class="icon_copy_code far fa-clipboard" tabindex="0"  data-clipboard-target="#codebox4" ><span class="copy_code_tooltiptext">Copy to clipboard</span></div><pre class="codelisting"  data-theme="off"  data-wrap="1"  dir="ltr"  style="white-space:pre-wrap; overflow-wrap: break-word; word-wrap: break-word;" id="codebox4" ><div class="code">Fatal error rendering template file &quot;tiki-blog_post.tpl&quot;
Exception: Invalid wysiwyg parameter in /home/tiki-dev/public_html/lib/setup/editmode.php:30
Stack trace:
#0 /home/tiki-dev/public_html/lib/smarty_tiki/BlockHandler/TextArea.php(63): include_once()
#1 /home/tiki-dev/public_html/temp/templates_c/en_social^0606a41d9a0840f9ff252eae39c5c7670fffec14_0.file_tiki-blog_post.tpl.php(175): SmartyTiki\BlockHandler\TextArea-&gt;handle()
#2 /home/tiki-dev/public_html/vendor_bundled/vendor/smarty/smarty/src/Template/GeneratedPhpFile.php(111): content_6a42346aa78898_00112357()
#3 /home/tiki-dev/public_html/vendor_bundled/vendor/smarty/smarty/src/Template/Compiled.php(110): Smarty\Template\GeneratedPhpFile-&gt;getRenderedTemplateCode()
#4 /home/tiki-dev/public_html/vendor_bundled/vendor/smarty/smarty/src/Template.php(180): Smarty\Template\Compiled-&gt;render()
#5 /home/tiki-dev/public_html/vendor_bundled/vendor/smarty/smarty/src/Template.php(655): Smarty\Template-&gt;render()
#6 /home/tiki-dev/public_html/vendor_bundled/vendor/smarty/smarty/src/Template.php(589): Smarty\Template-&gt;_execute()
#7 /home/tiki-dev/public_html/vendor_bundled/vendor/smarty/smarty/src/Smarty.php(2117): Smarty\Template-&gt;fetch()
#8 /home/tiki-dev/public_html/lib/core/Tiki/Smarty/SmartyTiki.php(177): Smarty\Smarty-&gt;fetch()
#9 /home/tiki-dev/public_html/lib/core/Tiki/Smarty/SmartyTiki.php(361): Tiki\Smarty\SmartyTiki-&gt;fetch()
#10 /home/tiki-dev/public_html/lib/core/Tiki/Smarty/SmartyTiki.php(298): Tiki\Smarty\SmartyTiki-&gt;assign_layout_sections()
#11 /home/tiki-dev/public_html/tiki-blog_post.php(311): Tiki\Smarty\SmartyTiki-&gt;display()
#12 {main}</div></pre></div>
<p>
<br /> ** Found it, someone had disabled it, or maybe another code regression...</p>
]]></summary>
    <published>2026-06-29T09:01:00+00:00</published>
    <updated>2026-06-29T09:01:00+00:00</updated>
    <link rel="alternate" type="text/html" href="https://dev.tiki.org/blogpost41-Is-this-blog-title-still-appropriate-3F"/>
    <id>https://dev.tiki.org/blogpost41-Is-this-blog-title-still-appropriate-3F</id>
  </entry>
  <entry>
    <title type="html"><![CDATA[Added the Mediaplayer wiki-plugin in the toolbar at dev.t.o]]></title>
    <summary type="html"><![CDATA[<p><em>Seems this is the dev.t.o blog</em> ??‍♂️
</p>

<p>As we are using more and more video screenshot I added the Mediaplayer wiki-plugin in the editor toolbar.</p>
]]></summary>
    <published>2023-06-27T05:37:00+00:00</published>
    <updated>2023-06-27T05:37:00+00:00</updated>
    <link rel="alternate" type="text/html" href="https://dev.tiki.org/blogpost37-Added-the-Mediaplayer-wiki-plugin-in-the-toolbar-at-dev-t-o"/>
    <id>https://dev.tiki.org/blogpost37-Added-the-Mediaplayer-wiki-plugin-in-the-toolbar-at-dev-t-o</id>
  </entry>
  <entry>
    <title type="html"><![CDATA[Vue.js in Tiki, first baby steps]]></title>
    <summary type="html"><![CDATA[<p>It feels like I’ve just attached an intergalactic infinity-drive engine to a steam train... should be an interesting ride!
</p>

<p><a href="VueJS-In-Tiki" title="VueJS In Tiki" class="wiki wiki_page">VueJS In Tiki</a></p>
]]></summary>
    <published>2019-11-18T21:42:00+00:00</published>
    <updated>2019-11-18T21:42:00+00:00</updated>
    <link rel="alternate" type="text/html" href="https://dev.tiki.org/blogpost34-Vue-js-in-Tiki-2C-first-baby-steps"/>
    <id>https://dev.tiki.org/blogpost34-Vue-js-in-Tiki-2C-first-baby-steps</id>
  </entry>
  <entry>
    <title type="html"><![CDATA[The module-ificaton of Tiki themes & easy module export via profiles in Tiki 9.1]]></title>
    <summary type="html"><![CDATA[<p>Themes historically include CSS, images and some custom Smarty (*.tpl) files. However, increasingly, we are using modules.  <a href="https://doc.tiki.org/module%20menu" class="wiki ext_page doc">module menu</a>, <a href="https://doc.tiki.org/module%20logo" class="wiki ext_page doc">module logo</a>, <a href="https://doc.tiki.org/module%20breadcrumbs" class="wiki ext_page doc">module breadcrumbs</a>, etc.
</p>

<p>So if you are developing a theme on server A, and you want to copy to server B, it's no longer just copying over the theme files, but also reconfiguring the modules.
</p>

<p>This is time consuming and error-prone. Profiles are perfect for this, but building and maintaining profiles in wiki pages is time consuming. Now, thanks to the profile export, it becomes easier & faster.
</p>

<p>In the future, we'll be looking into having this available as a text file in the theme package, a bit like <a href="https://doc.tiki.org/System%20Configuration" class="wiki ext_page doc">System Configuration</a> for <a href="Preferences" title="Preferences" class="wiki wiki_page">preferences</a>.
</p>

<p>For now, go to tiki-admin.php?page=profiles -&gt; Export
</p>

<p>And on the new site, tiki-admin.php?page=profiles -&gt; Advanced -&gt; Profile tester
</p>

<p>The code for this is <a class="wiki external" target="_blank" title="External link" href="http://tikiwiki.svn.sourceforge.net/viewvc/tikiwiki?view=revision&amp;revision=42346" rel="external">r42346</a><img src="img/icons/green_question.png" alt="Question" width="16" height="16" name="link-external" title="Question" class="icon" />
</p>

<p>Enjoy!</p>
]]></summary>
    <published>2012-07-11T17:18:00+00:00</published>
    <updated>2012-07-11T17:18:00+00:00</updated>
    <link rel="alternate" type="text/html" href="https://dev.tiki.org/blogpost22-The-module-ificaton-of-Tiki-themes-26-easy-module-export-via-profiles-in-Tiki-9-1"/>
    <id>https://dev.tiki.org/blogpost22-The-module-ificaton-of-Tiki-themes-26-easy-module-export-via-profiles-in-Tiki-9-1</id>
  </entry>
  <entry>
    <title type="html"><![CDATA[June 4, Montreal]]></title>
    <summary type="html"><![CDATA[<p>Tiki7 is yet to be released, but still there are some important changes are happening in trunk. Over the last few days, I rewrote most of the UI for comments. The objective was to use the same comments for trackers as for the rest of Tiki, but without having to handle those includes and global variables. The UI is now a full AJAX interface that merely requires linking from the template to be enabled. Old tracker comments were converted and now tracker comments benefit from threaded comments, locking, archiving, moderation and all of the other features that are expected from comments.
</p>

<p>The new AJAX comment interface was also deployed everywhere object commenting was used. This transition allowed to clean up the old comments code that used to be shared between comments and forums (which still use the same database storage). From now on, comments.php and comments.tpl are only used for... forums. This should leave the code in a state that is much easier to understand and allow the forums to improve.
</p>

<p>However, the big change comes with the comments. They are powered by a micro-MVC framework with the common controller/action paradigm. It handles content negociation, so it will return JSON or HTML depending on what is requested. When HTML is required, it will use a template matching the controller and action to render the data that would otherwise be sent to the client as JSON. If the call is made outside of an AJAX request, it will even render the request using the tiki.tpl frame. Essentially, there is a full MVC hidden inside tiki-ajax_services.php.
</p>

<p>Even though the new AJAX interface appears to require JavaScript, it will work just fine without it as well. The user experience may be a step down from the previous one without JavaScript, but navigating without JavaScript is not really expected these days. As long as it works well enough for a crawler, it should be fine.
</p>

<p>Of course, this is still very early stage. The javascript side of it is still in flux. Initially written for comments only, it is expected to evolve to cover more general cases. Much refinements are also required in the user interface for comments and some features might still be left to be converted.
</p>

<p>What does this change?
</p>

<p>Much of the controller code that was traditionally in the PHP file is moving to controller classes where helper methods can be created. Each action becomes an independent entity, reducing the amount of dependencies between code and the initialization mess typically found. Each action also now gets its own template as well, and those templates are separated into different directories by convention. Less files in the main folders might help keeping new developers. We also get a JSON API for free, although it's not the defined kind of API that will stay stable across releases.
</p>

<p>The URLs are not pretty at this time. They would need rewrite rules if they get to be used significantly. The broker code can be called from other files at well. The set-up required is minor enough.
</p>

<p>Check it out in trunk:
</p>
<ul><li> lib/core/Services/Broker.php
</li><li> lib/core/Services/Comment/Controller.php
</li><li> templates/comment/*.tpl</li></ul>]]></summary>
    <published>2011-06-04T12:08:00+00:00</published>
    <updated>2011-06-04T12:08:00+00:00</updated>
    <link rel="alternate" type="text/html" href="https://dev.tiki.org/blogpost21-June-4-2C-Montreal"/>
    <id>https://dev.tiki.org/blogpost21-June-4-2C-Montreal</id>
  </entry>
  <entry>
    <title type="html"><![CDATA[April 27, Montreal]]></title>
    <summary type="html"><![CDATA[<p>Tiki8 is coming up with a few minor changes. The permission definitions were moved out of the database, allowing for easier maintenance and adding of new properties. The category permission screen no longer lists the global-only permissions and the object permission lists now also display additional permissions that can be applied to the object outside of the direct type. When making the permissions global, the correct list is also extracted, fixing long time issues with scope checking of permissions.
</p>

<p>The newest change is the introduction of a Signal/Slot type of mechanism to handle events within Tiki. It will allow to connect features through hooks rather than having to go directly in the code to check the feature and adding an extra call, leading to extremely long functions with sequential operations.
</p>

<p>As a side benefit, it will also allow customizers to plug in new behaviors without affecting the core, making it easier to contribute and to maintain, for those cases where the feature is too specific to be contributed back.
</p>

<p>So far, it has been partially deployed for wiki page update and creation. Much of the functionality in there still needs to be extracted, but the skeleton is in place. Events are organized in hierarchies, allowing for functionality that applies to all object types to be bound at a single location. For example, <code>$tikilib-&gt;update_page(...)</code> will trigger <strong>tiki.wiki.update</strong>, which chains to <strong>tiki.wiki.save</strong>, which chains to <strong>tiki.save</strong>. Each event can have multiple functions or methods bound to it.
</p>

<p>At this time, binding happens in a single location: <em>lib/setup/events.php</em>. This will change in the future to allow late event binding and speed up the setup process. However, since there is very little at this time, it's not much of an issue.
</p>

<p>From Admin &gt; Features &gt; Programmer, you can see a graphical representation of the events in the system, updated live as they are deployed. The graph engine used by transitions was refactored to reduce code duplication and can now be used with very few lines of code.</p>
]]></summary>
    <published>2011-04-27T15:47:00+00:00</published>
    <updated>2011-04-27T15:47:00+00:00</updated>
    <link rel="alternate" type="text/html" href="https://dev.tiki.org/blogpost20-April-27-2C-Montreal"/>
    <id>https://dev.tiki.org/blogpost20-April-27-2C-Montreal</id>
  </entry>
  <entry>
    <title type="html"><![CDATA[February 7th, Montreal]]></title>
    <summary type="html"><![CDATA[<p>Several features are still to be desired in file galleries. Among others, alternate storage engines, using file galleries for attachments across Tiki and customizable views may be desired. Some features are partially available, like uploading files to public locations to avoid the overhead of permission checking for files part of the site.
</p>

<p>In order to see what was possible and explore the current code, some low level refactoring was performed and included:
</p>
<ul><li> Conversion of simple SQL queries to helper functions
</li><li> Replacement of low level file access for higher level functionalities available in PHP5
</li><li> Extraction of common patterns to functions to remove duplication
</li><li> Extract file gallery related functions from tikilib
</li><li> Extract some logic from root PHP files to the libraries
<p>
</li></ul><br />These changes left the code in a substancially better condition, leaving the library at just over 3000 lines of code. However, the process highlighted several flaws:
</p>
<ul><li> Incorrect handling of file upload
<ul><li> Depending on which entry point is used, different validation and handling may be used
</li><li> File validation relies mostly on what is provided by the browser (mime type, extension) rather than inspecting the file
</li><li> Exceptions are hard-coded (and arbitrary) rather than configured
</li></ul></li><li> Lack of design
<ul><li> Some valid handling was coded for a narrow use case rather than being generalized.
</li><li> Confusion between view and storage
</li><li> Confusion between file and metadata
<p>
</li></ul></li></ul></p>
<h2 class="showhide_heading d-flex justify-content-start" id="Less_code_paths"> Less code&nbsp;paths<a href="#Less_code_paths" class="heading-link" aria-label="heading link"><span class="icon icon-link fas fa-link "   ></span></a></h2>
<p>These multiple factors lead to inconsistencies in how Tiki behaves, breaking user expectations. Cleaner rules are needed to identify which files are valid and where they should be stored. One of the major issues while refactoring was the widely duplicate condiitions to identify where podcast gallery files should be stored. While this is mostly resolved at this time, there are other cases where this occurs, and other conditions where it should.
</p>

<p>There are multiple entry points which are unavoidable and desired, including file upload, batch upload, attachment upload, webdav upload, batch import from directory, and such. Right now, each of those handles the full path to the storage. The initial refactoring brought some helpers to handle common parts, but the differences in handling could not be unified without breaking some existing behavior, no matter how wrong they are.
</p>

<p>The code needs to transition to a state where only the input is identified and then moved along to a single code path to handle validation:
</p>

<ol><li> Identify input as a wrapper
</li><li> Identify destination
</li><li> Collect file information (using <a class="wiki external" target="_blank" title="External link" href="http://ca.php.net/manual/en/ref.fileinfo.php" rel="external">fileinfo</a><img src="img/icons/green_question.png" alt="Question" width="16" height="16" name="link-external" title="Question" class="icon" /> when available)
</li><li> Perform validation
</li><li> Store the file and reference
</li><li> Store meta-data (Optionally)
</li><li> Post-processing
<ul><li> Fill missing meta-data (default names and such)
</li><li> Index content
</li><li> Handle various notifications, watches, ...
<p>
</li></ul></li></ol><br />This transition is a significant refactoring effort that will lead to some rules to some validation rules to change.
</p>

<h2 class="showhide_heading d-flex justify-content-start" id="Re-think_purposes"> Re-think purposes<a href="#Re-think_purposes" class="heading-link" aria-label="heading link"><span class="icon icon-link fas fa-link "   ></span></a></h2>
<p>File galleries serve multiple purposes at this time.
</p>
<ul><li> They define physical properties of the galleries such as the amount of files that can be contained, disk quotas, wether revision will be kept and depending on the gallery type, where files will be stored.
</li><li> They define view properties such as the thumbnail size, displayed information and templates.
</li><li> They serve as the primary purpose of navigation through the hierarchy, replicating a typical filesystem.
<p>
</li></ul><br />All of these concepts serve different users and could be maintained separately. By using categories as the means for organization and navigation, a regular filesystem could be replicated, except that files could naturally live in multiple locations to serve different navigation requirements. The user would simply select the desired view, like a thumbnail view, just like it is done in operating systems. These views could be configured by administrators, but would remain independent from the individual galleries.
</p>

<p>This would leave the physical properties to file galleries, leaving them as mere partitions determining where files are stored and the available capacity, a tool for administrators to handle system requirements. Files could be migrated between galleries over time without affecting the navigation. For example, old files that are not accessed frequently could be stored on a remote SAN with slower access times, but higher storage capacity. Public files could be stored directly in a gallery where the directory is web-accessible, avoiding the PHP overhead for images on the site. By detecting this at link creation, the correct link could be built when using the appropriate plugin.
</p>

<p>This model is a significant change from the current implementation and is not without migration challenges. One of the earliest changes that could be performed is around removing the view properties from the galleries and introducing a separate view concept.
</p>

<p>To combine with the effort to reduce the amount of code paths, the file gallery should probably optionally define a location to store files, removing this condition that is currently based on the file type.
</p>

<h2 class="showhide_heading d-flex justify-content-start" id="Just_files"> Just files<a href="#Just_files" class="heading-link" aria-label="heading link"><span class="icon icon-link fas fa-link "   ></span></a></h2>
<p>One aspect where different decisions in the code must be made is around all of the meta-data surrounding files. When uploading a single file, adding a name and description field comes in naturally, but when uploading multiple files are uploaded or files are uploaded without a form, those gaps are left empty and different behaviors may be used. More broadly, a user may question the very use of having a different name and a description. Once the content is indexed, those serve a much smaller purpose. Depending on the usage, alternate meta-data may be preferable altogether.
</p>

<p>The files should only contain the file relevant to the file itself. Other properties could be deferred to trackers, perhaps using specific values per file type.
</p>

<p>If tracker attachments were stored in file galleries and benefited from the complete indexing capabilities, the result with separated concerns would not be much different. Files that do not need meta-data could simply use file galleries, those that do would go through trackers. Some user interface could be added to attach meta-data to an existing file, essentially creating a new tracker item and automatically adding the attachment.
</p>

<p>Similarly, other attachments could be treated the same way. In order to make the attachments available through WebDAV, some category synchronization between the container object and the attachment would be required, or at least user interfaces to allow selecting them.
</p>
]]></summary>
    <published>2011-02-07T18:27:00+00:00</published>
    <updated>2011-02-07T18:27:00+00:00</updated>
    <link rel="alternate" type="text/html" href="https://dev.tiki.org/blogpost19-February-7th-2C-Montreal"/>
    <id>https://dev.tiki.org/blogpost19-February-7th-2C-Montreal</id>
  </entry>
  <entry>
    <title type="html"><![CDATA[January 17th, Montreal]]></title>
    <summary type="html"><![CDATA[<p>It is often criticized that the source code in Tiki is not object-oriented enough. There are several issues this brings up when adapting the code to new needs. Most of which are code duplication, inconsistency in behavior and growing functions with loosely coupled concepts. There have been multiple proposals in the past which resulted in little to no results. The following factors may be the cause:
</p>

<ol><li> Lack of involvement, multiple +1 but no actual actions taken
</li><li> Drastic changes required, effort needed is higher than what anyone can commit to
</li><li> Problem more complex than it appeared, implementation eventually abandoned
</li><li> Implementation essentially done, but not deployed all the way through and left unfinished, rotting into obsolescence
<p>
</li></ol><br />To this day, one of the most successful refactoring made in Tiki was the dynamic preferences even if it required a massive effort and extended over multiple releases (hello pkdille!). The reason that lead to success were:
</p>

<ul><li> Clear benefits to end users (consistency in UI, additional documentation, configuration search)
</li><li> Significant clean-up of the code making it easier for developers too
</li><li> Easy to understand and deploy
</li><li> Can be deployed gradually without causing drawbacks
<p>
</li></ul><br />Not all required changes are as easy to deploy and will have as a direct benefit to the end user, but it is almost guaranteed that changes that are purely aesthetic will fail to gain traction. Simply going 'object oriented' won't cut it. Design methods using object oriented are good, but not a holy grail or a goal to aim for. Great design patterns are built and described using object oriented features, but implementing a pattern is not an objective either. Desired properties and behaviors of the code must be identified, than a design can be selected.
</p>

<p>The classes used as function libraries are not a bad thing in themselves. TikiLib is an issue because it is too large and contains completely unrelated functions, but the other ones provide a good overview to what is available for a given feature. Something that is often crucially missing in well design object oriented libraries. The concept is entrenched in Tiki and thinking it will go away is wishful thinking.
</p>

<p>The problems lie within those libraries, not in their existence. Tiki should provide better utilities for developers than it does now, but going for a share parent class will only bring back to the same issues we have right now with TikiLib.
</p>

<p>There are a few common patterns in Tiki that lead to code smell. Targeting those patterns would lead to better code. It may be subtle, but work has begun a long time ago.
</p>

<ul><li> Listing functions in the libraries have a growing number of arguments. The ordering is only based on the evolution of the function itself. Multiple filters and formatting options appear and cause the hand-built SQL to be low-performing, hard to debug and generally unstable
</li><li> CRUD functionality is essentially composed of a hand-built SQL query. Depending on some preferences, the data may be altered or the operation may be prevented at all. After the actual update of the data, various other operations are performed, like updating indexes, user scores, backlinks, contributions and a whole series of other manipulations. Somewhere in the process, notifications are sent out.
</li><li> The PHP files in the Tiki root simply perform too much work and have no consistency on how tasks are performed.
<p>
</li></ul><br />The <a href="Unified-Index" title="" class="wiki wiki_page">Unified Search</a> project aims at the listing issue by providing a flexible search index interface allowing for  customizable output formatting and advanced filtering. The need for  these parameters will be scaled down as we move forward. Perhaps we can  begin to remove them.
</p>

<p>The SQL query  building part could easily be solved using database utility methods. It  would reduce the amount of errors made and simplify the code. It can  easily be deployed over time
</p>

<p>The  pre and post behavior could be triggered through the SignalSlot pattern, allowing external code to hook into the save process without affecting  the actual library. A data container could be sent around for the pre  hooks to allow them to alter the data or interrupt the chain altogether. The cross-feature behaviors could be registered only once and apply where needed.
</p>

<p>A drawback of this approach is that the code becomes harder to trace. As there are more dynamic bindings, knowing which pieces of code run becomes more of an issue. To mitigate this, the data container could contain a debug log for the different pieces of code to indicate that they ran and summarize what they did, allowing developers to look into what happened.
</p>

<p>Forms are always defined in template file. The PHP file then collects the input in a ad-hoc manner, converts the format into what is expected by the library (which is close to the database in most cases). The library then pushes the data to the database. Better facilities are required to collect the data from the request and in many case, the format taken by the library has to be standardized. Just like list functions, the order of the arguments is arbitrary in most cases.
</p>

<p>Tiki should provide functionality to support form validation, both on the PHP side and on the browser side. This could be done in a number of ways, but could be composed of form field configurations and smarty plugins to include within the forms. The additions should remain a toolkit rather than an obligation to allow for gradual deployment and preserve the flexibility.
</p>

<p>Preserving the environment is always an issue. Compatibility has to be maintained, expectations must be met. Developers have been used to flexibility in Tiki and any framework that constrains what can be done (remember Magic?) is likely not to gain support. The codebase is large and not everything can be done within a single release cycle.</p>
]]></summary>
    <published>2011-01-17T19:31:00+00:00</published>
    <updated>2011-01-17T19:31:00+00:00</updated>
    <link rel="alternate" type="text/html" href="https://dev.tiki.org/blogpost18-January-17th-2C-Montreal"/>
    <id>https://dev.tiki.org/blogpost18-January-17th-2C-Montreal</id>
  </entry>
</feed>
