Loading...
 
Features / Usability

Features / Usability


Can Tiki delete orphaned file gallery objects?

posts: 15

Still using Tiki 15.
Moving soon into 18 and then the next LTS (I don't get why there is a 2024 LTS version).
Is there any function that can find and remove all file gallery objects that are never used on any wiki/article/page?
In the adminlib class, there is an old "remove_orphan_images" which does the job for the old system "images", so it is now useless.

posts: 3665 United States

You could maybe use the Backlinks column in the File gallery listing to see if the file is being used directly, but I don't think that will find things such as:

  • Manually linked files
  • Dynamically linked files (e.g., LIST plugin)
  • Files referenced in templates

There's probably even more.

HTH,

- Rick | My Tiki Blog | My Tiki UserPage

Why be a dummy? Get smarty! TikiForSmarties.com
Tiki for Smarties, your source for the best (and only) Tiki books, guides, and tutorials.

posts: 126886 United Kingdom
As i understood it @Bernard Sfez / Tiki Specialist, that command checks that the files on the filesystem match up with files in the database (in the file galleries) rather than where those files are used, but it's still a handy management tool, so definitely handy! mrgreen

posts: 1633 Canada
Enorazza wrote:

Still using Tiki 15.
Moving soon into 18 and then the next LTS (I don't get why there is a 2024 LTS version).


There is no 2024 LTS. This is how it works: Lifecycle

You can go directly from 15 LTS to 24 LTS. Install a 24x and point it to a copy of your 15x database. And during the installation, the upgrade script will handle all the database schema changes. In fact, you can upgrade like this from really old versions like Tiki2. Ref: https://gitlab.com/tikiwiki/tiki/-/tree/24.x/installer/schema

Enorazza wrote:
Is there any function that can find and remove all file gallery objects that are never used on any wiki/article/page?


No. That is tricky to do reliably because people can use various syntaxes to show images. Like PluginHTML, PluginIMG, etc.

posts: 126886 United Kingdom

Thanks @Marc Laporte

re
Marc Laporte wrote:
...Install a 24x and point it to a copy of your 15x database...


Yes, but obviously, keep a (provably restorable) backup of the data base first!

Good luck! cool


posts: 1 Ireland
Enorazza wrote:

Still using Tiki 15.
Moving soon into 18 and then the next LTS (I don't get why there is a 2024 LTS version).
Is there any function that can find and remove all file gallery objects that are never used on any wiki/article/page?
In the adminlib class, there is an old "remove_orphan_images" which does the job for the old system "images", so it is now useless.

Why not just install MySQL WorkBench, attach to your database and view the tables and columns that way to see what is linked and what it not.
Short list the orphan with an SQL script and then delete them.