Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am a new user of this module. I have to import a large list of name/emailaddresses from an excel-sheet. To do this I save the sheet as a (unicode)text file. As a result all names have one or tabs (\t) and superfluous spaces in the name. I wrote a few lines of code that can help other users to cleanup the realname.
In the common function: _simplenews_realname_set_realname() before the drupal_write_record statement I inserted:
$realname = trim($realname);
$parts = explode("\t", $realname);
if ($parts > 1) {
$realname = implode(' ', $parts);
}
while (strpos($realname, ' ') !== FALSE) {
$realname = str_replace(array(' ', ' '), ' ', $realname);
}
If you find it of interest you can insert it in the module.
Thanks for you work.
Comments
Comment #1
sgabe CreditAttribution: sgabe commentedI think a preg_replace() would be nicer.
Comment #2
sgabe CreditAttribution: sgabe commentedClosing due to end of support for Drupal 6.