XML Sitemap Port to 6.x (HEAD)

Freso - July 7, 2007 - 14:01
Project:XML Sitemap
Version:6.x-0.x-dev
Component:xmlsitemap
Category:task
Priority:normal
Assigned:Unassigned
Status:patch (code needs review)
Description

What are the plans for updating this to work with D6?

#1

VeryMisunderstood - July 7, 2007 - 14:03

This module is actively being developed. I woudn't expect a Drupal 6 update until one of two things happens. 1) Drupal 6 is released as RC or Full 2) someone produces a patch for testing.

#2

VeryMisunderstood - July 7, 2007 - 14:04

aplologies, The above should read actively being developed for Drupal 5. There was a new release as recent as yesterday.

#3

Freso - August 15, 2007 - 14:54

I have now run over most of the code trying to port it (w/o testing), and there are now two remaining issues that I'm not sure of right off the bat:
In xmlsitemap.module:

<?php
function _xmlsitemap_get_path_alias($path, $alias = NULL, $path_language = '') {
 
$result = $path;
  if (!empty(
$alias)) {
   
$result = $alias;
  }
  if (
function_exists('custom_url_rewrite')) {
   
$result = custom_url_rewrite('alias', $result, $path, $path_language);
  }
  return
$result;
}
?>

Should custom_url_rewrite be replaced by custom_url_rewrite_inbound or custom_url_rewrite_outbound? From the arguments they take, it would seem that _inbound is similar to the old custom_url_rewrite, but I'm not very well-versed in this code (yet?).

The second thing is the SQL in xmlsitemap.install which I'm rather intimidated by, to be honest. If anyone would like to take a stab at this, I'd be very happy. Else I'll probably end up diving into it sooner or later...

The work so far has been attached.

AttachmentSize
xmlsitemap.5x-to-6x.patch4.51 KB

#4

Freso - August 15, 2007 - 17:27
Status:active» patch (code needs work)

Just realised I might want to change the status.

#5

Freso - August 16, 2007 - 19:34

After advice from dmitrig01 in #drupal-dev, I've used url() instead of custom_url_rewrite_[in|out]bound(). Whether it works, I do not yet know.

I've also tried to play around with the Schema module, to help with the creation of the schema file, but apparently, it doesn't want to pick up the xmlsitemap tables. I'm rather puzzled by this.

AttachmentSize
xmlsitemap.5x-to-6x_0.patch4.59 KB

#6

Darren Oh - November 11, 2007 - 19:04
Project:Google Sitemap» XML Sitemap
Version:HEAD» 6.x-0.x-dev
Component:Code» xmlsitemap

#7

hass - January 20, 2008 - 21:27

@Darren: Are you working on this task? XMLSitemap is the only outstanding module i need for D6 production... what is the estimated time lane?

#8

Arkar - February 18, 2008 - 02:43

Re-commenting since drupal 6.0 is out now. Really need this module. When will it be ready ? Thank you for this module.

#9

gangas - February 19, 2008 - 18:13

Very good module!

Only: I want it in D6 What is now the state of it? Developping, or won't????

Tnx,

Thom

#10

Freso - February 20, 2008 - 18:31

I haven't done any work on it since my last patch, and as you might see, I haven't (and have never) claimed/assigned meself to the issue, so anyone is free to either 1) take my patch and finish it, or 2) write their own patch. Given time, I might be able to dig into it again though. We'll see. I am currently working on porting the remaining modules I'm missing for my own site, so this is going to be done eventually. :)

#11

Jonathan.Cochran - February 21, 2008 - 00:15

Willing to help test if this patch is made. Thanks :)

#12

gangas - February 28, 2008 - 20:03

Now testing...

#13

gangas - February 28, 2008 - 20:09

Bug found:

----------------------------------------------------------------------------------------------------------------------------------------------------------

Line 11, Column 5: element "body" undefined .

You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by:

* incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "" element),
* by using vendor proprietary extensions such as "" or "" (this is usually fixed by using CSS to achieve the desired effect instead).
* by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case).

--------------------------------------------------------------------------------------------------------------------------------------------------------------

Ok,

Thom

#14

Freso - February 28, 2008 - 21:03

@gangas: The patch was never finished and has been marked "code needs work" since the first version of it. If you wish to help XML Sitemap be released for 6.x, please either 1) take my patch and finish it, or 2) write your own patch. If you don't feel like writing code, wait for someone to make a patch marked "code needs review" and then review and test it. Thank you.

#15

gangas - February 29, 2008 - 07:25

Ok,

Thanks,

Thom

#16

samdeskin - March 8, 2008 - 17:08
Title:Drupal 6» Drupal 6 XML Sitemap

Any hope that someone who knows PHP is going to get this to work???

This is one of the most important modules to getting traffic to your site - without it - you may as well not install Drupal 6

#17

pobster - March 8, 2008 - 19:15

I don't use this module, but I stumbled over this thread and thought I'd help out, using schema isn't as difficult as it looks!

xmlsitemap.install

<?php
// $Id: xmlsitemap.install,v 1.4 2007/12/11 22:57:45 darrenoh Exp $

