Hi! I have written an old old search and replace tools way back for plone 2.x iirc. I found the code and pushed it to https://github.com/gogobd/GoReplace. There are some valuable ideas in the code. I do have some general interest in that idea.
Sitewide search and replace seems a great idea. Also, I found it interesting and would like to work on the same this summer. Please let me know from where I should start.
- What's the extension of this add-on as it's already mentioned in the readme that "By default, the product works with all known rich text fields of Plone contents".
- Does the code available at rt.bulkmodify supports Plone 5.1.x? As I could see the last commit was in Jan 2015.
- Also, I want to know that do I have a correct image of the project or not i.e. by this add-on, the admin could sitewide search and replace some rich text available in different content types without individual moving to those content type's text fields. Admin could search a regex with help of this add-on and check all the places from the result of the search where he wants to make a replacement. The functionality of the add-on is that "admin could sitewide search and replace rich text without moving to the content types individually."
BTW, I am Mohit Kuri, 3rd year undergraduate student in CSE department at IIIT Hyderabad.
It might also be helpful to look at https://github.com/collective/collective.searchandreplace,
as far as I know this works on both Plone 4.3 and Plone 5.1
There will be some additions to this package this year since we are looking at it for our plone 5 migration.
It does not include regex (anymore) or the option to search in portlets.
Our endusers have been using this for years in production (on Plone 4.3), so it is battle tested
Good or bad idea...we've never had this usecase in almost 20 years of Plone...a very tiny niche functionality with little impact for Plone and its usership.
That could be said of a lot of our features. We have so many, I've found even long time Plone content editors haven't seen things I show them.
Specifically about global search and replace: I've had it requested on a couple of sites, but I suspect more people would ask for it if they knew it was possible. There are other ways to solve the problem of changing the same thing in multiple places, however: an existing content tile if you're using Mosaic, the uwosh.snippets add-on, and there are probably others. Even at a lower level, template macros, portlets with ContentWellPortlets. The problem is there.
I just had this exact request from a client, and I used rt.bulkmodify. It works great. I just had to apply the suggested adapter from https://stackoverflow.com/questions/28591423/how-to-search-and-replace-dexterity-content-in-plone-using-rt-bulkmodify, and with a few minor modifications, it works for dexterity, too.
Sounds oddly like a PLIP to me!
It may be niche, but it also happens quite a lot if you have to maintain sites over years and years.
- organization changes name
- spelling powers-that-be change their preferred way of spelling a word (OK, this might not be universal, but some language groups have a "powers-that-be" institution that can change spellings. Those are not optional. They're requirements if you're in the gov business... )
- Luke wants to deny Anakin was ever their parent
- we were always at war with Oceania
there's quite a few use-cases where you do want to correct spelling, change names, or change a wording site-wide. The site-wide is the key thing here; if you put it in the search box and about 100K pages turn up, you really don't want to change them by hand. Especially if it turns up in Mosaic snippets, portlet thingies, and various other bits 'n bobs.
I could probably live without the regex (although I do love a good regex) but it's more common than you might think.
IMO: better keep it a well maintained addon.
A nice wrinkle on this idea would the ability to select a bunch of objects and be able to change the workflow state -instead of having to do this on a 1 by one basis.
Isn’t that doable via the Contents view? Or I guess you mean choosing items from all over the site, not just from one folder. Probably needs its own thread
your right! I'm an idiot scratch that idea.
It's a nice idea, just needs to be submitted as a GSoC 2020 proposal soon lookinatyoukid
We've used this functionality in production for years, a lot of our users have a use for it.
And it is very handy for us maintainers too.
In the mean time, collective.searchandreplace has also been refactored by @gotcha this year, see https://github.com/collective/collective.searchandreplace
It has registry options to select whether you want it to search in strings or lines fields, so you don't even have to add any adapters in your existing packages, it will search custom fields by default.
It also includes regex functionality. but I don't think it searches in portlets yet.