Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If a node get's unpublished all link references should be deleted, but they are not deleted. This is a bug in D6 only as it was fixed in the large D7 upgrade path in Upgrade hook_node_insert/update/delete.
We need to backport this patch to D6.
Comment | File | Size | Author |
---|---|---|---|
#3 | Issue-2125719-by-hass-Links-in-unpublished-nodes-are.patch | 1.58 KB | hass |
Comments
Comment #1
hass CreditAttribution: hass commentedPatch attached
Comment #2
hass CreditAttribution: hass commentedThere seems to be no unpublish test. We should write one to verify if this patch works. BUt the test is required for both D6 and D7.
Comment #3
hass CreditAttribution: hass commentedDon't forget the changelog entry
Comment #4
AlexisWilke CreditAttribution: AlexisWilke commentedThat looks good while editing a node. However, I'd afraid it won't work in all cases. If you publish / unpublish a node from the admin/content area, is the nodeapi('update') getting called as expected? (it may, I just am not 100% sure that it is on a simple status change like that.)
If that works, then the fix is correct and will function in all cases as long as you don't currently have "broken links". Because the batch won't go and delete links from unpublished nodes with this patch.
Also I agree with your statement, the comments most certainly have the same problem since these can also be published / unpublished.
Comment #5
hass CreditAttribution: hass commentedThe _linkchecker_add_node_links() function will remove the link references no longer in a published node. Every 24h all unused links will be removed. This works in batch() and node_save() both the same way.
Comment #6
hass CreditAttribution: hass commented