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.

CommentFileSizeAuthor
non_empty_nodewords.patch2.42 KBkatbailey

Comments

dave reid’s picture

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?

katbailey’s picture

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...

quicksketch’s picture

Status: Needs review » Needs work

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
mcurry’s picture

subscribing

avpaderno’s picture

- 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.

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?

damienmckenna’s picture

damienmckenna’s picture

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.

damienmckenna’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

Bumping this to v2.

damienmckenna’s picture

Status: Needs work » Postponed

Marking all v2 issues as postponed while v1 is finished off.

damienmckenna’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

Unfortunately this module is no longer supported, so I'm closing this issue.