/**
* Implementation of hook_schema().
*/
function xmlsitemap_schema() {
  $schema['xmlsitemap_additional'] = array(
    'description' => t('Stores the sitemap for the XMLSiteMap module.'),
    'fields' => array(
      'path' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
      'pid' => array('type' => 'int'),
      'last_changed' => array('type' => 'int'),
      'previously_changed' => array('type' => 'int'),
      'priority' => array('type' => 'float'),
    ),
    'primary key' => array('path'),
  );
  return $schema;
}

/**
* Implementation of hook_install().
*/
function xmlsitemap_install() {
  drupal_install_schema('xmlsitemap');
  db_query("DELETE FROM {url_alias} WHERE dst LIKE 'sitemap%.xml'");
}

/**
* Implementation of hook_enable().
*/
function xmlsitemap_enable() {
  global $base_path;
  $xsl = file_get_contents(drupal_get_path('module', 'xmlsitemap') .'/gss/gss.xsl');

  $css_start = strpos($xsl, '<link href="') + strlen('<link href="');
  $css_length = strpos($xsl, '" type="text/css" rel="stylesheet"/>') - $css_start;
  $xsl = substr_replace($xsl, $base_path . drupal_get_path('module', 'xmlsitemap') .'/gss/gss.css', $css_start, $css_length);

  $js_start = strpos($xsl, '<script src="') + strlen('<script src="');
  $js_length = strpos($xsl, '"></script>') - $js_start;
  $xsl = substr_replace($xsl, $base_path . drupal_get_path('module', 'xmlsitemap') .'/gss/gss.js', $js_start, $js_length);

  if (file_check_directory(($path = file_directory_path() .'/xmlsitemap'), FILE_CREATE_DIRECTORY)) {
    file_save_data($xsl, "$path/gss.xsl", FILE_EXISTS_REPLACE);
  }
}

/**
* Implementation of hook_disable().
*/
function xmlsitemap_disable() {
  $path = file_directory_path() .'/xmlsitemap';
  if ($dir = @opendir($path)) {
    while (($file = readdir($dir)) !== FALSE) {
      if ($file != '.' && $file != '..') {
        unlink("$path/$file");
      }
    }
    closedir($dir);
    rmdir($path);
  }
}

/**
* Implementation of hook_uninstall().
*/
function xmlsitemap_uninstall() {
  drupal_uninstall_schema('xmlsitemap');
  db_query("DELETE FROM {variable} WHERE name LIKE 'xmlsitemap_%'");
  cache_clear_all('variables', 'cache');
}

Note that I've no idea about whether the enable/ disable code works alright - I just know how to pass a schema test ;o) I haven't done anything with the module other than to make sure the db tables install correctly. If you've already installed the module before then you'll need to uninstall it before you reinstall it to recreate the db tables. This is normal behaviour with Drupal modules.

Pobster

#18

DenRaf - March 9, 2008 - 01:50

Here is my patch. As good as everything is converted, but there is only an issue with displaying everything :).

The admin/settings/xmlsitemap/additional link works fine, but all the others give this error:
Fatal error: Unsupported operand types in /var/vhosts/www.denraf.be/htdocs/includes/common.inc on line 1265

AttachmentSize
drupal6.patch44.04 KB

#19

miurahr - March 9, 2008 - 07:17

grep -n ' url(' xmlsitemap.xml saids,
753: $result = url($path, $alias, array(), $path_language);

This may cause 'Unsupported Operand Types in Code in common.inc:1265' with blank page.
Because of changing url() in drupal6, It should be changed to fit new api like;

753: $result = url($path, array('query' => $alias, 'absolute' => $path_language));

It also seems be good practice change common.inc:1265; url()
from
$option += array(...) ;
to
$option = array_merge($option, ....);

If module is under porting to Drupal 6, this change helps developers of 3rd party module to find a problem
forgetting replacement of url();

#20

pobster - March 9, 2008 - 09:02

Just to note, take a look at my hook_uninstall above - perhaps you could re-post your patch with the url fix and flushing the variables cache as well.

edit: I've just noticed that you've made a mistake in hook_menu as well with access arguments. Perhaps this is why your links are failing?

You need to specify access and access arguments correctly, change these lines;

   $access_config = user_access('administer site configuration');
   $access_content = user_access('access content');

To;

   $access_config = array('administer site configuration');
   $access_content = array('access content');

And then format the menu item access like this;

  $items['sitemap.xml'] = array(
    'title' => t('Site map index'),
    'page callback' => '_xmlsitemap_output',
    'type' => MENU_CALLBACK,
    'access callback' => 'user_access',
    'access arguments' => $access_content,  // or obviously just use array('access content') and lose the vars above
  );

Pobster

#21

miurahr - March 9, 2008 - 10:37

DenRaf,

Your patch cause error on PostgreSQL backend.
Because 'MAX(column)' returns NULL if no value exist in the column.

pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR: null value in column &quot;pid&quot; violates not-null constraint: /var/www/osm/includes/database.pgsql.inc on line 138.

query: INSERT INTO xmlsitemap_node (nid, pid, last_changed, last_comment, previous_comment) SELECT n.nid, MAX(ua.pid), n.changed, s.last_comment_timestamp, MAX(c.timestamp) FROM node n LEFT JOIN node_comment_statistics s ON s.nid = n.nid LEFT OUTER JOIN comments c ON c.nid = n.nid AND c.timestamp &lt; s.last_comment_timestamp LEFT JOIN xmlsitemap_node xn ON xn.nid = n.nid LEFT JOIN url_alias ua ON ua.src = 'node/' || n.nid WHERE xn.nid IS NULL GROUP BY n.nid, n.changed, s.last_comment_timestamp : /var/www/osm/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module on line 387.

please remove NOT NULL constrains for columns; 'pid' and 'previous_comment' .

#22

hass - March 9, 2008 - 10:46

@miurahr: cannot find this in the patch code. looks like a different bug. please open a new case for this pgsql bug.

#23

DenRaf - March 9, 2008 - 13:42
Status:patch (code needs work)» patch (code needs review)

Thx for the reactions.

As you can see I applied a new patch, and updated to the status to "code needs review". For me everything works now.

The changes suggested by miurahr did the trick for the administration pages, while pobster suggestions made the access to the sitemap.xml possible.

(The changes suggested by miurahr for the common.inc are not applied.)

The error from miurahr should also be solved now. @hass, this error was caused by the null settings in the xmlsitemap_node.install file, so it was for this patch. :)

Update: the url's listed in the sitemap are correct now. As you can see in the patch, I just disabled the url function part, and now everything seems working just fine.
Here is the link of my drupal 6.1 blog sitemap: http://www.denraf.be/sitemap.xml

AttachmentSize
drupal6_4.patch53.51 KB

#24

hass - March 9, 2008 - 13:04

I'm not sure, but isn't head not older then 5.x-1.4? I think there are some changes that are not in HEAD, so patching against 1.4 makes more sense...

#25

hass - March 9, 2008 - 14:36
Status:patch (code needs review)» patch (code needs work)

1. You don't need to specify +    'access callback' => 'user_access', in menu. This is the default function called.
2. title and description in menu's shouldn't be surrounded by t().
3. Why are you removing the weight? -    '#weight' => -1,
4. code style... 2 blanks... not only "one"

-        return $base . $path .'?'. $query . $fragment;
+       return $base . $path .'?'. $query . $fragment;

5. About custom_url_rewrite changes see http://drupal.org/node/114774#custom-url-rewrite
6. i would disable or remove i18n module parts. I'm not sure, but they are no more used as i think - and there is no i18n module yet.

if (module_exists('i18n')) {
     i18n_get_lang_prefix($result, TRUE);
   }

7. +version = 6.x-1.0-dev should be +version = 6.x-1.x-dev
8. Why have you added so many AS to the sql statements? We should focus on the upgrade only... not fixing such minor sql style issues.

-      FROM {node} n
-      LEFT JOIN {node_comment_statistics} s ON s.nid = n.nid";
+      FROM {node} AS n
+      LEFT JOIN {node_comment_statistics} AS s ON s.nid = n.nid";

9. removed code like 'disp-with' => 11,. This has been added by MySQL Query and is not related to the schema.

Have you run coder.module to validate code and schema.module to verify schema consistency. Very helpful!

#26

DenRaf - March 9, 2008 - 16:56

k, check new patch.

disp-with was a suggestion of the schema module, since the orginal create table query used int(11).

It ain't that much work to just add the AS when you go through the code ...

AttachmentSize
drupal6_5.patch57.9 KB

#27

hass - March 9, 2008 - 20:05

1. Help texts should be surrounded with t()

-      return t('Configure behavior for search engines.');
+      return 'Configure behavior for search engines.';
-      return t('Set up additional links for your site map.');
+      return 'Set up additional links for your site map.';

2. You are killing translatable strings... this is wrong (only a few examples) inside forms. Only remove t() from menu, watchdog texts

-    '#title' => t('Submission settings'),
+    '#title' => 'Submission settings',

-  $header = array(t('Delete'), t('Path'), t('Priority'));
+  $header = array('Delete', 'Path', 'Priority');

-    drupal_set_message(t('Unable to load site map. Make sure that there is an xmlsitemap directory in your files directory and that it is writable by Drupal.'), 'error');
+    drupal_set_message('Unable to load site map. Make sure that there is an xmlsitemap directory in your files directory and that it is writable by Drupal.', 'error');

3. why are you breaking?

-  if (function_exists('custom_url_rewrite')) {
-    $result = custom_url_rewrite('alias', $result, $path);
-  }

4. Please rollback your "AS" changes in SQL. It is hard enough to review such a big patch and we should split this to have an extra patch that applies to D5 branch, too. Focus on the D6 upgrade only, please.

#28

DenRaf - March 10, 2008 - 18:54

hass: for the custom_url_rewrite look at post #3 and #5. Just took that.

New patch attached.

AttachmentSize
drupal6_6.patch56.06 KB

#29

hass - March 10, 2008 - 20:50

1. Why are you deleting -    '#weight' => -1,?

2. Wrong:

-        '#title' => t('Submission URL'),
+        '#title' => 'Submission URL',

3. a few bug examples

-    SELECT xa.*, ua.dst AS alias FROM {xmlsitemap_additional} xa
+    SELECT xa.*, ua.dst alias FROM {xmlsitemap_additional} xa

-      SELECT n.nid, n.type, n.promote, s.comment_count, n.changed, xn.previously_changed, s.last_comment_timestamp, xn.previous_comment, xn.priority_override, ua.dst AS alias
+      SELECT n.nid, n.type, n.promote, s.comment_count, n.changed, xn.previously_changed, s.last_comment_timestamp, xn.previous_comment, xn.priority_override, ua.dst alias

Please reviewing your own patch before posting. Needs work.

#30

