Keep media object


One of the most common problems when importing a GEDCOM file into kiwitrees is enabling the “Keep media objects” option. In fact this should almost never (less than 1% of times) be used. It exists only for a very specific group of users.

The result of enabling this option when you don’t require it is that all your media items will no longer be connected to any records (individuals, families, sources etc.) in your tree.

What is a “media object”?

A media object is the reference in a GEDCOM file to a specific media item or file such as an image, a PDF, or video etc.. In the GEDCOM file it will look like this:

0 @M1001@ OBJE
1 FILE grandfather.png
2 FORM
3 TYPE photo

Also in the GEDCOM data are “media links”. These are references like this:

2 OBJE @M1001@

They tell kiwitrees that this media object (M1001) is linked to this individual or other type of record.

Who are the “very specific group of users”?

Some family history software does not support, and actually deletes media objects, like the one above, from any GEDCOM file use. That used to be fairly common, but is less so today.

Kiwitrees tries to cater for users of most other software products, and allow import / export between them so the “Keep media objects” option is maintained to help users of such software, and ONLY them.

What does enabling “Keep media objects” actually do?

When you import a new, or replacement GEDCOM file into an existing tree the first step is always to delete all the existing GEDCOM data for that tree from your database. That is why, when you start the import routine there is a delay before your computer starts actual importing.

“All existing data” means everything directly related to the GEDCOM file, so all individual, family, source, note, and media records, as well as a few related tables such as the “changes” log and links between records. It is the same process as just deleting that tree from your system. It doesn’t delete files or non-GEDCOM related data. So your media items (files) themselves always remain.

Then the import process starts, taking all the information from the new GEDCOM file and transferring it to the appropriate tables in your database, including re-creating all links between records.

So, if the family history software you used to create that new GEDCOM file changed, or removed the media objects, there is nothing left to tell kiwitrees what items link to which records, so no media can be connected.

By enabling the “Keep media objects” option, when the new GEDCOM file is imported kiwitrees does NOT remove the existing media links, the import process uses those links to recreate the correct media object (that the other software remove or changed), so that the correct connections are re-instated.

What happens if I mistakenly enable “Keep media objects” when I don’t need to?

Because the “Keep media objects” setting tells kiwitrees the incoming GEDCOM file has no media objects, it knows NOT to create any media links. so no attempt is made to re-connect your media file to your data. So you end up with no media being displayed.

Is there a way to fix the issue if I mistakenly used the “Keep media objects” option?

Yes, and it’s quite simple. Just run the import again, using the same GEDCOM file, but without setting the “Keep media objects” option. It will now delete the links, and then accurately recreate them for the GEDCOM media objects it contains, as it should.

Blank page or a “500” error

A blank page indicates that two things happened:

  • A fatal error occured while creating the web page.
  • Your web-server (e.g. apache, nginx, IIS) is configured not to display fatal errors on the screen.

Typical causes of fatal errors are:

  • File permissions. webtrees needs to be able to write to all the files and subfolders in the folder /data/
  • Running out of disk space. You can check if this is a problem by uploading (and then deleting) a large file to the server using FTP.
  • Running out of CPU time. You can identify these because the error does not appear until the time limit is reached.
  • Running out of memory. This can be caused by program errors or by trying to process a lot of data at once. For example, trying to list many thousand individuals at the same time.
  • Incompatible software. For example, using PHP 7.3 with software that was designed for PHP 7.4.
  • Trying to use a PHP function that has been blocked by your web-host. For example, the function needed to send mail can be blocked.

Generally when a fatal error occurs, the web-server will write a detailed error message to a log file. You need to find this error log. Without it, it will be very difficult to fix the problem.

Note that your web-server will produce two log files. One is the access log and the other is the error log. You want the error log.

If you cannot find your error log, you should contact your webhosting provider for assistance.

Alternatively, if your server uses .htaccess files, try adding the following lines:

php_flag display_errors on
php_flag display_startup_errors on
php_value error_reporting -1

ERROR 2: ini_set() has been disabled for security reasons

Disabling ini_set() is not uncommon on some shared servers, but not truly necessary in kiwitrees. It is used in various places to enable admins (only) to adjust things like php memory and time-out settings among others. This error usually appears at the final step of the kiwitrees setup process.

If you web host provides a management tool such as cPanel you can enable functions like this.

Look where you set or change the version of PHP (PHP -> Select version) and then under version what plugins to enable. Then Under “Options” find “disable functions”. Remove ini_set from that disabled functions list.

How do I clear my browser cache?

What exactly is cache?

Your browser’s cache, pronounced cash, is a collection of web pages stored on your hard drive or in your phone/tablet storage. The cache includes the text, images, and most other media contained on web pages that you’ve visited.

Having a local copy of a web page makes for quick loading on your next visit because your computer or mobile device doesn’t have to download it from the internet again. Over time, however, the cache may take up a big chunk of your computer’s storage.

Why do you have to clear cache?

You don’t have to clear the cache as a regular part of computer or smartphone maintenance. However, there are some good reasons to clear cache:

Clearing your cache forces your browser to retrieve the newest copy available from the website, something that should happen automatically but sometimes does not.
You’re experiencing issues such as 404 errors or 502 errors (among others) that may indicate your browser’s cache is corrupted.
Malware is another reason to delete the browser cache. It can be dropped in the cache without you knowing or alongside program installations, so clearing the entire cache can delete malicious files. (It also helps to have antivirus software.)
Another reason to delete browser cache data is to free up space on your hard drive. Over time, the cache can grow to a huge size; clearing it can recover some of that previously used space.

Basic process to clear your cache.

  • Clearing cache can fix some browsing problems, free up space, and remove saved versions of visited pages for privacy reasons.
  • Most browsers let you clear cache quickly via Ctrl+Shift+Del (Windows) or Command+Shift+Delete (Mac).
  • Otherwise, try your browser’s Settings, Privacy, or Advanced options.

Specifics for different browsers and operating systems.

There are many different web browser / operating system combinations. Far too many to maintain a detailed explanation for how to clear caches for every one here. Instead, below are a few links to other sites that specialise in such information that might help you:

  1. RefreshYourCache.com
  2. Kinsta – How to Clear Cache for All Major Browsers
  3. Lifewire – How to Clear Internet Cache in Every Major Browser
  4. DigitalTrends – How to clear your browser cache

Unable to create thumbnails

Creating thumbnail images requires three things: a PHP graphics extension; sufficient memory on your server; and sufficient CPU power and/or time to allow the process to complete. You can check these using information shown on your kiwitrees page Administration > Site administration > Server information.

PHP graphics extension

Kiwitrees uses the “GD” graphics extension in PHP. Your server information should therefore list GD, and show it as GD support = enabled.

For gd, your server information should include a section for GD, with an entry of “GD support = enabled”.

Sufficient memory

To process an image from full size to thumbnail, GD requires memory of 4 bytes-per-pixel. An image that is 5000×4000 pixels will require 5000×4000×4 = 80MB (GD). In addition, the rest of the script requires approximately 20MB. So generating a thumbnail of a 5000×4000 pixel image will require at least 100MB. Your server’s “memory_limit” must be set to a figure higher than that.

 CPU power and/or time

Image manipulation requires a lot of server resources. If you have very large images, and low memory limits, then you will need to arrange, perhaps with your web host, to increase any limits on these..

There are no spaces between the given names and surnames

This is caused by the software that created your GEDCOM file.

It will have created names formatted as 1 NAME John Paul/Smith/ instead of 1 NAME John Paul /Smith/.

It would not be universally correct for kiwitrees to automatically add spaces because some languages (e.g. Chinese) do not use spaces between words or names.

But kiwitrees can insert insert these spaces for you. Go to Administration > Tools > Batch update and select the option “Fix name slashes and spaces”. If the tool finds any names that can be changed in this way it will display the first. You can choose to update these one at a time (being very cautious) or simply change all of them at once (being very confident).

CAUTION
As with most of the tools in the Batch Update suite, you should take a back-up copy of your latest GEDCOM file before proceeding.

I forgot my password and can’t log in

There are several ways to reset your password.

  1. Is there another kiwitrees administrator on your site?
    Ask them to reset your password from the kiwitrees control panel.
  2. Is your server configured to send an email?
    The login page has a “Request new password” link. It will send a new password to you by email.
  3. Can you access your database? (e.g. using PhpMyAdmin)
    Find the table kt_user and the row for your user account. Set the password field to the value $1$VDnz7rNf$nDgfF52rgdz89uTSJ1sa41. This is the encrypted form of the text “password”.
  4. Can you access the files on your webserver? (e.g. using FTP / SFTP)
    Create a text file called password.php with the following content. Copy it to the kiwitrees folder on your server. Replace each occurrence of XXXXX as appropriate.
<?php
// These are your database connection settings.
// You can find them on your server in the file data/config.ini.php


$DBHOST = 'XXXXX';
$DBPORT = 'XXXXX';
$DBNAME = 'XXXXX';
$DBUSER = 'XXXXX';
$DBPASS = 'XXXXX';
$TBLPFX = 'XXXXX';
// This is the email address of the account you want to change
$EMAIL = 'XXXXX';

// This is the new password
$PASSWD = 'XXXXX';

$pdo = new PDO(
(substr($DBHOST, 0, 1) === '/' ?
"mysql:unix_socket={$DBHOST};dbname={$DBNAME}" :
"mysql:host={$DBHOST};dbname={$DBNAME};port={$DBPORT}"
), $DBUSER, $DBPASS);
$sql = 'UPDATE `' . $TBLPFX . 'user` SET password = :password WHERE email = :email';
$stmt = $pdo-&gt;prepare($sql);
$stmt->execute(array('password' => crypt($PASSWD, ''), 'email' => $EMAIL));
if ($stmt->rowCount() > 0) {
echo 'SUCCESS - The user account was updated.';
} else {
  echo 'ERROR - The user account was not found or not updated.';
}

Copy the file to the web-server and run it by typing the URL into your browser. e.g. http://your-site.com/path-to-kiwitrees/password.php