Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix media check on default domain #174

Merged
merged 1 commit into from
Jul 1, 2022
Merged

Conversation

ekes
Copy link
Member

@ekes ekes commented Jun 30, 2022

When the microsites controller tries to add a node on the default domain (in a group or for the control site itself):-

The website encountered an unexpected error. Please try again later.
AssertionError: Cannot load the "group" entity with NULL ID. in assert() (line 295 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).

assert(, 'Cannot load the "group" entity with NULL ID.') (Line: 295)
Drupal\Core\Entity\EntityStorageBase->load(NULL) (Line: 19)
localgov_microsites_media_node_create_access(Object, Array, 'localgov_page')

Patch adds a check for group_id before loading it. Also does an attempt to pull from the path as alternative to domain as addition - would only be needed if a site admin was on the control site, but it was a quick easy add for that occasion (or if the controller is masquerading as them to do something on the control domain)

Also does an attempt to pull from the path as alternative to domain.
Copy link
Member

@finnlewis finnlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirm that I get the error without this change and that the error goes away with this branch.

@ekes ekes merged commit 67385d9 into 1.x Jul 1, 2022
@finnlewis finnlewis deleted the fix/1.x/media-permissions-check-fatal branch January 16, 2023 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants