fisharebest / webtrees

Online genealogy
https://webtrees.net
GNU General Public License v3.0
468 stars 300 forks source link

2.0: Location Import from Server-located File Throwing Errors #1901

Closed dbq-andersons closed 6 years ago

dbq-andersons commented 6 years ago

Looking to import coordinates from a file on my server. Same file works fine when directly uploaded from PC. Clicking Continue throws this error in the browser:

This page isn’t working www.dbq-andersons.com is currently unable to handle this request. HTTP ERROR 500

Also throws these errors in the php_error.log:

[13-Sep-2018 15:13:54 UTC] PHP Fatal error: Uncaught Error: Wrong parameters for Exception([string $message [, long $code [, Throwable $previous = NULL]]]) in /tools/webdocs/genealogy/webtrees-alpha/app/Http/Controllers/AdminLocationController.php:466 Stack trace:

0 /tools/webdocs/genealogy/webtrees-alpha/app/Http/Controllers/AdminLocationController.php(466): Exception->__construct('Unable to open ...', '/tools/webdocs/...')

1 [internal function]: Fisharebest\Webtrees\Http\Controllers\AdminLocationController->importLocationsAction(Object(Symfony\Component\HttpFoundation\Request))

2 /tools/webdocs/genealogy/webtrees-alpha/app/Resolver.php(85): ReflectionMethod->invoke(Object(Fisharebest\Webtrees\Http\Controllers\AdminLocationController), Object(Symfony\Component\HttpFoundation\Request))

3 /tools/webdocs/genealogy/webtrees-alpha/index.php(324): Fisharebest\Webtrees\Resolver->dispatch(Object(Fisharebest\Webtrees\Http\Controllers\AdminLocationController), 'importLocations...')

4 /tools/webdocs/genealogy/webtrees-alpha/app/Http/Middleware/CheckForMaint in /tools/webdocs/genealogy/webtrees-alpha/app/Http/Controllers/AdminLocationController.php on line 466

Looking at what the file selection dropdown is doing (see attached screenshot) and wondering if it's appending the full path of the file to the full path of the source directory. Not my code and I'm a dabbler in PHP at best so I am probably way off base.

webtrees2-coord-import-error-1

Thanks,

Bill Anderson

dbq-andersons commented 6 years ago

Just making sure someone sees that the fix has a typo in it.

return substr($place, strlen(WT_DATA_DIR . 'plcaes/'));

Thanks,

Bill

fisharebest commented 6 years ago

FYI, the typo was fixed in https://github.com/fisharebest/webtrees/commit/af1fd6eb9003fb61b452a55c40d4ae9ac94104a7