Posted by katbailey on October 28, 2010 at 8:17pm
6 followers
Jump to:
| Project: | Nodewords: D6 Meta Tags |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
Currently, when a new node is created, several new records get created in the nodewords table (for nodewords_basic: abstract, robots, revisit-after, keywords, description, copyright and canonical), even if no content for these nodewords has been entered. This is wasteful - there is absolutely no need for these records to be created until there is actual content being added.
The attached patch fixes this.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| non_empty_nodewords.patch | 2.42 KB | Idle | PASSED: [[SimpleTest]]: [MySQL] 0 pass(es). | View details | Re-test |
Comments
#1
Is this going to mess up the functionality of not wanting to provide specifically no meta tags for an item rather than the default meta tags?
#2
Ugh - is that really how that works? In order to not have default tags added to a node you have to send empty nodewords content to the db? Or is it not the case that when you're creating a node, the default content for the various tags gets added as default values in the form and thus would get saved as non-empty nodewords unless deleted before the form was submitted? I'll admit I'm not entirely familiar with the multitude of ways this module can be used...
#3
This is still a good issue to track. I'd say that our strategy should be as follows:
- If a default value is set and the default is unchanged when saving a metatag, nothing should be saved to the database.
- If a default value is not set and the field is left blank, nothing should be saved to the database.
- If a default value is set and the default is changed, the values should be saved to the database.
- If a default value is set and the default is left blank, the blank value should be saved to the database.
Or in a chart, here's what it would look like:
| Default exists | No default set--------------------------------------|-----------------|---------------
Field is blank | no db entry | no db entry
Anything other than default in field | save to db | save to db
Default value in field | no db entry | N/A
#4
subscribing
#5
I see two problems with that.
How can the module know if nothing saved in the database means to use the default value or the empty value?
If the default values are changed, what should the module do? Should the module find any meta tag without a value in the database, and save the default value for them? If the answer to the last question is yes, how can the module distinguish between the case where the meta tag value has been left blank, and the case where the default value has not been changed?
#6
I closed #1145010: Database performance and space efficiency as a duplicate of this.
#7
To properly handle this we'd almost need a checkbox to go with each tag to decide if the override should be used, then a bit of JS gravy to enable/disable the text field. Obviously that would need API changes and would make the module more difficult to use.