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

[3.x] Disable the frontpage view on new installs #612

Merged
merged 2 commits into from
Sep 4, 2023

Conversation

andybroomfield
Copy link
Contributor

Fix #549
for 3.x branch

Disable the /node view

Fix #549
for 3.x branch

Disable the /node view
@andybroomfield andybroomfield changed the title Disable the frontpage view on new installs [3.x] Disable the frontpage view on new installs Aug 24, 2023
@andybroomfield
Copy link
Contributor Author

So the issue here is that

$this->drupalGet('<front>');
$this->assertSession()->statusCodeEquals(Response::HTTP_OK);

Is trying to load the front page, which as this PR disabled the /node view and no other front page exits, won't now have anything there.

I did add an additional test with

// Test that the /node view is disabled.
$this->drupalGet('/node');
$this->assertSession()->statusCodeEquals(Response::HTTP_NOT_FOUND);

So I guess its down to how we want to proceed.
We could remove the test and accept that no default front page gets created, or we could install a dummy front page in place and test for it.

@markconroy
Copy link
Member

In the Annertech starterkit, we set /user as the frontpage, so we don't have the /node view, but it also gets us around the issue of not having any content yet.

@ekes
Copy link
Member

ekes commented Aug 25, 2023

All in favour of disabling /node, but we should set <front> directly then, probably to some welcome to you new site default content?
I'm almost surprised we didn't already, but maybe that was just with all the time spent on onboarding ux for microsites.

This is to allow a default accessible front page to exist on first install.
@andybroomfield
Copy link
Contributor Author

Have changed the default to /user for new installs.
I noticed an odd behaviour with this change when installing localgov_demo which sets a subsite as the default home page.
It requires a cache clear for the new front page to take effect, otherwise the user login page still shows. I assume this will be the case with setting other custom home pages too (though they take place in the context of site building).

andybroomfield added a commit to localgovdrupal/localgov_demo that referenced this pull request Aug 25, 2023
Fix #114

This is because if an install profile has set a front page, that will be
carried over until the cache is cleared.
See: localgovdrupal/localgov#612
andybroomfield added a commit to localgovdrupal/localgov_demo that referenced this pull request Aug 25, 2023
Fix #114

This is because if an install profile has set a front page, that will be
carried over until the cache is cleared.
See: localgovdrupal/localgov#612
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.

Good for now, thanks. @ekes suggested we might also want to add a piece of default content in the future.

@andybroomfield andybroomfield merged commit d66cfdc into 3.x Sep 4, 2023
4 checks passed
@andybroomfield andybroomfield deleted the feature/3.x-549-disable-node-view branch September 4, 2023 13:24
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.

4 participants