Closed figureone closed 10 months ago
I was going to open another issue, but it is related to this, so I will add my comment here. When reading the description [--recurse-objects] Enable recursing into objects to replace strings. Defaults to true; pass –no-recurse-objects to disable.
I understand that adding the flag will make the search and replace to Enable recursing. And just not adding that flag will disable the recursing into objects. So this part is confusing: "Defaults to true; pass –no-recurse-objects to disable."
Can someone explain if the search and replace command include by default the "recursing into objects to replace strings" when no flag is added?
Thanks
Note the replacement type is still
PHP
; it should beSQL
since the--no-recurse-objects
flag is present.
This is incorrect. When --no-recurse-objects
is used, wp search-replace
will skip any serialized objects it finds, not forcefully replace them with SQL (https://github.com/wp-cli/wp-cli/pull/2222).
Can someone explain if the search and replace command include by default the "recursing into objects to replace strings" when no flag is added?
Yes, this is the default behavior.
Bug Report
Describe the current, buggy behavior
Aloha, although the docs describe a
--no-recurse-objects
flag:https://developer.wordpress.org/cli/commands/search-replace/
it doesn't seem to be respected. We tried variants of
--recurse-objects=false
but there doesn't seem to be a way to get a falsey value into the flag.Describe how other contributors can replicate this bug
On vanilla WordPress:
Describe what you would expect as the correct outcome
Note the replacement type is still
PHP
; it should beSQL
since the--no-recurse-objects
flag is present.Let us know what environment you are running this on
Provide a possible solution
Probably just add the flag in
Search_Replace_Command.php:invoke()
, below the flag vars:Though this isn't tested.