Closed (fixed)
Project:
Splash Redirect
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
14 Feb 2019 at 18:35 UTC
Updated:
2 Mar 2019 at 22:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
adambernstein commentedThanks for reporting this. I can see why this is happening and will work on a fix to handle view pages for the next release.
Comment #3
semanthis commentedI 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...
Comment #4
adambernstein commentedIt'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>Comment #5
semanthis commentedJust 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...
Comment #6
adambernstein commentedThanks 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!
Comment #7
semanthis commentedThank 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
Comment #8
adambernstein commentedThanks 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.)
Comment #9
semanthis commentedThat 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.
Comment #10
adambernstein commentedI'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!