Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Show uid in LogicException for existing membership #458

Merged

Conversation

xurizaemon
Copy link
Contributor

When using OG with migrations, the module can generate a series of import failures with exceptions that could be more useful.

[error]  LogicException: An OG membership already exists for group of entity-type node and ID: 8553 in Drupal\og\Entity\OgMembership->preSave() (line 466 of /var/www/localhost/drupal/web/modules/contrib/og/src/Entity/OgMembership.php). 
[error]  An OG membership already exists for group of entity-type node and ID: 8553 (/var/www/localhost/drupal/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:783) 
[error]  LogicException: An OG membership already exists for group of entity-type node and ID: 11100 in Drupal\og\Entity\OgMembership->preSave() (line 466 of /var/www/localhost/drupal/web/modules/contrib/og/src/Entity/OgMembership.php). 
[error]  An OG membership already exists for group of entity-type node and ID: 11100 (/var/www/localhost/drupal/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:783) 
[error]  LogicException: An OG membership already exists for group of entity-type node and ID: 11113 in Drupal\og\Entity\OgMembership->preSave() (line 466 of /var/www/localhost/drupal/web/modules/contrib/og/src/Entity/OgMembership.php). 
[error]  An OG membership already exists for group of entity-type node and ID: 11113 (/var/www/localhost/drupal/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:783) 

Including the uid in these exceptions will make the reported error more actionable; that information probably would be implicit when the exception is surfaced through a subscribe UI but is not apparent when migrating thousands of user memberships.

When using OG with migrations, the module can generate a series of import failures with exceptions that could be more useful.

    [error]  LogicException: An OG membership already exists for group of entity-type node and ID: 8553 in Drupal\og\Entity\OgMembership->preSave() (line 466 of /var/www/localhost/drupal/web/modules/contrib/og/src/Entity/OgMembership.php). 
    [error]  An OG membership already exists for group of entity-type node and ID: 8553 (/var/www/localhost/drupal/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:783) 
    [error]  LogicException: An OG membership already exists for group of entity-type node and ID: 11100 in Drupal\og\Entity\OgMembership->preSave() (line 466 of /var/www/localhost/drupal/web/modules/contrib/og/src/Entity/OgMembership.php). 
    [error]  An OG membership already exists for group of entity-type node and ID: 11100 (/var/www/localhost/drupal/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:783) 
    [error]  LogicException: An OG membership already exists for group of entity-type node and ID: 11113 in Drupal\og\Entity\OgMembership->preSave() (line 466 of /var/www/localhost/drupal/web/modules/contrib/og/src/Entity/OgMembership.php). 
    [error]  An OG membership already exists for group of entity-type node and ID: 11113 (/var/www/localhost/drupal/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:783) 

Including the uid in these exceptions will make the reported error more actionable; that information probably would be implicit when the exception is surfaced through a subscribe UI but is not apparent when migrating thousands of user memberships.
@amitaibu amitaibu merged commit 6302d0a into Gizra:8.x-1.x Jan 8, 2019
@amitaibu
Copy link
Member

amitaibu commented Jan 8, 2019

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants