If You define Your frontpage to be a view (eg. search) then the config-form will not be saved showing an error "You must configure a default front page node first. Check System >> Basic site settings >> Default front page." what makes the module at the current state quite ununsable in certain cases.

Comments

semanthis created an issue. See original summary.

adambernstein’s picture

Assigned: Unassigned » adambernstein
Status: Active » Needs work

Thanks for reporting this. I can see why this is happening and will work on a fix to handle view pages for the next release.

semanthis’s picture

I just started working on that. I think a toggle in the form, that the redirect should happen from the front-page (whatever the frontpage is...) would fit in most of the cases. By this the splash_redirect.source could be set e.g. to "front", so that in the EventSubscriber the $config->get('splash_redirect.source') could be checked for the value "front". If I could figure out how to check if current route is i might even get it working that way...
Thanks for Your answer...

adambernstein’s picture

It's because entityautocomplete expects a "node" in the source field, but a view display doesn't qualify as node. I would just need to adjust the form input and default value to support routes that aren't associated with a node.

Until I have time to add that feature, you may want to try embedding your view as a block in a something like a basic page, and then use the basic page as your <front>

semanthis’s picture

Just as a after-midnight-solution a simple patch...not nice but effective...My front-page is a Search-API view, I don't want to touch this now anymore...Thanks for Your help.
P.S. it would be even easier to change the behaviour of the EventSubscriber by just changing the behaviour of an empty value in the splash_redirect_source field...but sorry I was to tired to see that earlier...

adambernstein’s picture

Status: Needs work » Needs review

Thanks for the patch, but again the issue was better addressed by accepting paths/aliases for the source page instead of a node entity ID. Whether or not the page was set to <front> is somewhat irrelevant. Also as a future piece of advice, you should no longer be calling out to the Drupal global service container (in your line \Drupal::service('path.matcher')->isFrontPage()). The best practice is to use dependency injection instead.

Please try out the latest -dev release and let me know if it fixes the issue for you.
Thanks!

semanthis’s picture

Thank You for the instant responce. I tired out the new dev in my setup but I get a 500 Error. Here is the logging message:

Location https://neuesammlung.code-is-gold.com/en/admin/config/search/splash_redi...
Referrer https://neuesammlung.code-is-gold.com/en/admin/config
Message InvalidArgumentException: Source path has to start with a slash. in Drupal\Core\Path\AliasManager->getAliasByPath() (line 186 of /.../core/lib/Drupal/Core/Path/AliasManager.php).

Drupal 8.6.4
PHP 7.2.15-1+ubuntu16.04.1+deb.sury.org+1

adambernstein’s picture

Thanks for reporting. I think your configs will need to be updated. Please download latest -dev (Feb 16) and run updates. (Note that this will disable your existing splash redirect and you must go into settings and reconfigure the module.)

semanthis’s picture

That was the problem...Everything now works perfect. I actually hate splash.screens but it's a requirement I meet so often, so this module is finally a perfect solution for that. You are great, thank You.

adambernstein’s picture

Status: Needs review » Fixed

I'm very glad it worked for you! I hate splash pages too, but I am also required to use them often. So if we are forced to use them, we should at least have something works well!

I'll build this fix into the next release (8.x-1.5), but you can continue to use the -dev release for now. Thanks for reporting the bug!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.