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
12 views

Devel Debug Log produces empty messages

Drupal 9.4.5, Devel 4.1.5, Devel Debug Log 8.x-1.1 ddl function produces empty messages (they only have timestamp and id in the DB and at /admin/reports/debug. Other methods work correctly. Am I ...
  • 91
3 votes
1 answer
90 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 ...
  • 1,821
1 vote
1 answer
59 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: ...
  • 2,296
0 votes
0 answers
26 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?
1 vote
1 answer
102 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 ...
  • 49
1 vote
2 answers
75 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' => $...
1 vote
1 answer
29 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 ...
  • 936
1 vote
1 answer
78 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': ...
  • 936
0 votes
2 answers
354 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 ...
-1 votes
1 answer
281 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/...
0 votes
1 answer
39 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 ...
  • 227
1 vote
1 answer
236 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 ...
  • 5,035
0 votes
1 answer
56 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 ...
-1 votes
1 answer
34 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 ...
  • 7
0 votes
1 answer
361 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\...
  • 7
0 votes
1 answer
504 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: ...
  • 2,008
3 votes
1 answer
131 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 ...
0 votes
0 answers
138 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\\...
0 votes
1 answer
110 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--...
  • 1,383
-1 votes
1 answer
165 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::...
0 votes
0 answers
26 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 ...
  • 1
-2 votes
1 answer
602 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 ...
1 vote
2 answers
37 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'), ...
  • 41
1 vote
1 answer
824 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....
4 votes
1 answer
525 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 ...
  • 934
0 votes
0 answers
103 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 ...
  • 313
1 vote
0 answers
176 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 ...
1 vote
2 answers
215 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 ...
0 votes
1 answer
844 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' =&...
1 vote
1 answer
556 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 ...
3 votes
1 answer
691 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 ...
  • 183
0 votes
1 answer
282 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/...
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 ...
  • 101
-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 ...
4 votes
1 answer
545 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 ...
1 vote
0 answers
400 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><...
1 vote
0 answers
461 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 ...
3 votes
1 answer
146 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) ...
  • 5,035
1 vote
1 answer
168 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 ...
  • 1,383
4 votes
0 answers
312 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 ...
  • 1,134
0 votes
1 answer
97 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. ...
  • 798
0 votes
0 answers
98 views

Is there a dd() like variable printer that can be used inside a preprocess?

Many times when I start a hook_preprocess_hook, I start by printing the $vars object. I can do this by dpm()'ing, dsm()'ing, kint()'ing etc. The problem is that all of these functions print $vars in ...
  • 195
0 votes
1 answer
376 views

Extending a base template file such as field.html.twig renders no results?

So I have a custom content entity that has the typical attributes. Name, Author, Creation Date, ect. In the 'view' tab of this content entity, it displays said name, author, ect. When I hover over ...
  • 377
0 votes
0 answers
760 views

Why is my custom twig template not being selected by Drupal?

So I have a custom module that has boilerplate template code inside it. No problem there. So I following the Drupal Docs which says to create a service.yml file and turn debug on and caches off. Done. ...
  • 377
0 votes
1 answer
1k views

How do I debug with Xdebug in Visual Studio Code? [closed]

When I try to debug Drupal 8 (8.6.11) using Xdebug in VS Code (I'm on Win 10 but I doubt it is relevant in this case) I get the following error: Exception has occurred. Dotenv\Exception\...
  • 37
1 vote
1 answer
496 views

How do I debug incorrect favicon showing on the front page in a custom theme?

I'm working on a Drupal 8 site with a custom theme that I didn't code. The site is using the metatag: favicons module to control the favicons. The favicon seem to work correct on all except the home ...
  • 1,172
0 votes
0 answers
246 views

AttributeArray fails to implode #allowed_tags

I started working on existing project and right from beginning, it displayed tons of alerts in specific pages. This is what Drupal outputs: Notice: Array to string conversion in Drupal\Core\Template\...
  • 101
1 vote
2 answers
281 views

Manipulate a render array in hook_node_view

I'm wanting to modify the contents of some fields at display time so looked at hook_node_view(), however, the $build array is not what I'm expecting, if I dump it with var_dump it is thousands of ...
1 vote
0 answers
26 views

Left to right mark added to field name

Using Drupal's admin I added to an existing content type a new text field with the machine name field_note. When fetching the field in my code I want to check if $field_name == 'field_note' but it ...
  • 13
0 votes
0 answers
834 views

Unable to determine class for field type during upgrade

I'm getting the following error when I am updating my site's core and contrib modules. I'm at a loss as to how I would go about finding the issue. I've gone to views.views.inc line 181 and looked ...

1
2 3 4 5
12