Questions tagged [debugging]

Use it for questions about module and theme debugging (e.g. "How do I debug this situation?").

Filter by
Sorted by
Tagged with
0 votes
0 answers
48 views

drush uses development.services.yml though not present in settings.php

I am currently observing that drush seems to use development.services.yml from web/sites though development.services.yml is not added via settings.php. Doing drush php:eval "var_export(\Drupal::...
Stefan Korn's user avatar
  • 1,212
0 votes
0 answers
46 views

Getting errors after using Layout Builder

The rest of the site works as expected. This is the error I get when trying to access content from the http://barrio.local/admin/content link. Warning: Undefined array key 0 in C:\xampp\htdocs\apps\...
David Barrett's user avatar
-3 votes
1 answer
103 views

"Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginNotFoundException"

I get this exception, which does not say which plugin causes it. Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginNotFoundException The "" entity type does not exist. at /var/...
Oskar Calvo's user avatar
2 votes
2 answers
233 views

Struggling to enable twig debugging

Update: I've realized that neither my settings nor settings.local files are doing anything. I placed die() and print statements throughout both files, rebuilt cache, and see nothing. I'm stumped. ...
Evan's user avatar
  • 33
-3 votes
1 answer
51 views

Why do I get this exception? [closed]

I'm getting this error constantly and I can't quite figure out what's wrong. TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in strpos() (line 126 of core/lib/Drupal/...
acey's user avatar
  • 19
0 votes
1 answer
190 views

How can I debug an "access denied" on almost every webform?

I checked every configuration section that I thought could affect access to webforms. Except for the sample content named Demo: Application (/node/371 in my context), every webform - the URL prefix is ...
AppLEaDaY's user avatar
0 votes
0 answers
59 views

How to use microsoft graph toolkit within a custom module?

I am creating a custom module and want to use microsoft graph toolkit, specifically the file-list component (https://learn.microsoft.com/en-us/graph/toolkit/components/file-list). I've created a ...
Jordan's user avatar
  • 27
0 votes
1 answer
385 views

Attribute Array to String Conversion Error

I'm getting this error now on most pages within a complex 9.5.3 site running PHP8.1: Array to string conversion in Drupal\Core\Template\AttributeArray->__toString() (line 77 of core/lib/Drupal/...
Rob Carr's user avatar
-1 votes
1 answer
146 views

How to determine the cause of sudden "content encoding error"s for logged-in Drupal users? [closed]

One day last week or so, seemingly out of the blue, logged in sessions started to throw content encoding errors. The site still works fine for anonymous users. There's nothing in error_log, clearing ...
lynxlynxlynx's user avatar
1 vote
1 answer
558 views

Troubleshooting a Drupal HTTP 500 when there are no error log messages

I have reviewed some websites on how to troubleshoot HTTP 500 on a Drupal site and most often I have seen a PHP error by running drush ws in the console, however, I have been running into an oddity ...
Mark L's user avatar
  • 13
3 votes
1 answer
137 views

Can phpstorm infer the entity type from \Drupal::entityTypeManager()->getStorage()?

Curious whether it's possible to get phpstorm to infer entity types when loading them via entity storage, e.g. \Drupal::entityTypeManager()->getStorage('node)->load(1), without needing to use ...
Mrweiner's user avatar
  • 1,921
3 votes
2 answers
574 views

Enable xdebug on Lando using Pantheon recipe and PHPStorm

I am trying to enable xdebug on Lando using the pantheon recipe. I have tried different tutorials, but PHPStorm does not seem to connect to Lando, or xdebug is not correctly enabled on Lando. recipe: ...
Tyler Durden's user avatar
  • 2,316
0 votes
0 answers
44 views

How can I debug during installation?

I tried to install Drupal 9.4.2 in a MySQL-compatible database, but I got these errors. How can I debug during installation or just print out the incompatible SQL statements?
Vincent's user avatar
1 vote
1 answer
480 views

Can I debug Twig templates with Twig Xdebug and Apache Netbeans?

I am trying to debug Twig templates in Drupal 9, using WAMP, Apache Netbeans, and the Twig Xdebug module on Windows 7. I have already set up NetBeans so I can debug PHP code in Drupal 9. They are ...
vasilis's user avatar
  • 49
1 vote
2 answers
514 views

How can I log a stack trace when I throw an exception? Is the logger PSR-3 compatible?

I'm trying to log a stacktrace when I throw an exception as suggested here. I tried this: catch (\Exception $e) { \Drupal::logger('mymodule')->error($e->getMessage(), [ 'exception' => $...
Patrick Kenny's user avatar
1 vote
1 answer
61 views

Search is very slow for certain roles

I'm a bit lost here. I have a strange problem and don't know where to begin. I use the core search function on a website I build. When I am logged in as administrator this search function is working ...
Joost's user avatar
  • 1,218
1 vote
1 answer
122 views

How to find module that is updating my node after insert

When trying to create a new book i get the following message: Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '53' for key 'PRIMARY': ...
Joost's user avatar
  • 1,218
