- πΊπΈUnited States HongPong Philadelphia
see also #3123393: Users are duplicated β re usernames
Thanks to CI experimenting ( β¨ Add-Improve Gitlab CI testing Active ) I saw the \Exception parameters are wrong.
Thinking about adding: src/Exception/UsernameNotExistException.php :
namespace Drupal\wordpress_migrate\Exception;
/**
* Class UsernameNotExistException.
*
* @package Drupal\wordpresss_migrate\Exception
*/
class UsernameNotExistException extends \Exception {}
and in WordPressMigrationGenerator.php:
class WordPressMigrationGenerator {
// This is necessary to use $this->t on UsernameNotExistException message.
use StringTranslationTrait;
and adjust the exception like so:
// Determine the uid mappings, creating an author migration if needed.
if ($this->configuration['default_author']) {
$account = user_load_by_name($this->configuration['default_author']);
if ($account) {
$this->uidMapping = [
'plugin' => 'default_value',
'default_value' => $account->id(),
];
}
else {
throw new UsernameNotExistException($this->t('Username @name does not exist.',
['@name' => $this->configuration['default_author']]));
}
}
As of alpha6 still seem to be getting this with non existent users in the system when it initially parses but then it still imports ok.Active
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
see also #3123393: Users are duplicated β re usernames