Just playing with DEV (28 Apr 10) and noticed that the CONTENT of the robots tag is not comma separated for 'legacy' nodes (it's set to indexfollow for most). However, for nodes subsequently edited (or new nodes) everything is just fine... commas in all the right places.

Doing a bit more investigation it seems that this is a legacy problem from an older version of the module(I've been running with module for a while and lately working my way through the betas of the awesome 6.x-1.12). I had tried the various upgrades at around betas 4 and 5 and wondered if this problem was addressed during such upgrades (didn't seem to quite go as smooth as possible)... or whether it's something that goes back a really long way.

For info, I ran the following update query on my MySQL database which sorted things out:

UPDATE nodewords SET content = REPLACE(content, 'indexfollow', 'index, follow') WHERE name='robots';

Not sure if there's much that can be done in the module (feel free to change to 'Won't fix'), but I thought it may be worth posting this for those Googling this problem.

Comments

Anonymous’s picture

Status: Active » Postponed (maintainer needs more info)

Thanks for your report, and helping in pointing out when the meta tag content is not correct; I have effectively seen the problem once, but I was not then able to reproduce it successively.

Does the SQL query work also for PostgreSQL? If it works, I can then add an update function to update the meta tags content.
Once again, thanks for your help.

snorkers’s picture

I know little about PostgreSQL, but a quick look at documentation indicates that the same query would work (I had thought the REPLACE bit was MySQL-only).

I've had a quick look back myself and not able to reproduce it on a vanilla D6 install, so no idea where the lack of commas slipped into the module upgrades.

CinemaSaville’s picture

Not sure if this is related, but although the default setting for Robots is index/follow, in the node edit, the actual default comes up as noindex/no follow. Is this connected? Thanks

Anonymous’s picture

From where I am now I cannot connect to the test site I normally use to test my modules, but as I remember the database used by the module saves the serialized string of an array, for the meta tags ROBOTS; in such case, does the proposed query really fix the issue?

snorkers’s picture

Yes it does.... the REPLACE element just does a string search and replaces the characters of the 2nd arg with the characters in the 3rd, so the rest of the 'content' string is left untouched.

Anonymous’s picture

The output of serialize(array('index' => 'index', 'follow' => 'follow')) is the string a:2:{s:5:"index";s:5:"index";s:8:"follow";s:8:"follow";}. Executing the reported query could not change the content of the database, as the database should not contain the string 'indexfollow'.

snorkers’s picture

All my Content fields in the Nodewords table for name=robots are of format a:3:{s:5:"value";a:0:{}s:11:"use_default";i:0;s:12:"index_follow";s:11:"index, follow";} since I ran the SQL query at issue top; before I ran the query, it was the same except s:11:"indexfollow"; was the final string element.

Nobody else seems to have encountered this, so maybe I made a mistake during the many upgrades of 6.x-1.12 beta. Possibly not worth fretting over too much.

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Fixed

Now I am back home, and I can access the test site I use.

I found an error in an update function that was not creating the correct value for the meta tag ROBOTS; I changed that update function, and added a new update function that executes the query you reported.

The form field for the meta tag uses values without a space; using the value with a space would probably cause the form field to not use the correct value.

Thanks for your report, and help.

Anonymous’s picture

The values to correct are also indexnofollow, noindexfollow, and noindexnofollow. I have updated the update function to correct also those values.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Status: Closed (fixed) » Fixed

All my Content fields in the Nodewords table for name=robots are of format a:3:{s:5:"value";a:0:{}s:11:"use_default";i:0;s:12:"index_follow";s:11:"index, follow";} since I ran the SQL query at issue top; before I ran the query, it was the same except s:11:"indexfollow"; was the final string element.

The value s:11:"index, follow" is not correct. The number after s: is the length of the string reported after the second colon; the string index, follow is 13 characters long, not 11 characters. This causes a PHP error, and probably the values used for the meta tag ROBOTS were not correct.

I created a new update to fix the values for the meta tag ROBOTS.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.