Closed (fixed)
Project:
Nodewords: D6 Meta Tags
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
22 Sep 2009 at 17:12 UTC
Updated:
3 Jan 2014 at 00:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
avpadernoThe code has been changed.
Comment #2
digi24 commentedWhoops, I respect your decision, but I must admit I was quite shocked.
In my view this is one of the reasons to use this module. If you are worried about html-tags in the metatags, well the strip_tags command is already there... I think you will be generating many support request when people start updating after the security issue mail.
All I want to say:
Feel free to close this issue, but please add a note to the settings page that this possibility has been abandoned.
Comment #3
avpadernoAnother reason I removed the feature is that other restrictions for the meta tag content are different from the restrictions for the node teaser. If you are the administrator of the Drupal-powered site, then you will probably be able to keep the node teaser short enough to make it suitable to be used as meta tag , but the other users of the site could not be aware that they need to make the node teaser not too long.
See what the description for the form field says:
%countis 255 by default.I will add a note in the file README.txt.
Comment #4
gregarios commentedI will miss this feature. I wish there was at least an option to have the first 255 characters of the teaser be the meta description, without HTML in it. :-( I'm sorry to say I will have to reconsider even using this module if it can't supply an automated description of some kind.
Comment #5
avpadernoActually, I had to remove any reference to the feature in the README.txt.
Comment #6
fenstratI'd have to say this is a pretty serious ommision. Like others, I find it was a great feature of this module.
Surely at least having an admin option, as mentioned, to strip_tags and then limit to 255 characters is needed. Most clients hardly ever look at their meta tags, auto generating them is not ideal, but it is a very user friendly feature.
I'm afraid I'll be sticking with my patched version unless this is becomes an option.
Comment #7
avpadernoIf you are looking for a module that auto-generates the meta tags basing on the options set by the administration user, there is Integrated Metatags.
Comment #8
carusen commentedThis is a pretty bad decision. I loved this feature and now I have to update lots of articles to set the description. :(
That's quite a lot of work.
I've used the module you propose and now i get the following problem: I want to have the description tag on all pages. If i use the 2nd module you propose, I get description tags for all articles and none for the homepage.
If i enable the description tag in nodewords & use the 2nd module I get two description tags on the articles and one on the homepage.
It is really hard to fix this issue and I believe it was a bad design decision to get this feature out this module. It makes people's lives much harder.
Comment #9
jeni_dc commentedI have to comment on how I agree that this was a bad decision. I agree with others that a choice would most certainly be welcomed. Not only to give people the chance to choose who are new to the module, but for the people who have been using it for a long time as well.
I for one have only lost just one description tag because of upgrading the module on one client's site, but if I did it on another site of mine I would have lost thousands.
I kindly ask you to reconsider this.
Comment #10
fenstratThe int_meta module simply doesn't have all the features I need. nodewords does.
This modules user base suggest that people like the features this module has, and judging by the comments in here it seems this is one of the desired features.
Comment #11
mikeytown2 commentedThis is a must. All too often crawlers miss the important text and display the menu items as the description on search results pages. While not perfect, this module did get the job done. Please bring this back!
Comment #12
mikeytown2 commentedComment #13
gregarios commentedEven a description tag based on the title, like the new dc.title tag has, would be preferable to none at all. Some search engines use this tag when deciding what descriptive text to display text next to their links of sites.
Comment #14
fenstratBit of a show stopper this one. I aggree with priority critical. Due to the security fix site's are now showing up with "Security update required!".
Yet an update means auto generated descriptions will be nuked.
Comment #15
avpadernoDid anybody look for issues related with the generation of the meta tag from the node teaser?
Comment #16
jeni_dc commentedI just searched the issues for "Description" and couldn't see anything of relevance to this topic. Please forgive me if there are issues out there in the forums or elsewhere, I did a quick search in the forums and got way too many pages of results to go through in the time I have at the moment to look for relevant posts.
If the main issue here as to why the feature was removed is HTML tags in the teaser being output, then comments #2 and #6 propose using strip_tags to ensure the teaser is output correctly. I've actually had issues on other sites with tags being output in the teaser and used contemplate with strip_tags to output a proper description tag and views as a workaround for getting a proper teaser displayed on my site.
If a solution was put into place where strip_tags or another method was used to output an auto generated teaser that didn't contain any tags or other improper formatting, I believe that would make everyone involved happy. I, for one, would certainly be!
Comment #17
DocMartin commentedI too had liked the description from teaser feature.
I'd rather have description that might have some html (whatever that might do), than none at all!
Possible to make this an option, with warning saying it's naughty to have html in descriptions and you have been warned??
Comment #18
DocMartin commentedJust tried adding a description to a page.
I use fckeditor; found that the paragraph codes were saved with the description.
So, to really eliminate html from the meta tags, best to also ensure a wysiwyg editor doesn't work for the editing fields, or at least note that if they do so, you use "source" code editing option so that don't accidentally insert html.
Comment #19
avpadernoThe code used
strip_tags(); that is not the problem. Creating a node teaser in the wrong moment causes problems with some content types (see #364682: Conflict with Ubercart / Ubercart Auction).I am not than convinced that a node teaser is thought to be used as description of a node; it could be used as a kind of summary, but it is not a description.
Comment #20
jeni_dc commentedI've just gone through the issue you had linked to. Am I right to believe that the issue is now fixed? It looked that way from the thread.
If so, I'm not sure why this feature would have been removed. As you have said:
If this is an argument as to what exactly a description should be, maybe that should be left to the site administrators.
In an ideal world, everyone posting content to a website would take the time to write a unique description for each of their pages, and let's face it, people won't. That's where an auto generated description is a life saver. In my experience, my clients, some tech and internet savvy, some not, never really get the importance of meta tags, and can't be bothered to fill them out. So for the most part, I don't even allow the end users to modify the tags and I let them get auto generated. That way there's a description for every page, no matter what. Also, the fieldset adds clutter to the add node form for people who don't fully understand what it does, and in the end, in my opinion, can cause more harm in usability than good. Non technical people get scared by it, and get put off.
There are also many instances where nodes are generated automatically, I have a few such sites where that happens and they all have thousands of nodes. It's not practical to write descriptions for each of them, or that's all I would do all day.
In the end, I don't think the people who want this feature care if it's the node teaser or not, it's about having a way for the description tag to be generated automatically. And not having all of your description tags disappear when upgrading the module because of a security fix.
Comment #21
DocMartin commentedGiven the way Nodewords used to work, I started writing teasers with idea they might be used as descriptions.
Teaser should grab readers' attention, encourage them to want to read more. So could be good as snippet for search results.
Plus, teasers can be better than nothing - and better for search results snippets than some of content that Google, say, can grab.
Too bad re the conflicts; had been a nifty option.
- possible to include as option, with warning things could go awry?
Especially for active forums, handy to have auto-generated descriptions, as otherwise quite a faff to create one for each thread.
Comment #22
avpadernoNodewords is not thought to auto generate meta tags; it simply helps in create the content of the meta tags, which can always be overwritten by the user.
If you don't like the user to change the content of the meta tags, then you can change the permission used for the rules of the users (there is a permission for each meta tag).
Another alternative is to use Integrated Metatags, which is thought to generate the content of the meta tags from values obtained from the node (through tokens, or taking the content of CCK fields).
About auto generating the content of the meta tags, Nodewords will implement a page to auto generate them in the future.
Comment #23
DocMartin commentedYet the comparison of Nodewords and Integrated Metatags notes:
[I've added comment, saying this isn't the case with updated version]
I've started using Integrated Metatags, for descriptions from teasers (chiefly for forums, so far); yet not so great to have it at same time as Nodewords (which I still have as I wrote custom descriptions tags for several article pages).
Hope you manage to soon implement the page for auto-generating tags!
Comment #24
avpadernoI reported in that forum topic that the differences between the two modules were not valid for the version I was developing.
Comment #25
sytru commentedI'm surely abandoning this module in favour of Integrated Metatags, due to lack of this must-have feature. Bye.
Comment #26
avpadernoI have marked #586846: No automatic teaser description after upgrade as duplicate of this report.
Comment #27
Moonshine commentedOuch... this security update certainly came with some changes. I thought I was out of the woods after finding the new hook names (which seem to be buried in a issue), but this change I don't really understand.
Why not at just leave the option available and defaulted? It's certainly going to annoy a lot of people who are just updating for security, and it's not as though it didn't serve some purpose.
I vote for its return as well! :)
Comment #28
nirad commentedhow serious is the security issue in the update? i will likely be rolling back to the previous version or switching to Integrated Metatags
Comment #29
mikeytown2 commented@KiamLaLuno
You are killing this module. You need to put this feature back in. In less then 24 hours you have 10+ people complaining, and with a project of this size (30k users) it's only going to get a lot worse.
Will you accept a patch, or are you going write the patch?
Comment #30
fenstrat#29, mikeytown2 - Couldn't agree more.
And yes, KiamLaLuno, will you accept a patch?
Comment #31
mikeytown2 commentedworking my way back from the point of tag insertion seeing where one can easily inject the description.
For a node with nid of 50
Implement drupal_alter; grab $output_tags & $tag_options find description and set if empty
Hardwire way to hook in
In the above code, IF $parts[1] == 'description' && empty($content) THEN $content = node's teaser
Comment #32
mikeytown2 commentedAnother way would be to mod the basic_metatags_description_prepare() function.
Already sets the description for terms & vocabulary; nodes could easily be done here. This is the best option IMHO.
Comment #33
mikeytown2 commentedUntested patch, should work.
Comment #34
mikeytown2 commentedThis better conforms to the nodewords pattern. Still missing an on/off button, if description is empty, it will grab from teaser. Still untested.
Comment #35
mikeytown2 commentedAbove patch WORKS! It needs to go through all the filters though, image assist gets outputted. This patch fixes that.
Comment #36
mikeytown2 commenteddo trim; kill any white space at begging or end.
Comment #37
mikeytown2 commentedI'm happy with the next patch. Goodnight.
Comment #38
avpadernoI will read the feature.
The last patch reported here needs work; nodewords.module doesn't use a constant for the content limit, but it uses the value reported in the settings by the administrator user. Also, any call to function that filters the meta tag content are done by nodewords.module for all the meta tags added; it's not the task of the prepare functions do that.
Comment #39
mikeytown2 commentednodewords_output_tags() only does a check_plain(). Teaser can have almost anything in it. Once it is stripped to just text, then there will be less then the maximum value in it, if all the checks are moved to the nodewords_output_tags function.
Comment #40
mikeytown2 commentedactually because of the check_plain we need to decode, then encode; cut to length, then decode. Otherwise we risk the chance that this is over the max limit or characters get double encoded.
Comment #41
avpadernoThe attribute for the element is declared of type CDATA, which is described as (see http://www.w3.org/TR/html401/types.html#type-cdata):
I re-added the feature in the development snapshot; the only difference with the previous code is that
node_access()is not called as it is not really necessary (especially because the module knows when Drupal is outputting an error 403 page, and outputs a different set of meta tags).Comment #42
avpadernoBasing on what reported in the W3C, the call to
explode()is not necessary, and the other code needs to be moved to the function that creates the HTML output.Comment #43
k74 commentedWith this patch works again that the description tag is automatic?
Comment #44
mikeytown2 commented@k74
yes automatic description tags from the teaser are back.
@KiamLaLuno
wordwrap splits up the text, delimited via "\n"; the explode("\n", ...) is necessary, its what cuts the string to the correct length.
Comment #45
avpaderno@miketown2: The browsers are supposed to replace any carriage return with a space (see my previous comment); that code could be removed, then.
The other code can be moved to the function that creates the HTML output, as most of the meta tags require the same treatment (i.e., HTML tags should be removed also from the meta tag ).
Comment #46
mikeytown2 commentedLooking at
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/nodewords/b...
I like the idea of grabbing the alt text. Issue I still see is the max description length isn't always set to it's max, it can be under. Using http://api.drupal.org/api/function/truncate_utf8/6 is better then my patch. The last thing to do IMHO is trim so it fits; might want to move that to the nodewords_output_tags() function.
Comment #47
avpadernoThe maximum description length is the maximum length a meta tag content can have; it's not the length the meta tag content must have.
Does the code I committed for this feature need to be modified?
Comment #48
mikeytown2 commentedimage assist gives
[]as output and&characters get double encoded as&; length is not set to 255, I got 484 for one of my nodes.Comment #49
avpadernoThe problem of the HTML entities being encoded twice is already reported in a different report (see #587094: HTML entities cannot be used in the meta tags content).
The output you get is caused by the fact the attribute probably contains an empty string, or is not set at all. The part of the code was already present in previous versions.
I would then mark this report as fixed, and open a new report for the problem you reported.
I don't understand why the meta tag is longer than the limit set by the module; the meta tag description is truncated by
node_teaser($node->body, $node->format, variable_get('nodewords_max_size', 255)).node_teaser()contains the following code:I noticed that the code I wrote is missing a part I thought I have already added, and which could cause problems when the node body is using the PHP input format.
As the feature has been already added, I am marking this report as fixed; I will create another report for the changes that needs to be done to the code.
Comment #50
k74 commentedwith this patch in some nodes do not see the description tag with the description automatically generated and other
yes, for no apparent reason...
Comment #51
elioshUsing 6.x-1.2
I solved in this quick and dirty way:
Comment #52
Chad_Dupuis commentedsub
Comment #53
mikeytown2 commentedGrab the latest dev or use my patch. They both work and are alt ways of doing it.
Comment #54
avpadernoThe code reported in #51 will cause problems with some custom content types defined from third-party modules (there is already a report about Ubercart).
I suggest to not use it.
Comment #55
DocMartin commentedJust giving latest patch a try, and not successful so far.
Only seeing single letters for descriptions, keywords.
- such as
meta name="description" content="I"
meta name="copyright" content="C"
Also, not sure if auto-generating is working.
Comment #56
rubensans commentedAuto-Generating keywords and description was the best of this module; Please re-enable it.
Thanks.
Comment #57
Gerard McGarry commentedJust upgraded my Nodewords modules to the latest version and came up against the issues described here. I'm glad I did it on my personal site rather than my important production sites though.
I don't want to sound snappish, because it's easy to make mistakes, but the auto-generated meta descriptions are a KEY FEATURE of Nodewords, so to find it has disappeared completely without warning is a little bit upsetting. Yes, I understand that the Integrated Metatags module does a similar job, but considering Nodewords is the recommended module for generating meta information, it's essential that feature is re-enabled as soon as possible.
If you need any help testing, please get in touch - I'm happy to run patched versions on my test server.
Comment #58
avpaderno@#57: The feature is already re-added; as usual in Drupal development, the code is first added in the development snapshot, and an official release is then created by the development snapshot code.
Comment #59
DocMartin commentedAs noted, latest dev didn't work for me. [I'm adding note here as important enough that people should not overlook this]
Nearly went to Integ Metatags, but thought I'd try mikeytown's patch. For 1.2 version.
I'm not good w unix, so did a cut n paste patch - may help someone: opened file to change in text editor, found the same line in mikeytown's patch as the one above his lines to add (marked with + signs), copied and pasted this in, and deleted the + signs. Saved file
Then, uploaded the 1.2 nodewords, inc dev, replacing the dev version.
Found I needed to clear cache. Descriptions - main things I'm concerned about - back.
[just noticed
<p>- which turns out to be code for paragraph start at start of a description, similar code at the end; but I don't care too much about that just now!]Thanks, mikeytown!!
Comment #60
WildBill commentedI agree that auto-generated Descriptions was a key feature of this module, and it's really a bad decision to remove it.
I wonder if you counted the number of people who need this module to work smoothly with Ubercart vs. the number of people who want auto-descriptions like they used to be, which would be the larger?
Comment #61
gregarios commented...and couldn't you check for the existence of Ubercart and disable it just for those people?
Comment #62
WildBill commented...or just make it a selectable option, rather than removing it outright?
Comment #63
WildBill commentedThe patch in #40, while much appreciated, is including image captions at the beginning of the meta description tag, which is not ideal. The old way (before the upgrade) worked just fine. Can we return that functionality? If not, I will have to think seriously about rolling back to version 1.0, vulnerability or not.
Comment #64
mikeytown2 commented@WildBill
try the latest dev
Comment #65
WildBill commented@mikeytown2 - what about the big red warning on the project page that warns not to use the dev version on a production site?
Comment #66
locomo commentedsubscribe
Comment #67
vegemite4me commentedI am so glad I found this out on my own site, and not that of one of my customers. Thank you for listening to your users and adding this feature back to Nodewords.
Does any one know when the 6.x-1.3 production version will be available? I am not familiar with the "development snapshot code" that KiamLaLuno mentions.
Comment #68
giorgio79 commentedI have installed the 6.1.2 dev but not seeing any descriptions. Any ideas?
Comment #69
avpadernoSee the referring version, which is 6.x-1.x-dev; this mean the code has been fixed in the development snapshot (it is not possible to fix the code of an official release if not creating another official release, which is created from the development snapshot code).
Comment #70
mikeytown2 commented@KiamLaLuno
Do you have an ETA for 6.x-1.3?
Comment #71
avpadernoI had to clean up the installation files for the Nodewords modules, which included many update functions related with development snapshot to development snapshot updates. I also had to clean up the code to fix any problems created when I changed the module names from the wrong ones to more correct ones.
My intention is to create an alpha version in the next days, but I would not want to make the mistakes I made with the previous official releases I created. It would be useful if I would have more reports from people passing from version 6.x-1.1 to the development snapshot, to be sure the update is possible (even if I imagine there could be problems with people having a lot of meta tags set).
I first apologize for the wrong releases I published; the worry of seeing the module unpublished because a security issue (which was not anyway present in the code I developed) didn't allowed me to better plan the release of version 6.x-1.1. Still, this has been solely my mistake.
Comment #72
giorgio79 commentedKiam, I personally am grateful for your work on the module, there is nothing to apologize for. Taking the effort and working on it means more than other stuff. Only those dont make mistakes that dont work :)
Comment #73
leo pitt commentedDitto, I installed the security update and then discovered the feature is gone.
This feature is the main reason I installed nodewords in the first place, it needs to be back and working in a stable release for me to use the module, so I am downgrading to 6.x-1.0.
Comment #74
WildBill commentedI'm thinking about downgrading to 6.x-1.0 as well...
Comment #75
mikeytown2 commentedRemember there is a patch for 1.2 at #40
Comment #76
funana commentedHighly critical, because if you update to this version without checking the changes that have been made you could get kicked out of google index.
If google finds hundreds or thousands of pages of your site with the same description it will not show them anymore (although they still are indexed).
So glad that I checked it immediately after installing this version. Patch at http://drupal.org/node/584720#comment-2081160 works fine.
Nevertheless, thank you again for this module. Must have.
Comment #77
WildBill commentedThe patch at #40 is not perfect... it doesn't work the way the old module used to...
Comment #78
giorgio79 commentedhi Kiam,
In the latest dev from the 17th I don't have any meta descriptions showing, even though I ticked to enable it.
Would you have any ideas?
Cheers,
G
Comment #79
giorgio79 commentedSorry, I did not have "Use the node teaser if the description meta tag is not set" enabled.
I enabled it, but I got a fatal error:
Comment #80
avpadernoIt is better to make a different report for that error.
Comment #81
k74 commentedIn the new version 1.3 alpha1 the option "Use the node teaser if the meta description tag is not set" is still missing, a patch
to activate? The patch #40 is not valid for the new version
Comment #82
avpadernoBy a mistake, the form field was only activated for the content type forms. This is now fixed in the development snapshot.
Comment #83
k74 commentedI upgraded to the new dev version but I still see the option "Use the node teaser if the description meta tag is not set" where is it?
Comment #84
giorgio79 commented#83 do you mean you dont see it?
Because it disappeared for me, and I cant see it.
Comment #85
avpadernoYou need to wait until 12:00 PM UTC, to use the correct development snapshot.
Comment #86
k74 commentedok, with the latest dev version does appear and it works
Comment #87
dawansv commentedI tested 6.x-1.3-alpha2.
I see that there is the option to set "Use the node teaser if the description meta tag is not set" either globally (in admin/content/nodewords) or independently for each content type (via the edit option in admin/content/types). I think this is nice.
The global option is working well.
Problem is with the second option (for each content type): I can see and modify the check box when editing a content type, but when I save the content type it does not save my changes. Basically the check box at the content type level always reverts to mirroring the global option: when the global option is on, I can see that it is also checked for all content types, when the global is off, it is unchecked for all content types, but with no way to make changes at the content type level.
Thanks for this great module.
Comment #88
hass commented@dawansv: #612210: Global settings not shown on settings page
Comment #89
giorgio79 commentedThanks Kiam, the new dev version works marvels for me.
I expecially like the option to remove alt tags from descriptions if generated from teasers.
Great job!
Comment #90
dawansv commented@hass: not sure how #612210: Global settings not shown on settings page is related to my problem. My problem is not with global settings not appearing, but with the "description from teaser" option not being saved from the content type edit screen (it appears there just fine)...
Can anybody else reproduce that? Edit a content type, and under the Meta Tags Settings try to change the "Use the node teaser if the description meta tag is not set" option... Then save the content type and reedit to see if your change was saved...