DenRaf - March 10, 2008 - 21:23

- Fixed queries
- #weight tags are back in place
- most of the t() - tags fixed.

AttachmentSize
drupal6_7.patch44.52 KB

#31

housetier - March 11, 2008 - 16:10

Against which release where those patches diffed? I tried applying them to xmlsitemap 6.x-0.x-dev and xmlsitemap 5.x-1.0 (both from Nov 9, 2007), but they always failed at one point.

I'd be happy to apply them against a version from CVS too, but which one should I check out?

#32

hass - March 11, 2008 - 16:57

/cvs/drupal-contrib/* is HEAD.

#33

jgayhart - March 11, 2008 - 20:27

I am noticing that the Last Modification Date in the xml file does not seem to match the last_changed field in xmlsitemap_node. How is the Last Modification Date generated?

#34

DenRaf - March 14, 2008 - 18:48
Status:patch (code needs work)» patch (reviewed & tested by the community)

I made the patch against this cvs checkout:

cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d xmlsitemap contributions/modules/xmlsitemap

then apply patch:

patch -p0 -d xmlsitemap < /path/to/patch

#35

hass - March 15, 2008 - 10:04
Status:patch (reviewed & tested by the community)» patch (code needs work)

Please don't set your own patch RTBC. Aside custom_url_rewrite need to be fixed first.

#36

huang_cn - March 20, 2008 - 06:01

hi,
i made a 6.1 compatible edition by combile xmlsitemap-6.x-0.x-dev.tar.gz and drupal6_7.patch from this thread.
it works fine on drupal 6.1.

but it still not compatible to i18n module as it create aliase to the default language only.

see sitemap demo: http://www.yingyudaxue.com/sitemap.xml

AttachmentSize
xmlsitemap.6.x-0.x-dev.patched.zip57.2 KB

#37

klamping - March 21, 2008 - 01:21

I've tested huang_cn's version of XML sitemap in drupal 6.1 on a test site and everything installed and ran successfully. I will be installing this on a production server soon and will report any errors.

Thanks huang_cn!!

#38

DenRaf - March 21, 2008 - 22:13
Status:patch (code needs work)» patch (code needs review)

Please check this new patch

- use of custom_url_rewrite_outbound

AttachmentSize
drupal6_8.patch44.75 KB

#39

galeksic - March 23, 2008 - 13:45

I did nothing, I just applyed DenRaf's drupal6_8.patch
Works nice - sitemap.xml urls are pathauto urls now (http://www.drupalrs.com/sitemap.xml)

AttachmentSize
xmlsitemap-6.x-1.0-dev8.tar_.gz29.88 KB

#40

hass - March 23, 2008 - 16:34

Have someone verified this patch with "domain name" and "path" language switching and if the results are correct, yet?

#41

alexcnhz - March 24, 2008 - 08:11
Priority:normal» critical
Status:patch (code needs review)» patch (code needs work)

i tested galeksic's patched edition with "domain name" on one production site that has i18n module enabled, still not working.
as described above, it create alias to default language only.
it should work on sites that does not have multilingual content.

#42

hass - March 24, 2008 - 09:54

Let me say - i18n module is not required for testing this in D6... domain name and path language switching is build in D6 core.

#43

hass - March 24, 2008 - 14:40

Undefined index: type in sites\all\modules\xmlsitemap\xmlsitemap_node\xmlsitemap_node.module in Line 166.

#44

DenRaf - March 26, 2008 - 19:52

@hass: could you tell me when you had that error, cause I'm unable to reproduce that.

for alexcnhz: does the translation work in the menu and settings pages?

#45

hass - March 26, 2008 - 20:12

D6 code should be E_ALL compliant. See "Testing for error notices" at http://drupal.org/node/34341

#46

DenRaf - March 28, 2008 - 21:12
Status:patch (code needs work)» patch (code needs review)

With the new patch I don't get any errors anymore on E_ALL level. Please test the new patch.

AttachmentSize
drupal6_9.patch51.82 KB

#47

hswong3i - March 31, 2008 - 04:19

Some update from #46:
1. Fix the patch creation, so can use "patch -p0" for apply patch.
2. Code cleanup with coder and code-clean.sh.

Patch reroll via cvs HEAD. Function without error message.

AttachmentSize
xmlsitemap-HEAD-0.2.patch60.67 KB

#48

ouellettesr - March 31, 2008 - 22:53

Hello I am using the latest patch "xmlsitemap-HEAD-0.2.patch" applied to the cvs version. Everything installed ok and I was updating the user settings and I receive this error.

warning: Missing argument 3 for _xmlsitemap_user_submit(), called in /home/nexgenwe/public_html/gen/includes/form.inc on line 759 and defined in /home/nexgenwe/public_html/gen/sites/all/modules/xmlsitemap/xmlsitemap_user/xmlsitemap_user.module on line 131.

Update***

I just tried to create a new user and I got these errors..

* user warning: Column 'pid' cannot be null query: INSERT INTO xmlsitemap_user (uid, pid, last_changed, priority_override) VALUES (4, NULL, 1207003850, NULL) in /home/nexgenwe/public_html/gen/sites/all/modules/xmlsitemap/xmlsitemap_user/xmlsitemap_user.module on line 206.
* warning: array_fill() [function.array-fill]: Number of elements must be positive in /home/nexgenwe/public_html/gen/includes/database.inc on line 235.
* warning: implode() [function.implode]: Invalid arguments passed in /home/nexgenwe/public_html/gen/includes/database.inc on line 235.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /home/nexgenwe/public_html/gen/modules/user/user.module on line 500.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /home/nexgenwe/public_html/gen/modules/user/user.module on line 500.

#49

hswong3i - April 1, 2008 - 04:09

The problem is very simple: the translate of schema from D5 to D6 is not correct, and come with some extra parameters, e.g. "not null", "unsigned", etc.

Patch update via latest CVS HEAD. Test with disable -> uninstall all xmlsitemap* modules, and reinstall all. Please try the case of #48 and report if bug still reproduce.

AttachmentSize
xmlsitemap-HEAD-0.3.patch58.76 KB

#50

warnockm - April 1, 2008 - 16:56
Priority:critical» normal

I'm using Drupal 6.1 and downloaded xmlsitemap 5.x. I patched it with drupal6_9.patch and installed it. It's working great for me. thanks.

#51

impahz - April 2, 2008 - 23:14

Maybe review the patch and release an updated version of xml sitemap? Would be cool for us noobs..

#52

MichaelK - April 3, 2008 - 15:05

I patched the CVS version with xmlsitemap-HEAD-0.3.patch (#49) and everything works fine!
I'm using xmlsitemap, xmlsitemap node, and xmlsitemap term.

I think it's time for a dev version.

#53

hswong3i - April 4, 2008 - 07:47
Title:Drupal 6 XML Sitemap» Port to 6.x

Some minor coding style update.

AttachmentSize
xmlsitemap-HEAD-0.4.patch59.14 KB

#54

deadmalc - April 7, 2008 - 14:10

Not sure whether this is an issue with drupal 6.x or a generic problem, but my site is multi-lingual.
The sitemap.xml only shows the language of the last edited page, i.e. if I edit a page in french all sitemap.xml
urls are in french and no english/german, then if I edit an english page then sitemap.xml shows just the english pages

#55

hass - April 7, 2008 - 14:47

That's what i asked for in #42:

1. If you are using domain name based language negotiation you should only get French nodes at "example.fr", "example.es" only Spanish nodes, etc.
2. If you are using path for negotiation, i think you should get all nodes in all languages.
3. For no language negotiation, you should get all, too.

#56

deadmalc - April 7, 2008 - 19:42

I'm using path for negotiation and I only get the language that I last edited. :-(

#57

hass - April 7, 2008 - 20:00
Status:patch (code needs review)» patch (code needs work)

#58

anonimicer - April 7, 2008 - 20:37

Can somebody please post a dev version? I have been trying for days to get patch working with no avail and the version seems to be dev quality by now. Thanks!

#59

hass - April 7, 2008 - 22:41

Apply the patch against HEAD

#60

andrewfn - April 8, 2008 - 01:58

The patch applied fine for me and everything seems to work well on 6.1.
Just one point--it only applies to HEAD if you check the module out of CVS. If you download it as a package then one hunk fails (presumably because the packager has inserted a timestamp and changed the .info file).

#61

anonimicer - April 8, 2008 - 14:19

Okay, so before I was getting the package download. However, downloading the CVS head is still giving me trouble. I am using

patch xmlsitemap.module xmlsitemap.patch

and all the hunks are failing.. Am I missing anything? I read throughly the patch in windows tutorial and couldn't find anything that I am doing incorrectly..
Thanks

#62

hass - April 8, 2008 - 14:48

patch -p0 < file.patch

#63

anonimicer - April 8, 2008 - 16:24

Im using patch for windows and that does not work

I tried the --p 0 but that didn't help

#64

hswong3i - April 8, 2008 - 16:31

@anonimicer: Seems this is not a task review or bug report of this issue, and you may ask in mailing list or IRC. Anyway, give a look to here: http://drupal.org/patch/apply

#65

deadmalc - April 8, 2008 - 20:33

For people who are unable to apply the patch here is the version I am using ( patch 0.4)

AttachmentSize
xmlsitemap.tar.gz35.91 KB

#66

deadmalc - April 9, 2008 - 12:47

I'm a bit confused, by your comment on #42.
As far as I can see the sitemap.xml should not be using the local stuff in drupal core - otherwise how do you submit sitemaps?
I could see that using http://www.saafpureskincare.com/fr/sitemap.xml and submitting that could work, but if we translate to say 10 languages then that would mean that we would have to submit it 10 times - assuming that google etc. etc. allow 10 sitemaps.
http://www.saafpureskincare.com/fr/sitemap.xml
http://www.saafpureskincare.com/de/sitemap.xml
http://www.saafpureskincare.com/pl/sitemap.xml
http://www.saafpureskincare.com/es/sitemap.xml
etc. etc.

Also http://www.saafpureskincare.com/fr/sitemap.xml doesn't work as it just gives the same as http://www.saafpureskincare.com/sitemap.xml

IMHO the sitemap.xml should contain ALL languages, as they are effectively different nodes.
The strange thing is it's current behaviour, the fact that it doesn't default to the default language as was specified, but to the last language used when editing a page.

Should I raise a separate bug report for this guys?

Cheers,

Malc

#67

hass - April 9, 2008 - 17:48

I'm very sure the current patch is not working with multilingual websites. So testing for bug freeness in such a case makes *no* sense...

1. If you have domain based detection
1a. http://www.example.fr/sitemap.xml should ONLY give you content marked as French
1b. http://www.example.es/sitemap.xml should ONLY give you content marked as Spanish
1c. http://www.example.de/sitemap.xml should ONLY give you content marked as German
1d. sitemap.xml must contain all url's with full qualified domain name - language specific.

2. If you have path based detection
2a. http://www.example.com/sitemap.xml should return ALL nodes in all languages
2b. You shouldn't use http://www.example.com/fr/sitemap.xml... i don't know how a robots.txt should looks like in such a situation... it may be possible, but i thought you can only add one sitemap line to robots.txt. I think it is difficult to implement this. http://sitemaps.org/protocol.php#submit_robots allows to add more then one line. So we must make sure the hook_robotstxt gives all URLs back. However i think 2c will be the best solution here.
2c. We should block requests to subdirs "http://www.example.com/fr/sitemap.xml" and maybe redirect to the main http://www.example.com/sitemap.xml that contains all languages.

3. no languages detection
3a. Sitemap will become http://www.example.com/sitemap.xml as in past.

There is no need to register at Google except some statistics... because of "sitemap" tag available for robots.txt. As it is impossible to add this robots.txt line automatically in multi language with domain based detection you need to install "robotstxt" module. This modules make sure the correct and full qualified link is displayed to spiders in robots.txt. If you don't have a "sitemap:" line in robots.txt you must register the sitemap manually to all search engines in the world... sounds like a funny and impossible job.

#68

Arkar - April 9, 2008 - 22:32
Title:Port to 6.x» XML Sitemap Port to 6.x

#69

deadmalc - April 11, 2008 - 08:06

Hass,

I agree with that completely, my comments BTW were aimed purely at path based detection.
I didn't know about being able to add the sitemap: line to robotstxt, that's really nice to know!
I'd agree that 2c would be the cleanest solution for path based detection.

Cheers,

Malcolm

#70

Freso - April 11, 2008 - 15:26
Status:patch (code needs work)» patch (code needs review)

Hohum. This latest discussion seems to be all about i18n issues and I don't think that should hold the patch back from being committed. Rather, commit the patch (if it works in all other ways than when it comes to i18n) and open a new issue about the (possible?) lack of/wrong i18n support.

@hass: Was it due to i18n concerns you switched this back to CNW? If not, feel free to set it back. :)

(Note that I'm using "i18n" as the generic acronym for internationalisation, and not the contrib module.)

#71

hass - April 11, 2008 - 17:54
Status:patch (code needs review)» patch (code needs work)

I set this to CNR while i18n is a core feature and therefore we must include this functionality. Without - the module is missing some of the most important new D6 parts and is broken in several ways. Aside i really need this l18n features myself, too. This is critical to me (domain based detection).

#72

andrewfn - April 12, 2008 - 18:46

I think this patch should be committed. To hold it back because it does not fix every single issue is a misunderstanding about how open source development works. Patches are incremental. This patch at least gets the module functional under D6. It does not fix all the issues, but they are for later patches.
I am tracking (and bug testing) several modules which are being ported to D6 and none of the others are following the "all or nothing" approach. The process of getting a fully functional D6 release usually takes several patches.
So I recommend that this patch be committed, and then further patches can be suggested to fix i18n and other issues.

#73

chantra - April 14, 2008 - 17:46

with the release of 6.2, some items of xmlsitemap were not accessible anymore.
see http://drupal.org/node/244569

I have it working now with the patch attached to this post.
the patch is against http://ftp.drupal.org/files/projects/xmlsitemap-6.x-0.x-dev.tar.gz
The patch has been made based on http://drupal.org/files/issues/xmlsitemap.6.x-0.x-dev.patched.zip from comment #36.

What was really modified is:
- added
'access arguments' => $access_config,
(line 399 from patch)
- added
'access arguments' => $access_config,
(line 408 from patch)

AttachmentSize
xmlsitemap-drupal-6.2.diff43.89 KB

#74

jack in the box - April 14, 2008 - 20:42

Here is the patched module for 6.2 in case someone needs it.

I agree with i18n. It is a core feature. I wish I could be able to correct it. I'll keep looking..

AttachmentSize
xmlsitemap-6.2-0.x-dev.patched.tgz36.32 KB

#75

rmiddle - April 21, 2008 - 00:20

Ok my test upgrade from D5 to D6 went well. I am English only so this patch works great. No issue. You really should release an alpha version with the notes about internal being broken. I have only one or two modules left to fix up before I can get all the loving of D6.

#76

Bundus - April 18, 2008 - 20:32

I installed the version in #74 and it doesnt work at all.

"XML Parsing Error: not well-formed
Line Number 1, Column 1:"

...if you download the XML its just filled with junk.

#77

jcnventura - April 18, 2008 - 21:43

Regarding #76, does your server have compression enabled?? Try to un-gzip it and see if it stops being junk.

#78

Bundus - April 18, 2008 - 22:08

#77 good call. I changed the extension of the XML file to .gz, ran it through 7-zip and its entirely readable. Now I just gotta figure out how to turn compression off just for that file.

Thanks btw.

#79

keto - April 19, 2008 - 21:40

I am attempting to install the patch from post #74 and a little lost.

Does a patch work in conjunction with the base module or does it work stand alone? This is a new install of drupal 6.2 and thus no prior sitemap modules have been enabled.

I have copied the file xmlsitemap-6.2-0.x-dev.patched into the modules directory but it is not showing up in the modules admin panel.

Thanks,

Keto

#80

Cybergarou - April 20, 2008 - 00:49

The file in #74 is a copy of the module with the patch applied to it.

Extract it completely and you will get a folder named xmlsitemap. Copy that into the modules directory.
(I'm guessing you unzipped it, but didn't untar it.)

#81

keto - April 20, 2008 - 04:20

Thank you, working now.

I used winrar to decompress the downloaded file. Then changed the file extension to .zip on the extracted file and used winrar to extract one more time.

Thank you!

#82

NuZeilen - April 22, 2008 - 16:45

My drupal installation says that drupal don't work with this module anymore, what can i do about this?

#83

adises - April 23, 2008 - 01:50

@NuZeilen the module isn't made for drupal 6.x as of now..just wait :)

#84

rmiddle - April 23, 2008 - 14:44

#82 I am just ignoring the error for now until an official version comes out. Right now you are running pre-alpha software if you are running the patched version. In the end the main developer might look at the patch and make whole changes that make this version incompatible to this version. If you are using this patch you are talking a change.

Thanks
Robert

#85

hass - April 23, 2008 - 15:32

I'm not sure, but i think there is a bug...

function xmlsitemap_settings_sitemap_submit($form, &$form_state) {
  system_settings_form_submit($form, $form_state['values']);
  ...

that should be:

function xmlsitemap_settings_sitemap_submit($form, &$form_state) {
  system_settings_form_submit($form, $form_state);
  ...

If not - the system_settings_form_submit() function will not receive the correct array structure. But I could be wrong...

#86

MaffooClock - April 23, 2008 - 17:06

I have installed this patched version of xmlsitemap, and it seems to work great. There is one problem, though. When adding a new node (blog entry, in my case), I get the following error after saving a new entry:

* user warning: Column 'pid' cannot be null query: INSERT INTO xmlsitemap_term (tid, pid, last_changed, priority_override) VALUES (71, NULL, 1208970448, NULL) in D:\Web Root\uberclark.us\sites\all\modules\xmlsitemap\xmlsitemap_term\xmlsitemap_term.module on line 206.
* user warning: Column 'pid' cannot be null query: INSERT INTO xmlsitemap_term (tid, pid, last_changed, priority_override) VALUES (72, NULL, 1208970448, NULL) in D:\Web Root\uberclark.us\sites\all\modules\xmlsitemap\xmlsitemap_term\xmlsitemap_term.module on line 206.
* user warning: Column 'pid' cannot be null query: INSERT INTO xmlsitemap_term (tid, pid, last_changed, priority_override) VALUES (73, NULL, 1208970448, NULL) in D:\Web Root\uberclark.us\sites\all\modules\xmlsitemap\xmlsitemap_term\xmlsitemap_term.module on line 206.
* user warning: Column 'pid' cannot be null query: INSERT INTO xmlsitemap_term (tid, pid, last_changed, priority_override) VALUES (74, NULL, 1208970448, NULL) in D:\Web Root\uberclark.us\sites\all\modules\xmlsitemap\xmlsitemap_term\xmlsitemap_term.module on line 206.

#87

MaffooClock - April 23, 2008 - 17:32

After eyeballing the database schema, the solution appears to be to change line 199 of xmlsitemap_term.module from:

      $pid = empty($pid) ? 'NULL' : $pid;

to:

      $pid = empty($pid) ? '0' : $pid;

But I don't have any idea if this is the correct solution or not, as I lack the in-depth knowledge of how xmlsitemap is supposed to work.

#88

encho - April 24, 2008 - 11:30

subscribing

#89

VladSavitsky - April 24, 2008 - 19:09

I'm using a xmlsitemap-6.2-0.x-dev.patched.

I have renamed a role and got this message:

warning: Missing argument 3 for _xmlsitemap_user_submit(), called in /home/.../public_html/includes/form.inc on line 759 and defined in /home/../public_html/sites/all/modules/xmlsitemap-6.2-0.x-dev.patched/xmlsitemap_user/xmlsitemap_user.module on line 131.

#90

John_Kenney - April 25, 2008 - 21:44

I've installed #74 on a localhost v6.2 site and it seems to be working fine. Smooth installation. No errors. Will upload to beta site shortly. Will follow up if any problems in coming days.

Thanks to those who have worked on this. Very valuable capability.

Two questions though:

-How do you adjust/edit the 'frequency' field? It seems to be fairly random what value I get. Shouldn't that be adjustable on each node the same way 'priority' is?

-Why is the default set to 0.1? sitemaps.org indicates the normal default is 0.5. why not use that? having it set to near lowest level means you have to change practically every page - or at least i did. it is good that you can change in the admin panel, but that only affects new pages.

#91

IceCreamYou - April 25, 2008 - 22:17

The official 6.0-dev release should really be updated...

Then again, this module should really be in core.

Thanks for working on this guys.

#92

flickerfly - April 26, 2008 - 19:47

subscribe - thanks for all the work guys

#93

LUTi - April 29, 2008 - 07:28

I've installed xmlsitemap as in #73 (using: patch -p1 < xmlsitemap-drupal-6.2.diff) and it seems to work just fine for me.

Coder complains about the following:

  • xmlsitemap.module (line 758): In place of custom_url_rewrite(), use custom_url_rewrite_inbound() or custom_url_rewrite_outbound() (Drupal Docs)
    $result = custom_url_rewrite('alias', $result, $path);
  • xmlsitemap_term.module (line 191): In SQL strings, Use db_query() placeholders in place of variables. This is a protential source of SQL injection attacks when the variable can come from user data. (Drupal Docs)
    $pid = db_result(db_query("SELECT pid FROM {url_alias} WHERE src = '%s'", "forum/$array[tid]"));
  • xmlsitemap_term.module (line 197): In SQL strings, Use db_query() placeholders in place of variables. This is a protential source of SQL injection attacks when the variable can come from user data. (Drupal Docs)
    $pid = db_result(db_query("SELECT pid FROM {url_alias} WHERE src = '%s'", "taxonomy/term/$array[tid]"));
  • xmlsitemap_user.module (line 195): In SQL strings, Use db_query() placeholders in place of variables. This is a protential source of SQL injection attacks when the variable can come from user data. (Drupal Docs)
    $pid = db_result(db_query("SELECT pid FROM {url_alias} WHERE src = '%s'", "user/$account->uid"));
  • xmlsitemap_user.module (line 211): In SQL strings, Use db_query() placeholders in place of variables. This is a protential source of SQL injection attacks when the variable can come from user data. (Drupal Docs)
    $pid = db_result(db_query("SELECT pid FROM {url_alias} WHERE src = '%s'", "user/$account->uid"));

For the moment, I can live with that (it is a test site...), but it is extremely annoying that Drupal started to complain (throws out a message) about:
"The installed version of at least one of your modules or themes is no longer supported. Upgrading or disabling is strongly recommended! Please see the project homepage for more details. See the available updates page for more information."

At "Available updates", XML Sitemap module is in red as:

XML Sitemap 6.x-1.x-dev (2008-Jan-21)
Project not supported: This project is no longer supported, and is no longer available for download. Disabling everything included by this project is strongly recommended!
Includes: XML Sitemap, XML Sitemap: Engines, XML Sitemap: Node, XML Sitemap: Term, XML Sitemap: User

Can anything be done at my side to get rid of that (in Drupal 5.7, there were settings to ignore certain modules; in 6.2 I just don't find anything like that...)? Or, can you set this project (module) at Drupal server so that Drupal 6.2 will be happy, please.

#94

LUTi - April 29, 2008 - 07:29

And, I agree that this module should be already in core.

#95

IceCreamYou - April 29, 2008 - 20:21

Can anything be done at my side to get rid of that?

http://drupal.org/project/update_advanced

#96

LUTi - April 30, 2008 - 07:21

IceCreamYou, thank you very very much.

My question is however still - how this module can be "declared" as "NOT SUPPORTED"? There are many other modules for older versions of Drupal (and, without any 6.x version yet, only available through patches for HEAD or 5.x-dev), but with "No available releases found" warning "only". Probably it is something different on Drupal server for this module and some other (such) modules...?

#97

LUTi - April 30, 2008 - 10:33

I am getting the following error on "/admin/user/settings" when submitting the form ("Save configuration" button):

warning: Missing argument 3 for _xmlsitemap_user_submit(), called in .../includes/form.inc on line 759 and defined in .../sites/all/modules/xmlsitemap/xmlsitemap_user/xmlsitemap_user.module on line 131.

I believe it is due to the mismatch of _xmlsitemap_user_submit(&$form, &$form_state, $form_id) function definition in xmlsitemap_user.module and $function($form, $form_state) function call in form.inc.

Does anyone know how to get the $form_id variable from $form array (I guess $form from function call is that, not the $form_id only...)? I've been looking all around for about an hour, no success... :-(

#98

wayland76 - April 30, 2008 - 11:03

http://code.google.com/soc/2008/drupal/appinfo.html?csaid=5C74EF3C2E7B0A...

Output views as XML -- could be relevant here :)

#99

IceCreamYou - April 30, 2008 - 21:34

Yeah, I get errors when the sitemap gets submitted. I don't know why any errors are happening, but I do know that the "Not Supported" message is accurate. There's a release of the module in the queue, and the maintainer of this module chose not to support a 6.x release until it's fully stable, which it's not yet.

And FYI, I've added a feature request to get this in core for 7.x - +1 it if you agree.

http://drupal.org/node/252846

#100

wayland76 - May 1, 2008 - 01:27

Status summary: We seem to be waiting on the language detection problems mentioned in #67.

The problem here seems to be path-based problems. It just so happens that, in the process of trying to fix another bug, I abstracted a lot of the code for working with paths out into separate functions.

http://drupal.org/node/202294

I would suggest that the stuff that does the multi-lingual paths properly will be much easier to implement once this patch is committed.

Can people please review that patch and see if it causes you any problems? Once that gets to the point where it's committed, I might find some time to get onto the path-based stuff here.

#101

rmiddle - May 1, 2008 - 01:42

The Patch from #74 has been running in my test site and working for several weeks with no problems.

Thanks
Robert.

#102

wayland76 - May 1, 2008 - 02:23

At another look, I'd guess that this patch already solves the domain-based problem.

#103

wayland76 - May 1, 2008 - 02:27

(ie. the patch mentioned in comment #100 is the one that I think solves some of the existing problems with this patch)

Robert: I presume yo