BURs: fix mass update A -> B not being allowed.
Fix mass updates of the form `mass update A -> B` not being allowed. This was originally because after `rename` was introduced, we wanted to prevent people from using mass updates to move tags. Now, `mass update A -> B` adds B to all posts tagged A instead of moving A to B. So `mass update A -> B` should no longer be disallowed. This also makes it so that it's an error to create a mass update with a syntax error in the search. Before searches couldn't have syntax errors, but now with the new query parser it's possible.
This commit is contained in:
@@ -116,11 +116,10 @@ class BulkUpdateRequestProcessor
|
||||
end
|
||||
|
||||
when :mass_update
|
||||
lhs = PostQuery.new(args[0])
|
||||
rhs = PostQuery.new(args[1])
|
||||
query = PostQuery.new(args[0])
|
||||
|
||||
if lhs.is_single_tag? && rhs.is_single_tag?
|
||||
errors.add(:base, "Can't mass update #{args[0]} -> #{args[1]} (use an alias or a rename instead for tag moves)")
|
||||
if query.is_null_search?
|
||||
errors.add(:base, "Can't mass update #{args[0]} -> #{args[1]} (the search `#{args[0]}` has a syntax error)")
|
||||
end
|
||||
|
||||
when :nuke
|
||||
|
||||
Reference in New Issue
Block a user