MODx Bug/Feature Tracker and Feature Requests
Welcome to the MODx CMS Tracker. Please choose the appropriate project from the drop down menu and provide as much information as possible regarding your server environment and browser. Thanks!
FS#767 — Document 'Has Keywords' Flag Not Reset If Last Keyword Deleted
Attached to Project —
MODx
Opened by Paul Gregory (PaulGregory) - Friday, 26 January 2007, 05:34AM
Last edited by Jason Coward (opengeek) - Saturday, 12 May 2007, 12:41PM
Opened by Paul Gregory (PaulGregory) - Friday, 26 January 2007, 05:34AM
Last edited by Jason Coward (opengeek) - Saturday, 12 May 2007, 12:41PM
| Task Type | Bug Report |
|---|---|
| Category | Core Distribution |
| Status | Closed |
| Assigned To |
Jason Coward (opengeek) |
| Operating System | All |
| Severity | Medium |
|---|---|
| Priority | Normal |
| Reported Version | 0.9.5 |
| Due in Version | 0.9.7 |
| Due Date | Undecided |
| Percent Complete |
|
Details
How to repeat:Add a keyword to the system (Manage META Tags and Keywords)
Associate it with a document.
Remove the keyword from the system (at Manage META tags and Keywords)
View source of document - you'll see <meta name="keywords" content="" />
If you save the document again, the empty keywords tag will disappear.
This is only critical if you are switching from the MODx keyword system to a different way of building the meta tag because you may end up with two sets of meta keywords in your header in a lot of pages (making the 'resave document' workaround awkward).
Some quick digging in the code shows that line 610 of document.parser.class.inc.php uses a check of ($this->documentObject['haskeywords'] == 1) to see whether to output the keywords.
I therefore assume that removing a keyword from the manager does not trigger a refresh of the 'haskeywords' flag on all documents. Whilst my example is the last keyword in both the system and the document, it is possible that a keyword could be removed from the system that was not the last keyword in the system but was the last keyword in the document.
I believe that removing one or more keywords *should* trigger a refresh of the 'haskeywords' flag on all documents.
An alternative 'fix' would be to double check whether $keywords is empty, but that would leave us with a 'haskeywords' flag that can't be trusted.
(Incidentally, I can confirm that removing a keyword correctly removes references in modx_keyword_xref)
This task depends upon
This task blocks these from closing
Closed by Ryan Thrash (rthrash)
Thursday, 25 September 2008, 10:08PM
Reason for closing: Deferred
Additional comments about closing: Keywords will likely be deprecated in a future modx version in favor of TVs
Thursday, 25 September 2008, 10:08PM
Reason for closing: Deferred
Additional comments about closing: Keywords will likely be deprecated in a future modx version in favor of TVs
- Field changed: Due in Version (Undecided → 0.9.7)
- Field changed: Severity (Low → Medium)
- Task assigned to Jason Coward (opengeek)
I am looking into a fix for this in 0.9.7