Jump to content
TNG Community

SOLVED:Unused Media mod 15.0.2.0 issues with website version but not locally


Philip Roy

Recommended Posts

Philip Roy

https://tng.lythgoes.net/wiki/index.php?title=Unused_Media

TNG version 15.0.2. The issue is only happening on my online site and not my local site on my Mac...which is what is confusing me. The settings for the mod are the same for both installs.

I thought this was possibly a PHP issue as my online website is running PHP v8.4.7 and my local copy of TNG is running under v8.3.14. But I changed my site to v8.3.21 (the only 8.3 option that was available to me) and the issue continued.

You can see the problem from the image that I have attached. The Unused Media mod is not only displaying a lot of non-media files, it seems to be going through every folder on my site.

I uninstalled the mod and reinstalled it. I also uploaded a complete clean copy of every TNG site file and reapplied my mods...but no luck.

I then looked at the files that the mod creates and I found 3 in the extensions folder...unused_media_folder_list.php, unusedmedia.txt and unusedmediatemp.txt. The PHP file locally was considerably shorter (354 lines) than the one online (969 lines).

I deleted the online one and allowed the mod to recreate it, but again, same big number (969) of lines in the PHP file online. I note that even the start of the files differ.

Here's the start of the local version of the unused_media_folder_list.php file...

<?php
// Unused Media folder list
$d = array();
$d[0] = "documents";
$d[1] = "documents/books";
$d[2] = "documents/census";
$d[3] = "documents/certificates";
$d[4] = "documents/certificates/Birth";
$d[5] = "documents/certificates/Christening-Baptism";
$d[6] = "documents/certificates/Death";
$d[7] = "documents/certificates/Marriage";
$d[8] = "documents/certificates/War-Graves";
$d[9] = "documents/correspondence";
$d[10] = "documents/journals";

And here's the online unused_media_folder_list.php...

<?php
// Unused Media folder list
$d = array();
$d[0] = "";
$d[1] = "/admin";
$d[2] = "/backups";
$d[3] = "/classes";
$d[4] = "/css";
$d[5] = "/documents";
$d[6] = "/documents/books";
$d[7] = "/documents/census";
$d[8] = "/documents/certificates";
$d[9] = "/documents/certificates/Birth";
$d[10] = "/documents/certificates/Christening-Baptism";
$d[11] = "/documents/certificates/Death";
$d[12] = "/documents/certificates/Marriage";
$d[13] = "/documents/certificates/War-Graves";
$d[14] = "/documents/correspondence";
$d[15] = "/documents/journals";

It's adding in folders that I can't understand why? I can't figure out what is going on or what I have done wrong?

Screenshot 2025-05-23 at 2.23.55 PM.png

Link to comment
Share on other sites

Philip Roy

Here are the settings for the mod. I know I could go in and exclude CSS files etc, but I feel like something else is going on, as I have never had to do that before.

Screenshot 2025-05-23 at 2.59.10 PM.png

Link to comment
Share on other sites

Philip

Have selected Show Excluded Files on the Media/Unused Media tab on local copy?

image.png

Link to comment
Share on other sites

Warren S GILBERT

Hi Philip,

The mod builds a list of folders to check by starting from values defined in config.php - see Admin > Setup > General Settings > Paths and Folders

    Photo Folder
    Document Folder
    History Folder
    Headstone Folder
    Multimedia Folder

My guess is that one or more of these is not defined on your site.

After those folders, it then continues by adding the folders defined in the mediatypes table.

Perhaps the mod should check for empty fields in config.php - I am working on an update to the mod, so I will look at that.

Warren Gilbert

Link to comment
Share on other sites

Philip Roy

Thanks. Had already checked that (see attached image and I have masked my hidden folders). It’s late here, but I’ll check the config file tomorrow in case something odd is in that file, but as the admin setting isn’t displaying issues, I’m not sure what the problem might be.

FYI…all my folders that I use align with my Mac-based Reunion software install (sorry, just can’t remember if Photos is what TNG uses by default). My site is always updated via a GEDCOM import from Reunion to TNG.

IMG_4741.jpeg

Link to comment
Share on other sites

Warren S GILBERT

Hi Philip,

To get the result you are seeing, the mod must be getting a blank path from somewhere.

It seems you have eliminated config.php, so the only other place is the mediatypes table.

It's interesting to note that in your web version, the names of the folders you show ALL have a leading '/'.

I have experimented using phpMyAdmin, adding a fake mediatypeID to the mediatypes table, with a blank path name, and disabled set to 0.

It gives me similar results to your web version.

If your mediatypes table has a row where mediatypeID is not one of 'photos', 'documents', 'headstones', 'histories', 'recordings', or 'videos' AND disabled = 0, AND path = '', then that would cause the problem.

Warren Gilbert

Link to comment
Share on other sites

  • Philip Roy changed the title to SOLVED:Unused Media mod 15.0.2.0 issues with website version but not locally
Philip Roy

Oh you're a genius, thank you! I went into phpMyAdmin on my live site and looked at the mediatypes table and found a stray entry from when I was playing about and trying something (shame on me for doing that on my live site). Deleted the entry and all is good! Thank you so much.

Screenshot 2025-05-25 at 12.38.21 PM.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...