1 vote
2 answers
4k views

Enable error logging from settings.php

I am facing a The website encountered an unexpected error. error while setting up the site. Most of the documentation I found online suggest to enable logging in the setting.php file. I added this ...
jayaprakash R's user avatar
0 votes
1 answer
2k views

How do I debug Drupal\Component\PhpStorage\FileStorage::createDirectory()?

On my site, I am getting this warning. Alert: User warning: mkdir(): Permission Denied in Drupal\Component\PhpStorage\FileStorage->createDirectory() (line 123 of core/lib/Drupal/Component/...
Kamal Oberoi's user avatar
0 votes
1 answer
40 views

Devel Generate keeps generating files after uninstalling it

Some time ago I removed Devel from my site because it is in production now. However, when I look at the Content list I still see files being generated, like generateImage_J4d7CV.png and nq3cv2oMx9.txt ...
C.A. Vuyk's user avatar
  • 227
1 vote
1 answer
543 views

How do I get the un-truncated error message from dblog?

The "Recent log messages" is very handy to track down errors on sites. While this works great for errors in PHP code, it is often unhelpful for errors in Twig code. E.g. I've this error ...
Hudri's user avatar
  • 5,286
0 votes
1 answer
346 views

Disable theme debugging html comments in particular view?

we are running commerce site, still tweaking some bits, so we have still twig debug set to true, but site is already online.. we have XML feed for exporting commerce products to couple of price ...
Zdeněk Nováček's user avatar
-1 votes
1 answer
73 views

Webform 6.1.0 help text not showing

I updated my webform Module from 5.3.0 to 6.1.0, I have one the Following Error: the help text isn't displaying its content on any form on my site (Example of help icon in the shared image) It should ...
OmarAc's user avatar
  • 7
0 votes
1 answer
567 views

Webform 5.3 to 6.1.0 , Error : Call to undefined method Drupal\webform\Routing\WebformUncacheableResponse::addCacheableDependency() [closed]

I updated the webform module from 5.3.0 to the latest version (6.1.0) and then when I click submit on one of my forms, I receive this ERROR: Error: Call to undefined method Drupal\webform\Routing\...
OmarAc's user avatar
  • 7
0 votes
1 answer
1k views

How can I debug a Twig error that occurs after migrating from Drupal 8.9 to Drupal 9+

I am trying migrate my Drupal 8.9 site to Drupal 9+ and I am stuck with an error its cause I am not able to hunt down. On almost every page I get the following PHP exception: Twig\Error\RuntimeError: ...
user5950's user avatar
  • 2,018
3 votes
1 answer
166 views

Details wanted for "Mismatched entity and/or field definitions" message on custom field

I have developed a custom Drupal field. All works fine. We are already using the field in production for a year. But the status report for exactly this field says: Mismatched entity and/or field ...
Philipp Zedler's user avatar
1 vote
0 answers
366 views

How to find the cause of "Uncaught PHP Exception"

When I go to any page, the following error appears in the log: [proxy_fcgi:error] [pid 20333] [client 172.18.0.6:52608] AH01071: Got error 'PHP message: Uncaught PHP Exception Symfony\\Component\\...
Søren Sjøstrøm's user avatar
0 votes
1 answer
307 views

How do I debug overridden twig templates?

How do I debug the template overrides. The debugger stops on page.html.twig but doesn't stop on sub templates such as web/themes/custom/localtheme/templates/field--paragraph--field-pbcrossfade-image--...
Interlated's user avatar
  • 1,405
-1 votes
1 answer
358 views

After upgrade to Drupal 9.2: Call to undefined function escapeshellcmd(). Why?

When I want to submit a form (webform module) I get get the followng error: Call to undefined function Drupal\Core\Mail\Plugin\Mail\escapeshellcmd() in Drupal\Core\Mail\Plugin\Mail\PhpMail::...
universaldenker.org's user avatar
0 votes
0 answers
29 views

Permissions suddenly changed

I've inherited a drupal 7.6 site with a broken css (styles were not loading). Here's what I've done so far: -set sites/default/files, tmp and cache folder to 777. -flushed all caches When this didn't ...
Harv's user avatar
  • 1
-2 votes
1 answer
980 views

The website encountered an unexpected error. Please try again later. unable to debug

I have just moved a Drupal 7 site to a new server. The website loads ok but if I log in as an admin person and click on any of the admin menu options I get the error The website encountered an ...
Helen Postle's user avatar
1 vote
2 answers
52 views

Strange Page not Found, Permissions, Clear cache

On my D7.80 I have developed a custom module: function wrong_answer_menu() { dd('it entered in hook menu'); $items['wrong-answer/%id'] = array( 'title' => t('Wrong Answer Dashboard'), ...
MMT's user avatar
  • 41
1 vote
1 answer
2k views

Attempting to merge in an array of items into Twig classes

I have a Twig template where I'd like to merge in an array of items as classes. So far I have this code: {% set classes = [ 'media', 'media--type-' ~ media.bundle()|clean_class, not media....
Danny Englander's user avatar
6 votes
1 answer
1k views

How to I trigger Xdebug 3.x with Drush in PHPStorm

Has anyone has success with getting CLI debugging (drush) working with Xdebug 3.x? There are several obsolete posts here... but all obsolete with the new version of Xdebug. Expected behavior After ...
sea26.2's user avatar
  • 994
0 votes
0 answers
206 views

How can I print debug info in custom module?

I need to edit parts of a custom module that I didn't make, and I don't really have much experience editing/coding custom modules. How do I print debug info in functions in a custom module? In the ...
Eluchel's user avatar
  • 325
1 vote
0 answers
256 views

Drupal + XDebug + VSCode = can't break on PHP notice or warning

Using Drupal (8.9), PHP (7.2.34) with xdebug, and VSCode (1.50.1) with PHP Debug (1.13.0), the debugger will no longer break on PHP notices and warnings, even if those option checkboxes are set. The ...
Dan Chadwick's user avatar
1 vote
2 answers
399 views

Debugging node/route access

I want to set a breakpoint in xdebug to debug an interesting issue the site is having regarding user access to certain nodes. My question is where do I do that in D8? Where, specifically, is the D8 ...
JAyenGreen's user avatar
0 votes
1 answer
1k views

Debugging Ajax Callback

Goal: Print/dump $formState values to debug I am altering a form and the functionality works: $form['elements']['location']['deparment']['#ajax'] = [ 'callback' => 'myAjaxCallback', 'event' =&...
Armando Silva's user avatar
1 vote
1 answer
740 views

twig dump() creates WSOD error

this is my first Drupal installation (I'm a symfony dev) and I've spent several hours trying to get dump() working. However it just causes a WSOD. Maybe related: I'm unable to install kint, there's ...
cameron cameron's user avatar
3 votes
1 answer
918 views

Debug PHP code with XDebug and VS Code [closed]

For development I use a local Drupal 7 installation on Xampp under Windows 10. I use Visual Studio Code as IDE and want to debug my PHP code with it. I tried to set that up but can not quite get it ...
juergen d's user avatar
  • 183
0 votes
1 answer
353 views

The "Modules" page doesn't load

I am running a setup on Ubuntu and WSL (Windows Subsystem for Linux) with Nginx and PHP7.4. Drupal 8 and Drupal 9 fresh installations load every page with no problem, except the page on /admin/...
user3108268's user avatar
0 votes
0 answers
147 views

how to print node object in drupal 8 [duplicate]

in drupal 7 we could use kpr() from devel module or php print_r() and var_dump() functions to print $node object in node.tpl file or hook preprocess node in purpose of debugging and finding a field or ...
Ali_Hr's user avatar
  • 121
-3 votes
2 answers
1k views

How can I prevent memory size exhaustion when dumping variables in Twig? [duplicate]

hello everyone i have a problem with kint , in my twig page i want to listing all variables contains int 'content' variable to make some logic on it , but the page can't loaded because the big pip ...
drupal love's user avatar
4 votes
1 answer
770 views

How to attach xdebug to drush in docker

How can I "attach" xdebug to drush in a docker container? By that I mean, how can I have xdebug show me a history of an import script? And to look at the single variables that are defined and ...
webuser57's user avatar
1 vote
0 answers
470 views

Render HTML in Drupal 8 error messages

I'm working with Twig templates, and often see messages like this in the browser when I make a mistake: The website encountered an unexpected error. Please try again later.</br></br><...
apostl3pol's user avatar
1 vote
0 answers
506 views

PHP Fatal error: Cannot redeclare twig_without() [closed]

Getting the below error after I tried to install new modules to D8. [error] 32411#32411: *31 FastCGI sent in stderr: "PHP message: PHP Fatal error: Cannot redeclare twig_without() (previously ...
john michael's user avatar
3 votes
1 answer
168 views

Difference between $bundle and bundle()

Background information: I'm trying to manipulate the available options of a list type text field, depending on the host bundle: function wtbase_options_list_alter(array &$options, array $context) ...
Hudri's user avatar
  • 5,286
1 vote
1 answer
249 views

Why can't I debug twig templates with intellij idea?

I can't get intellij idea to break on twig files. It is breaking on theme and module files fine. This means that xdebug must be setup correctly. I don't believe that it is caching as I've deleted the ...
Interlated's user avatar
  • 1,405
4 votes
0 answers
546 views

Does the structure of the module's src folder matter? [closed]

I've read about the Basic Structure guide to building a Drupal 8 module. It's great that it outlines the basic files needed to get a module up and running. Where it falls short is the contents of the ...
Joseph's user avatar
  • 1,596
0 votes
2 answers
106 views

How to debug why some content is not migrated from D7 to D8?

I am using migrate_plus to migrate from D7 to D8 and so far it has been a fairly smooth process. I have a particular content type that has 10 nodes in D7 but will only migrate one of them to D8. ...
dibs's user avatar
  • 808

1
2 3 4 5
12