bobosch / ods_osm

TYPO3 Extension OpenStreetMap
10 stars 22 forks source link

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath is deprecated #49

Closed claude27 closed 4 years ago

claude27 commented 4 years ago

The function \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath is deprecated. e.g. used in Classes/Provider/Leaflet.php, line 145.

Additionally I have the problem, that I get src links like http://www.domain.de/link-to-page/typo3conf/ext/ods_osm/Resources/Public/leaflet-gpx/pin-icon-start.png, because a "/" is missing in the source link.

albig commented 4 years ago

Thank you @claude27. Could you please test the PR #50? This contains the replacement of siteRelPath().

What do you do exactly? What site-configuration do you have? Do you set config.absRefPrefix?

claude27 commented 4 years ago

Thank you @albig for your fast response! I will soon test the PR #50. No I didn't set conffig.absRefPrefix. I have the following site configuration: TYPO3 9.5.15, Multi Domain installation base: 'https://www.xxx.de' disableStaticFileCache: false errorHandling:

errorCode: '404'
errorHandler: Page
errorContentSource: 't3://page?uid=435'

rootPageId: 1 languages:

title: Deutsch
enabled: true
base: /
typo3Language: de
locale: de_DE.UTF-8
iso-639-1: de
navigationTitle: Deutsch
hreflang: de-DE
direction: ltr
flag: de
languageId: '0'

routeEnhancers: PageTypeSuffix: type: PageType default: / suffix: / index: '' map: /: 0 rss.xml: 9818 rss2.xml: 151 banners.html: 9001 bannerclick.html: 9002 powermail_cond.json: 3132

claude27 commented 4 years ago

I tested #50 now. Yes, it's working. Thank you! Beside that, the icons within the leaflet view don't show up. I solved it with setting $path = $GLOBALS['TSFE']->absRefPrefix . PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath('ods_osm')) . 'Resources/Public/'; in Leaflet.php, line 148. I don't know if this is the best solution?

albig commented 4 years ago

$GLOBALS['TSFE']->absRefPrefix seems to be always '/' now. At least in yours and my setup. In https://github.com/bobosch/ods_osm/blob/master/Classes/Provider/Leaflet.php#L145 this is not respected but on other places it is. So I think, you "fix" is completely right. Please pull the #50 again and have a look.

claude27 commented 4 years ago

Thank you @albig I tested the #50 again, it works!