TYPO3-metaseo icon indicating copy to clipboard operation
TYPO3-metaseo copied to clipboard

Sitemap...Task uses wrong path to write sitemap_txt and sitemap_xml

Open tgaertner opened this issue 6 years ago • 5 comments

MetaSEO version: *

TYPO3 version: *

PHP version: *

Don't get it, why could this ever worked...???

The Scheduler/Task/SitemapTxtTask.php and .../SitemapXmlTask.php create pathes like this:

PATH_site . '/' . $this->sitemapDir

PAH_site is by definition "Absolute path of the document root of the instance with trailing slash" so the path will be always something like

path/to/webroot//uploads/tx_metaseo/sitemap_xml with 2 slashes!

I get axacly this error message in Scheduler Task Ausführung fehlgeschlagen: 0, DirectoryIterator::__construct(/html/htdocs/web//uploads/tx_metaseo/sitemap_xml): failed to open dir: No such file or directory"

I checked the core back up to 6.2 - it has not changed I checked metaseo extension coded - it has also not changed since all versions available on github. So where is the mistake??

Normally I would say the part has to be changed to PATH_site . $this->sitemapDir

Greetings Tobi

tgaertner avatar Mar 20 '18 10:03 tgaertner

I think it works most of the time because the underlaying environment does not care about double slashes - don't know if its PHP or the system in that case. I have the problem currently with PHP 7.1 but have not tested others jet.

Anyway, I think this should be fixed.

tgaertner avatar Mar 26 '18 09:03 tgaertner

I opend a pull request on this: https://github.com/webdevops/TYPO3-metaseo/pull/519

tgaertner avatar Mar 27 '18 06:03 tgaertner

Well actually this was not the problem :-) The main Problem was that the upload folder is not created automatically + if I create it I get the error-msg "No TypoScript Template found" but ist included and all other stuff from the extension works - excapt the scheduler tasks to create real sitemaps. So this part is not working in version 3 jet. (My PullRequest could be applied anyway for it increases code-quality imo)

tgaertner avatar Mar 27 '18 08:03 tgaertner

Is your PR supposed to fix the latter?

excapt the scheduler tasks to create real sitemaps. So this part is not working in version 3 jet.

Please give us exact version information: TYPO3, metaseo (I assume 3.0.0), PHP and realurl version

thomaszbz avatar Mar 27 '18 10:03 thomaszbz

TYPO3 8.7.10 / 8.7.12 metaseo 3.0.0 PHP 7.1.9

tgaertner avatar Mar 27 '18 11:03 tgaertner