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.
Continuation of http://drupal.org/node/13148.
Here's a proposed patch:
- Only vid is used for node_revisions so the 20th revision limit is gone.
- ORDER BY clauses added to avoid duplicate work.
- Only modify those nodes/comments with HTML formats (only if the HTML filter is present, or only if the default Full HTML format is used).
- Only modify those comments/nodes that were actually modified by the regexps.
- Report status percentage while update is going on.
Comment | File | Size | Author |
---|---|---|---|
#3 | link-updater_8.patch | 6.64 KB | matt westgate |
#2 | update.relative.links_0.patch | 6.51 KB | Steven |
update.relative.links.patch | 6.53 KB | Steven | |
Comments
Comment #1
Steven CreditAttribution: Steven commentedComment #2
Steven CreditAttribution: Steven commentedAck, left $limit at 1 for testing purposes.
Comment #3
matt westgate CreditAttribution: matt westgate commentedI tested the patch against nodes, node revisions and comments and it works great. One very minor tweak was to pass the text by reference as suggested in a previous post.
Comment #4
Steven CreditAttribution: Steven commentedCommitted to HEAD. Thanks for the review.
Comment #5
Dries CreditAttribution: Dries commentedThere is a regression. I re-synced http://scratch.drupal.org/ and the support and contribute pages are no longer converted.
Comment #6
Steven CreditAttribution: Steven commentedThat's because drupal.org has the codefilter in there too, so it is seen as a non-standard filter format. Better to be safe than to corrupt people's data.
Comment #7
Dries CreditAttribution: Dries commentedAre you saying that we can't upgrade a single drupal.org post?! (The default input format has the codefilter enabled so it is available to all users.) Furthermore, the contribute and support page are not using the codefilter. Not upgrading people's data, is corrupting it too.
Comment #8
Dries CreditAttribution: Dries commentedEither your explanation is wrong, or the update script is wrong. Posts that are formatted using the default input format are being upgraded despite the fact they use the codefilter. On drupal.org, posts with format 1 are upgraded. Please elaborate. Thanks!
Added some (handy) information:
Comment #9
Dries CreditAttribution: Dries commentedGot it now.
Comment #10
Steven CreditAttribution: Steven commentedI went ahead and added a fallback format condition. Now, any format with HTML in its name is also converted. This should deal with drupal.org correctly (and other sites with a similar set up).
Comment #11
deekayen CreditAttribution: deekayen commentedI take issue with the whole point behind update 178. I have relative URLs I don't want to be hard linked to the base_path(). That's why I like filters in Drupal; they don't modify the DB content, just the output. So I ask, why isn't this update done as part of a filter mod instead of gambling with the data source?
Comment #12
killes@www.drop.org CreditAttribution: killes@www.drop.org commenteddeekayen: good point, we should not tamper with user's data.
Comment #13
matt westgate CreditAttribution: matt westgate commentedThe reason this wasn't offered as a filter is mostly because of the perfomance impact of rewriting URLs dynamically. We opted for speed over portability, with the intention of making a contrib module to handle the portability aspect. For more details see
http://lists.drupal.org/archives/development/2006-03/msg00193.html
Comment #14
(not verified) CreditAttribution: commented