Hold donations with flagged donor names for moderation; reconcile lost side effects (schema v6)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
473fe192cd
commit
353f7ca5be
16 files changed
+681
-41
No files matched your search
@@ -61,4 +61,15 @@ final class Format {
|
||||
}
|
||||
return (string) $row['donor_name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* What is being held for review, from sg_donations.moderation_flags: 'Name', 'Message' or 'Name and message'.
|
||||
* Rows held before flags existed (empty value) were always held for their message.
|
||||
*/
|
||||
public static function flaggedLabel( array $row ): string {
|
||||
$flags = array_filter( array_map( 'trim', explode( ',', (string) ( $row['moderation_flags'] ?? '' ) ) ) );
|
||||
$name = in_array( 'name', $flags, true );
|
||||
$msg = in_array( 'message', $flags, true ) || ! $name;
|
||||
return $name && $msg ? 'Name and message' : ( $name ? 'Name' : 'Message' );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user