Score:1

Why does the error 'You have requested a non-existent parameter "site.path"' occur on module configure buttons?

mr flag

When I click some configuration buttons for example in layout builder UI or the following buttons. enter image description here I get the following error in admin/reports/dblog

Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException:
You have requested a non-existent parameter "site.path". en Drupal\Component\DependencyInjection\Container->getParameter() 
(linea 328 de /var/www/html/core/lib/Drupal/Component/DependencyInjection/Container.php)

A coworker with the same local but using windows (without wsl) has everything working normally. I used docker and ddev on ubuntu 22.04 LTS and on windows but with wsl, it doesn't work on both. Could it be something about permissions? I have sites/default/files and sites/default with a+w permissions

As the title says I am using Drupal 8.9.20 and I really do not know what to do.

If you need more information just ask me for it and I will edit the post.

Debugger data when gets to line 328 enter image description here

id flag
The error says that some module or theme on the site is referencing 'site.path', which is not an existing container parameter. I think the parameter is called '@site.path': https://www.drupal.org/node/3080612
Jordi Bustos avatar
mr flag
Yeah I check that but I wasn't able to find a 'site.path' reference without the @
id flag
This is similar to https://drupal.stackexchange.com/questions/309827/runtimeexception-you-have-requested-a-non-existent-parameter-app-root
Jordi Bustos avatar
mr flag
I check that too but I'm not using %site.path% anywhere
id flag
You will have to use a debugger then. I don't think we can answer the question without more information.
Jordi Bustos avatar
mr flag
What other information could I provide in order to help you to help me :P
id flag
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/145103/discussion-between-cilefen-and-jordi-bustos).
id flag
It looks like this is caused by the anchor_link module. What is the version of this module on the site?
Jordi Bustos avatar
mr flag
I updated the post with some useful info. Please check it.
Score:1
cn flag

The error is caused by the module CKEditor Anchor Link:

/modules/contrib/anchor_link/src/Plugin/CKEditorPlugin/AnchorLink.php

 /**
   * Get the CKEditor Link library path.
   */
  protected function getLibraryPath() {
    // Following the logic in Drupal 8.9.x and Drupal 9.x
    // ---------------------------------------------
    // Issue #3096648: Add support for third party libraries in site specific
    // and install profile specific libraries folders
    // https://www.drupal.org/project/drupal/issues/3096648
    //
    // https://git.drupalcode.org/project/drupal/commit/1edf15f
    // ---------------------------------------------
    // Search sites/<domain>/*.
    $directories[] = \Drupal::getContainer()->getParameter('site.path') . "/libraries/";

The last line listed works only in Drupal >=9.

You will find an increasing number of modules switching to Drupal 9/10 because Drupal 8 is no longer supported. The only issue here is that the module is still marked as Works with Drupal: ^8 || ^9 || ^10.

You either need to upgrade to Drupal 9 (recommended) or downgrade the module.

As a quick fix, until you find time to upgrade to Drupal 9, you can patch this code line to work with Drupal 8:

$directories[] = \Drupal::service('site.path') . "/libraries/";
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.