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

Feature/1.x/146 url aliases #175

Merged
merged 8 commits into from
Aug 2, 2022
Merged

Feature/1.x/146 url aliases #175

merged 8 commits into from
Aug 2, 2022

Conversation

ekes
Copy link
Member

@ekes ekes commented Jun 30, 2022

Test with an update to HEAD of group_domain
and on a content type with url alias field enabled, which is all localgov types I found other than the new page one for which I'm making another PR.

Should allow alias to be set for the domain on which the content is being edited.
Will allow multiple aliases to be set should content be in multiple domains (current set up actually already allows two, one for the control site and one for the group domain in the case you are editing content that is in a domain group but doing so on the control domain).

@finnlewis
Copy link
Member

On first test, I get an error when trying to add a url alias to a new directory channel.

I did a fresh install.
Created microsites 1
Created admin 1
Assigned admin1 to microsite 1
Logged into microsite 1
Create a directory facet type
Create a directory channel
Give it an alias of /contact
I get the following error:

The website encountered an unexpected error. Please try again later.

Drupal\Core\Entity\EntityMalformedException: The "node" entity cannot have a URI as it does not have an ID in Drupal\Core\Entity\EntityBase->toUrl() (line 161 of core/lib/Drupal/Core/Entity/EntityBase.php).
Drupal\domain_path\DomainPathHelper->submitEntityForm(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 592)
Drupal\Core\Form\FormBuilder->processForm('node_localgov_directory_form', Array, Object) (Line: 320)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object, 'default', Array) (Line: 368)
Drupal\group\Entity\Controller\GroupContentController->createForm(Object, 'group_node:localgov_directory')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I'm out for a bit but can test more later this afternoon.

@ekes
Copy link
Member Author

ekes commented Jul 1, 2022

Confirmed: localgov_page works; localgov_directories_channel errors.

@ekes
Copy link
Member Author

ekes commented Jul 1, 2022

Confirmed: localgov_page works; localgov_directories_channel errors.

It's because it uses the two step form. Which in the first case we can fix by stopping using the two step form; but I'll see if I can't make a patch for domain_path to stop it trying to create an alias before the content is actually saved.

@ekes
Copy link
Member Author

ekes commented Jul 2, 2022

https://www.drupal.org/project/domain_path/issues/3293894

I guess, except for rewriting the module, we make some patch for ourselves that overrides the form alter in the case of what looks like a group two-step form and sets a message somewhere that it won't work with domain_path.

ekes added 2 commits July 4, 2022 17:11
Domain Path doesn't support multi-step forms. Issue https://www.drupal.org/project/domain_path/issues/3293894
Solution outside of rewriting the module is to set a notification for
our specific case of group multistep wizard forms #175 (comment)
Copy link
Member

@stephen-cox stephen-cox left a comment

Choose a reason for hiding this comment

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

Functionally this is working fine. Just a minor issue about where to put the permissions for this.

config/install/user.role.authenticated.yml Outdated Show resolved Hide resolved
@ekes ekes mentioned this pull request Jul 18, 2022
5 tasks
ekes added a commit to localgovdrupal/localgov_microsites_group that referenced this pull request Aug 1, 2022
@ekes ekes requested a review from stephen-cox August 1, 2022 11:44
ekes added a commit to localgovdrupal/localgov_microsites_group that referenced this pull request Aug 2, 2022
@ekes
Copy link
Member Author

ekes commented Aug 2, 2022

@stephen-cox assume we can get this is now localgovdrupal/localgov_microsites_group@454c848 is in

Copy link
Member

@stephen-cox stephen-cox left a comment

Choose a reason for hiding this comment

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

Great - let's get it in

@ekes ekes merged commit 90644fb into 1.x Aug 2, 2022
@stephen-cox stephen-cox deleted the feature/1.x/146-url-aliases branch October 14, 2022 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done sprint 8
Development

Successfully merging this pull request may close these issues.

3 participants