For issues related to the current stable release please use it's own Help forum.
IMPORTANT:Please read this before using an git or nightly build version: wiki.webtrees.net/en/GIT

Before asking for help please read "How to request help" by clicking on that tab above here.

TOPIC: [SOLVED] webtrees 2.0.0-alpha.5: Empty Slide Show

webtrees 2.0.0-alpha.5: Empty Slide Show 2 months 1 week ago #1

  • dbq-andersons
  • dbq-andersons's Avatar
  • Offline
  • New
  • Posts: 41
Hi Everyone,

After upgrading from 2.0.0-alpha.4 to 2.0.0-alpha.5, my Slide show does not show any images (This family tree has no images to display). I tried dropping and re-adding it from the main page. I verified that media is present in other areas of the site.

This is what the database rows in wt2_media and wt2_media_file look like for an image that should definitely be appearing (it appears fine in the slideshow in my 2.0.0-alpha.4 site).
mysql> select * from wt2_media where m_id = 'X1';
+------+--------+-------------------------------------------------------------------------------------------------------------------------------+
| m_id | m_file | m_gedcom                                                                                                                      |
+------+--------+-------------------------------------------------------------------------------------------------------------------------------+
| X1   |      1 | 0 @X1@ OBJE
1 FILE images/william-anderson-2018.jpg
2 FORM jpg
2 TITL William Anderson 2018
1 _TYPE PHOTO
1 _SCBK Y
1 _PRIM Y |
+------+--------+-------------------------------------------------------------------------------------------------------------------------------+

mysql> select * from wt2_media_file where m_id = 'X1';
+-------+------+--------+----------------------------------+-------------------+-------------------+-------------------+
| id    | m_id | m_file | multimedia_file_refn             | multimedia_format | source_media_type | descriptive_title |
+-------+------+--------+----------------------------------+-------------------+-------------------+-------------------+
| 79945 | X1   |      1 | images/william-anderson-2018.jpg | jpg               |                   |                   |
+-------+------+--------+----------------------------------+-------------------+-------------------+-------------------+
1 row in set (0.00 sec)

mysql>

I took a look at the code in app/Module/SlideShowModule.php and the changes there since 2.0.0-alpha.4 zipped over my head pretty quickly. Appreciate any help in getting this working again.

Thanks,

Bill
Attachments:
Bill Anderson | Onalaska, WI | genealogy.dbq-andersons.com
Webtrees 1.7.14 | NGINX 1.14.0 | PHP 7.2.18-1 | MySQL 5.7.26
Ubuntu 16.04 LTS Running on a PC in My Basement
The administrator has disabled public write access.

webtrees 2.0.0-alpha.5: Empty Slide Show 2 months 1 week ago #2

  • dbq-andersons
  • dbq-andersons's Avatar
  • Offline
  • New
  • Posts: 41
Digging...

Looks like as of 2.0.0-alpha.5 the source_media_type needs to be populated in wt2_media_file. If I populate that field with "photo" for the image referenced in my examples, that image now shows up in the slide show.

Now to get my GEDCOM import to populate that (source_media_type) and the descriptive_title fields in wt2_media_file. Will keep digging through the import functions.

Thanks,

Bill
Bill Anderson | Onalaska, WI | genealogy.dbq-andersons.com
Webtrees 1.7.14 | NGINX 1.14.0 | PHP 7.2.18-1 | MySQL 5.7.26
Ubuntu 16.04 LTS Running on a PC in My Basement
Last Edit: 2 months 1 week ago by dbq-andersons.
The administrator has disabled public write access.

webtrees 2.0.0-alpha.5: Empty Slide Show 2 months 1 week ago #3

  • fisharebest
  • fisharebest's Avatar
  • Online
  • Administrator
  • Posts: 11055
The issue is the "TYPE" field.

0 @X1@ OBJE
1 FILE images/william-anderson-2018.jpg
2 FORM jpg
3 TYPE photo                                              <--- GEDCOM expects this
2 TITL William Anderson 2018
1 _TYPE PHOTO                                             <---- You have this

Other applications generate many variations of this structure, so webtrees will ignore the level/hierarchy and just look for the tag at any level. So, it would accpt "3 TYPE", "2 TYPE" or "1 TYPE".

It should be straightforward to search for _TYPE when TYPE is missing. What program generated this GEDCOM?
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

webtrees 2.0.0-alpha.5: Empty Slide Show 2 months 1 week ago #4

  • dbq-andersons
  • dbq-andersons's Avatar
  • Offline
  • New
  • Posts: 41
Hi Greg,

Thanks as always for the help/guidance. You're a life saver.

I'll answer your last question/comment first. This GEDCOM is coming out of RootsMagic 7. This isn't the first time I've needed your help in massaging things for RM7 GEDCOMs.

Second, I ran a mass replace of _TYPE -> TYPE through the GEDCOM before importing (and lower-cased the PHOTO because I'm paranoid) and while the m_gedcom field in wt2_media picked up the change (see code below), the source _media_type in wt2_media_file is still blank (as is the descriptive_title field in wt2_media_file).
0 @X1@ OBJE
1 FILE images/william-anderson-2018.jpg
2 FORM jpg
2 TITL William Anderson 2018
1 TYPE photo
1 _SCBK Y
1 _PRIM Y

I'll keep digging as well and see what I can come up with.

Thanks,

Bill
Bill Anderson | Onalaska, WI | genealogy.dbq-andersons.com
Webtrees 1.7.14 | NGINX 1.14.0 | PHP 7.2.18-1 | MySQL 5.7.26
Ubuntu 16.04 LTS Running on a PC in My Basement
The administrator has disabled public write access.

webtrees 2.0.0-alpha.5: Empty Slide Show 2 months 1 week ago #5

  • dbq-andersons
  • dbq-andersons's Avatar
  • Offline
  • New
  • Posts: 41
Progress! (I think)

I got the descriptive_title field to import by replacing this line (line 1064) in FunctionsImport.php

1064                     'descriptive_title'    => mb_substr($media_file->title(), 248),

with

1064                     'descriptive_title'    => mb_substr($media_file->title(), 0, 248),

Still working on the source_media_type field. The function that feeds that data (media_file->$type) returns no data. Still not sure why.

Will keep digging and advise as I find things. Once I figure everything out, I'll submit a bug fix request.

Bill
Bill Anderson | Onalaska, WI | genealogy.dbq-andersons.com
Webtrees 1.7.14 | NGINX 1.14.0 | PHP 7.2.18-1 | MySQL 5.7.26
Ubuntu 16.04 LTS Running on a PC in My Basement
The administrator has disabled public write access.

webtrees 2.0.0-alpha.5: Empty Slide Show 2 months 1 week ago #6

  • fisharebest
  • fisharebest's Avatar
  • Online
  • Administrator
  • Posts: 11055
> by replacing this line (line 1064) in FunctionsImport.php

Good spot. Thanks.
FYI, the line above has the same problem. Both fixed in the latest code.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

webtrees 2.0.0-alpha.5: Empty Slide Show 2 months 1 week ago #7

  • dbq-andersons
  • dbq-andersons's Avatar
  • Offline
  • New
  • Posts: 41
Thanks for the fix, Greg.

As for my continuing problem with the media type, I think I'm zeroing in. In app/MediaFile.php, the $gedcom variable that gets fed into the "__construct" function starting on line 82 only contains the FILE, FORM, and TITL information

1 FILE images/william-anderson-2018.jpg 2 FORM JPG 2 TITL William Anderson 2018

Thus, the if statement on lines 96-98 of app/MediaFile.php doesn't find TYPE and therefore does not populate the result for kick back into app/Functions/FunctionsImport.php at line 1063.

I'm still digging to figure out how that $gedcom variable gets populated and see what I need to tweak in my GEDCOM so it gets populated correctly.

Bill
Bill Anderson | Onalaska, WI | genealogy.dbq-andersons.com
Webtrees 1.7.14 | NGINX 1.14.0 | PHP 7.2.18-1 | MySQL 5.7.26
Ubuntu 16.04 LTS Running on a PC in My Basement
The administrator has disabled public write access.

webtrees 2.0.0-alpha.5: Empty Slide Show 2 months 1 week ago #8

  • fisharebest
  • fisharebest's Avatar
  • Online
  • Administrator
  • Posts: 11055
Try changing "1 TYPE" to "2 TYPE", so that it is a child of the "1 FILE".

Media objects can contain more than one media file - and the type needs to apply to a FILE, not to the OBJE.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.
Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 

webtrees 2.0.0-alpha.5: Empty Slide Show 2 months 1 week ago #9

  • dbq-andersons
  • dbq-andersons's Avatar
  • Offline
  • New
  • Posts: 41
That did it. As long as I change the TYPE to be a child of the FILE, things import with no issues and the slide show works.

Thanks as always for the help.

Cheers!

Bill
Bill Anderson | Onalaska, WI | genealogy.dbq-andersons.com
Webtrees 1.7.14 | NGINX 1.14.0 | PHP 7.2.18-1 | MySQL 5.7.26
Ubuntu 16.04 LTS Running on a PC in My Basement
The administrator has disabled public write access.

[SOLVED] webtrees 2.0.0-alpha.5: Empty Slide Show 2 months 1 week ago #10

  • dbq-andersons
  • dbq-andersons's Avatar
  • Offline
  • New
  • Posts: 41
Problem solved.
Bill Anderson | Onalaska, WI | genealogy.dbq-andersons.com
Webtrees 1.7.14 | NGINX 1.14.0 | PHP 7.2.18-1 | MySQL 5.7.26
Ubuntu 16.04 LTS Running on a PC in My Basement
The administrator has disabled public write access.
Powered by Kunena Forum