Hi everyone,

This issue occurs when, using ng-lightbox, i try to update or install any module with D8 admin (i don't know if it happens too using Drupal Console or Drush, i'm not skilled enough to master these tools).

INSTALLING A MODULE:

After the download step, myTestServer/core/authorize.php returns this screen ( "myTestServer" stands for an example):

The website encountered an unexpected error. Please try again later.
InvalidArgumentException: Source path http://myTestServer/admin/modules/install has to start with a slash. in Drupal\Core\Path\AliasManager->getAliasByPath() (line 191 of core/lib/Drupal/Core/Path/AliasManager.php).

Drupal\Core\Path\AliasManager->getAliasByPath('http://myTestServer/admin/modules/install')
Drupal\ng_lightbox\NgLightbox->isNgLightboxEnabledPath(Object)
ng_lightbox_link_alter(Array, NULL, NULL)
Drupal\Core\Extension\ModuleHandler->alter('link', Array)
Drupal\Core\Utility\LinkGenerator->generate(Object, Object)
Drupal\Core\Render\Element\Link::preRenderLink(Array)
call_user_func(Array, Array)
Drupal\Core\Render\Renderer->doRender(Array, )
Drupal\Core\Render\Renderer->render(Array)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1)
__TwigTemplate_3cde6740d352279c418edb9458fc178c1230f40579e1f6d162d9d8140ada6d57->doDisplay(Array, Array)
Twig_Template->displayWithErrorHandling(Array, Array)
Twig_Template->display(Array)
Twig_Template->render(Array)

...

INSTALLING A MODULE:

After the download step, myTestServer/core/authorize.php returns this screen:

The website encountered an unexpected error. Please try again later.
InvalidArgumentException: Source path http://myTestServer/update.php has to start with a slash. in Drupal\Core\Path\AliasManager->getAliasByPath() (line 191 of core/lib/Drupal/Core/Path/AliasManager.php).

Drupal\Core\Path\AliasManager->getAliasByPath('http://myTestServer/update.php')
Drupal\ng_lightbox\NgLightbox->isNgLightboxEnabledPath(Object)
ng_lightbox_link_alter(Array, NULL, NULL)
Drupal\Core\Extension\ModuleHandler->alter('link', Array)
Drupal\Core\Utility\LinkGenerator->generate(Object, Object)
Drupal\Core\Render\Element\Link::preRenderLink(Array)
call_user_func(Array, Array)
Drupal\Core\Render\Renderer->doRender(Array, )
Drupal\Core\Render\Renderer->render(Array)
...

The update process seems to achieve, as i refresh myTestServer/core/authorize.php, and then get a success message.

But it's confusing...

Thank you !!

Comments

romdouze created an issue. See original summary.

benjy’s picture

I still can't reproduce this, do you have Drupal installed in a sub-folder? I pushed a fix for that yesterday as well, make sure you're on the dev version of the module.

I can see that 'http://myTestServer/update.php' is getting into the service but that should be caught as external, can you try add this var_dump($url); at the top of isNgLightboxEnabledPath() for me and then paste the output here for the broken link?

romdouze’s picture

Benjy,

The last dev version of ng-lightbox was installed.

But today decided to start again from the beginning: i uninstalled and completely removed the 3 modules (Ng-lightbox, Colobox, Colobox_Load) origine of the issue, and then installed them again.

Then I tried to install and update a few modules, no trouble at all!!
No more InvalidArgumentException.

I can't explain that.
Is it possible that the numerous InvalidArgumentException i encountered altered something ?
I don't think cache is involved, because i spend my time clearing it.

Anyway, thank you, i'm sorry to have bother you, i let you know if this issue comes back .

Thank you again!
Romain

benjy’s picture

Status: Active » Fixed

Great, i'm guessing it was fixed by one of the last few commits, thanks for reporting these bugs. I'll tag a new release in the next week if everything seems stable.

Status: Fixed » Closed (fixed)

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