summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2021-04-29 09:45:46 +0100
committerGreg Roach <fisharebest@gmail.com>2021-04-29 09:45:46 +0100
commit324353bfa4834e2907a17a882ae20b5fd670479b (patch)
tree3ad741588a9527c0f06893b3dc6af6efe987f9ba
parent820e1c90e7ffd13114334a1cff3e4cea46e752e6 (diff)
downloadwebtrees-324353bfa4834e2907a17a882ae20b5fd670479b.tar.gz
webtrees-324353bfa4834e2907a17a882ae20b5fd670479b.tar.bz2
webtrees-324353bfa4834e2907a17a882ae20b5fd670479b.zip
Fix: #3868 - search/replace data-fix cannot see _LOC records
-rw-r--r--app/Module/FixSearchAndReplace.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/Module/FixSearchAndReplace.php b/app/Module/FixSearchAndReplace.php
index 71db640dab..3a0487bfa7 100644
--- a/app/Module/FixSearchAndReplace.php
+++ b/app/Module/FixSearchAndReplace.php
@@ -180,6 +180,30 @@ class FixSearchAndReplace extends AbstractModule implements ModuleDataFixInterfa
*
* @return Collection<string>|null
*/
+ protected function locationsToFix(Tree $tree, array $params): ?Collection
+ {
+ if ($params['type'] !== Note::RECORD_TYPE || $params['search'] === '') {
+ return null;
+ }
+
+ $query = DB::table('other')
+ ->where('o_file', '=', $tree->id())
+ ->where('o_type', '=', Location::RECORD_TYPE);
+
+ $this->recordQuery($query, 'o_gedcom', $params);
+
+ return $query->pluck('o_id');
+ }
+
+ /**
+ * A list of all records that need examining. This may include records
+ * that do not need updating, if we can't detect this quickly using SQL.
+ *
+ * @param Tree $tree
+ * @param array<string,string> $params
+ *
+ * @return Collection<string>|null
+ */
protected function mediaToFix(Tree $tree, array $params): ?Collection
{
if ($params['type'] !== Media::RECORD_TYPE || $params['search'] === '') {