[Gelöst] XML-Sitemap-Generierung: Fehlermeldung

am 05.11.2012 - 12:04 Uhr in
Hallo
Nach der Installation des Moduls XML-Sitemap u. des DB-Updates wird man im Statusbericht aufgefordert einen Cron-Lauf durchzuführen um die Map zu erzeugen.
"XML sitemap Cached files have not been generated yet.
The XML cached files are out of date and need to be regenerated. You can run cron manually to regenerate the sitemap files."
Das funktioniert bei mir leider nicht. Stattdessen erscheint die Fehlermeldung:
Fatal error: Uncaught exception 'XMLSitemapGenerationException' with message
'Could not open file xmlsitemap/NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM/1.xml
for writing.' in
E:\xampp\htdocs\events\sites\all\modules\xmlsitemap\xmlsitemap.xmlsitemap.inc:47
Stack trace: #0
E:\xampp\htdocs\events\sites\all\modules\xmlsitemap\xmlsitemap.xmlsitemap.inc(36)
: XMLSitemapWriter->openUri('xmlsitemap/NXhs...') #1
E:\xampp\htdocs\events\sites\all\modules\xmlsitemap\xmlsitemap.generate.inc(152):
XMLSitemapWriter->__construct(Object(stdClass), 1) #2
E:\xampp\htdocs\events\sites\all\modules\xmlsitemap\xmlsitemap.generate.inc(338):
xmlsitemap_generate_page(Object(stdClass), 1) #3 [internal function]:
xmlsitemap_regenerate_batch_generate('NXhscRe0440PFpI...', Array) #4
E:\xampp\htdocs\events\includes\batch.inc(189):
call_user_func_array('xmlsitemap_rege...', Array) #5
E:\xampp\htdocs\events\includes\form.inc(2555): _batch_process() #6
E:\xampp\htdocs\events\sites\all\modules\xmlsitemap\xmlsitemap.module(1436):
batch_process() #7 E:\xampp in
E:\xampp\htdocs\events\sites\all\modules\xmlsitemap\xmlsitemap.xmlsitemap.inc on
line 47
Auch die Löschung des Caches (Einstellungen/Leistung + flush all Caches) und des
Inhaltes in sites/all/default/files/xmlsitemap/ wie hier im Forum empfohlen bringt leider nichts.
Hat jemand damit Erfahrung? Lässt sich das irgendwie beheben?
Danke schon mal im Voraus.
LG
Robert
- Anmelden oder Registrieren um Kommentare zu schreiben
Schau mal hier unter #4 gib
am 05.11.2012 - 12:33 Uhr
Schau mal hier: http://drupal.org/node/1219218 unter #4 gibt es einen Patch dafür
Danke für die Hilfe. Wie kann
am 05.11.2012 - 13:55 Uhr
Danke für die Hilfe.
Wie kann ich diesen Batch in die Datei xmlsitemap.xmlsitemap.inc implementieren?
Meine PHP-Kenntnisse sind eher begrenzt..
Ich nehme an die Funktion 'public function openUri($uri)' ist zu ersetzen?
Wie weit? bis zu
array('@file' => $uri)));
}
return $return;
} //??
Der 1. Batch-Absatz scheint eine Anweisung zu sein, die mit Ausnahme des Dateinamen für mich rätselhaft ist.
Batch- und Datei-Code siehe bitte unten.
LG
Robert
BATCH-Code:
diff --git a/xmlsitemap.xmlsitemap.inc b/xmlsitemap.xmlsitemap.inc
index 0ea1bb7..fd30924 100644
--- a/xmlsitemap.xmlsitemap.inc
+++ b/xmlsitemap.xmlsitemap.inc
@@ -37,6 +37,12 @@ class XMLSitemapWriter extends XMLWriter {
}
public function openUri($uri) {
+ // If download method is set to 'public', we find the absolute path
+ // of Drupal's root, so that realpath() won't return FALSE
+ if (variable_get('file_downloads', '1') == '1') {
+ $uri = realpath('.') . '/' . $uri;
+ }
+
if ($realpath = realpath($uri)) {
// Convert to a real path if possible. Sometimes this function returns
// a FALSE value, so use the original value when that happens.
Datei-Code:
public function openUri($uri) {
if ($realpath = realpath($uri)) {
// Convert to a real path if possible. Sometimes this function returns
// a FALSE value, so use the original value when that happens.
$uri = $realpath;
}
$return = parent::openUri($uri);
if (!$return) {
throw new XMLSitemapGenerationException(t('Could not open file @file for writing.', array('@file' => $uri)));
}
return $return;
}
public function startDocument........................
in diesem Fall einfach die
am 05.11.2012 - 14:09 Uhr
in diesem Fall einfach die mit + gekennzeichneten Zeilen einfügen:
public function openUri($uri) {
// If download method is set to 'public', we find the absolute path
// of Drupal's root, so that realpath() won't return FALSE
if (variable_get('file_downloads', '1') == '1') {
$uri = realpath('.') . '/' . $uri;
}
if ($realpath = realpath($uri)) {
// Convert to a real path if possible. Sometimes this function returns
// a FALSE value, so use the original value when that happens.
$uri = $realpath;
}
$return = parent::openUri($uri);
if (!$return) {
throw new XMLSitemapGenerationException(t('Could not open file @file for writing.', array('@file' => $uri)));
}
return $return;
}
public function startDocument........................
Besten Dank. Großartige
am 05.11.2012 - 14:16 Uhr
Besten Dank.
Großartige Hilfe.
Werde es später einfügen u. berichten.
muss jetzt nämlich weg.
LG
Robert
Alles palletti
am 06.11.2012 - 11:27 Uhr
Funktioniert wie erwartet.
Nochmals danke.
Gruß
Robert