Problem/Motivation

"Empty" front page is not shown with the latest Drupal 8 build.

Steps to Replicate

  1. Using https://simplytest.me/ select Drupal Core 8.0.0-beta15.
  2. Add an additional project: empty_front_page
  3. Launch Sandbox and once the site is configured install the module.
  4. Creates some contents(Articles)
  5. Navigate to the front page and we don't see an empty front page.

Attached Images
module enabled

not empty page

Proposed resolution

Check the existing module's code why the alter is not working.

Remaining tasks

  1. Find and fix the bug.
  2. Write a integration test to validate while the module is enabled front page shows no content.

User interface changes

TBD

API changes

N/A

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aneek created an issue. See original summary.

aneek’s picture

Issue summary: View changes
Chi’s picture

Status: Active » Needs review
FileSize
3.45 KB

It was broken by this API change: https://www.drupal.org/node/2378809

Chi’s picture

This patch makes the module even more simple. I removed route subscriber and added a dedicated route '/empty' that displays empty page. I think it would be less tricky. Instead of altering existing route we can just ask the user to navigate to the 'Site information' page and set '/emtpy' as default front page.

aneek’s picture

@Chi, patch #4 looks much much more promising and removes the overhead of iterating a loop to find the front page assigned. I think this might need a test case. I'll have a go on the test case this week.. :)

Chi’s picture

@aneek, actually there should not be much overhead, because RouteSubscriber is only called on cache rebuild.

darol100’s picture

Status: Needs review » Needs work

I try #4 on RC2 and still not been empty.

Chi’s picture

@darol100, have you changed default front page as was mentioned in the note?

darol100’s picture

@Chi,

If I'm setting front page to a different page why I need to install this module in the first place ? Personally, I do not think it will make any sense to install this module if the method is point into a different page.

darol100’s picture

After playing around a little bit more, in D8 it seem like you need to have page as the front page. It was not like this back in D7. That being said, I think that what @Chi propose in #4 is not a bad solution. However, we should provide the ability to programmatically set the "Default front page" instead of providing some manual step.

I will leave it in "Needs work" so we can provide a patch that can set a default front page as empty.

Chi’s picture

After playing around a little bit more, in D8 it seem like you need to have page as the front page. It was not like this back in D7.

Drupal 7 also required this. It's why this module happened. )

I will leave it in "Needs work" so we can provide a patch that can set a default front page as empty.

Such a patch already provided in note #3.

darol100’s picture

Drupal 7 also required this. It's why this module happened. )

In D7 you do not need to set a page as default, you can remove it and leave it to nothing. In D8, if you do set your default front page as nothing it will redirect you to /user/[nodeid].

I will test #3 and see what happen. =)

Chi’s picture

@darol100 In D7 default front page is /node and in D8 the page is /user/[id]. That's the only difference.

javieras’s picture

I've tested patch4 in drupal 8.0.5 and it works! I think it would be interesting to set site information name to empty page title. It's only a suggestion ;)

Ronald van Belzen’s picture

FileSize
12.15 KB

I have made a configurable version of the module based upon patch#4

darol100’s picture

@Ronald van Belzen, we do not add compressed file in the issue queue. The workflow, usually is the maintainer of the project will make release and Drupal.org will create the compressed file.

Edit:
--------
@pfournier Why this have not been committed ? I set it up to Needs Works, but I was been very picky this patch should be ready for production. Or at least for a dev release.

Ronald van Belzen’s picture

I am having trouble understanding what you are saying, but when I did something wrong, I apologize.

darol100’s picture

@Ronald van Belzen, Sorry if my comment sounds a little bit harsh. If sounds like that I apologize, I did not mean too. I edit my previous comment so is more clear what I was trying to tell you.

I was telling you that, we do not upload compressed files to Drupal.org, because we cant review them and it might even be a security issue. Instead we provide patches. If you have done any improvement to the project and you will like to share in Drupal.org write a patch instead of uploading a compress file.

Ronald van Belzen’s picture

FileSize
10.05 KB

Another try.

Baart’s picture

Could not patch #19, but the zip works just fine :)

(Stripping trailing CRs from patch; use --binary to disable.)
patching file empty_front_page.info.yml
(Stripping trailing CRs from patch; use --binary to disable.)
patching file empty_front_page.links.menu.yml
(Stripping trailing CRs from patch; use --binary to disable.)
patching file empty_front_page.permissions.yml
(Stripping trailing CRs from patch; use --binary to disable.)
patching file empty_front_page.routing.yml
(Stripping trailing CRs from patch; use --binary to disable.)
patching file empty_front_page.services.yml
(Stripping trailing CRs from patch; use --binary to disable.)
patching file EmptyFrontPageController.php
(Stripping trailing CRs from patch; use --binary to disable.)
patching file EmptyFrontPageSettingsForm.php
patch: **** malformed patch at line 176: path. Change the Site information setting for Default front page first!', ['%token' => $current]));
Ronald van Belzen’s picture

FileSize
20.31 KB

Regenerated the patch diff from #19 again. I hope now it does not cause problems.

Dom.’s picture

@Ronard van Belzen: I can't get your patch to apply.

However, I have issues with with how this issue tries to solve the problem:
#4: suggest a new route at URL /empty (which means I could not get a node called 'empty')
#21: suggest to add an admin form, so the admin could choose himself a path name to an empty to set his front path to this. This gaves two configs (one in the module, one at admin/config/system/site-information) to do this simple thing

I would humbly suggest another approach described here:
#2783325: Update D8 version of this module to latest core devs
with a patch attached for review: no config, no extra routes added, no looping over every routes as done now in RouteSuscriber.

toomanypets’s picture

I applied and tested Dom's patch from #2783325-2: Update D8 version of this module to latest core devs. Success. I suggest we close this issue, then review/commit patch in #2783325. It's simple and clean.

toomanypets’s picture

Status: Needs work » Closed (duplicate)

Closing as duplicate of #2783325: Update D8 version of this module to latest core devs which has an RTBC patch waiting for commit.

mpark’s picture

Still is not commit to the last dev?