Hi,

Firstly: Thank you for the plugin - it's great!

Repeatable: Always
Steps to repeat:
1. Install page_manager and page_manager_ui
2. Setup a page
3. Set the path to "/"
4. Visit /admin/structure/page_manager directly.
5. System error if debugging is not turned on.

Modules enabled:
- page_manager
- page_manager_ui
- panels

Expected Results:
Obviously my take away from this was that path shouldn't be set to "/" , however, maybe a error during the UI step would work best?

Actual Results:

InvalidArgumentException: The user-entered string '' must begin with a '/', '?', or '#'. in Drupal\Core\Url::fromUserInput() (line 204 of core/lib/Drupal/Core/Url.php).
Drupal\page_manager_ui\Entity\PageListBuilder->getPath(Object) (Line: 37)
Drupal\page_manager_ui\Entity\PageListBuilder->buildRow(Object) (Line: 229)
Drupal\Core\Entity\EntityListBuilder->render() (Line: 83)
Drupal\page_manager_ui\Entity\PageListBuilder->render() (Line: 22)
Drupal\Core\Entity\Controller\EntityListController->listing('page')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
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}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Once again - thanks for the great work.

Comments

kieranja created an issue. See original summary.

joelpittet’s picture

Status: Active » Needs review
Related issues: +#2835742: InvalidArgumentException on using external paths
StatusFileSize
new775 bytes

I ran into this as well exactly as indicated. Here's a patch that at least doesn't throw an error, but maybe another solution is necessary to prevent people from putting in '/'?

Could be related to #2835742: InvalidArgumentException on using external paths

sd42’s picture

I ran into this issue too and can confirm that the patch resolves the white screen, thanks!

karolus’s picture

I applied the patch in comment #2, and was able to test, and successfully create a page with the path of /. As @joelpittet remarks, though, this presents a UX and site building challenge.

I would propose a dialog/error message that prevents users from adding / as a path.

japerry’s picture

StatusFileSize
new1.54 KB

I think we need to look at this a little differently, you shouldn't be able to make a page manager route be just simply '/'

here is a patch to add that validation.

karolus’s picture

StatusFileSize
new177.1 KB

Confirmed that @japerry's patch in #5 works. This is in core 8.5.1 running PHP 7.0. Here's the output:

Alert when adding a path of /

Status: Needs review » Needs work

The last submitted patch, 5: 2909040-5.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

japerry’s picture

Status: Needs work » Needs review
StatusFileSize
new2.2 KB

Fix the if statement.

Status: Needs review » Needs work

The last submitted patch, 8: 2909040-8.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

karolus’s picture

StatusFileSize
new158.78 KB

Confirmed @japerry's patch in #8 is working, with core 8.5 on PHP 7

Test result:
Alert from text result.

japerry’s picture

StatusFileSize
new2.22 KB

lets try this again!

japerry’s picture

Status: Needs work » Needs review
karolus’s picture

Patch by @japerry in #11 working here.

  • japerry committed db7365a on 8.x-4.x
    Issue #2909040 by japerry, karolus: Prevent / from being a valid path.
    
japerry’s picture

Status: Needs review » Fixed

Fixed!

Jordan_fr’s picture

happens again after updating the module on page : https://SITENAME.com/admin/structure/page_manager

Jordan_fr’s picture

Status: Fixed » Needs work
Jordan_fr’s picture

Status: Needs work » Fixed

my fault - one page was with no path and implies this error

Status: Fixed » Closed (fixed)

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