0

A client has recently been acquired by a new group and has requested that I do a search and replace for their name (for example Foo Housing Trust Group and Foo Housing Trust) and replace it with their new name (for example New Group).

Answers for How to fix millions of Alt Text are missing on body content? suggest to use the Search and Replace Scanner module.

Would using that module better than running a database query?

2
  • This was easy to do in 7 with a mysql find and replace, not so sure about 8.
    – Kevin
    Commented Mar 22, 2018 at 13:34
  • If you're okay with a stored procedure (it sounds like this only has to be ran once?) - this works in Drupal 8. I used this method myself to 'fix' bad links on a D8 site body content. It looks in any *_value table (common field table for text) and does a find and replace. kevinquillen.com/drupal/2017/07/13/… - be careful though, you'll definitely want to try and test it locally for your use case first.
    – Kevin
    Commented Mar 22, 2018 at 13:51

1 Answer 1

0

A possible alternative to achieve what you're trying to do, is to use a combination of these (commonly used) modules: Rules, Views and VBO.

With these modules in place, you could implement (for each of the fields that your question is related to) a variation of the solution described in my answer to "How to bulk update select list fields?", i.e.:

  • Create a Rules Component with a Rules Condition to checks if the field contains the string you're interested in (probably using a "text comparison" with a "regular expression" to find all variations).
  • Create a VBO enabled view of all nodes to be checked, whereas you'll use the Rules Component as your custom VBO action.

Repeat the above for each field (simply by adapting your Rules Component for each of these fields).

PS: I'm assuming this question is above D7 ...

Done ...

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.