Questions tagged [debugging]
Use it for questions about module and theme debugging (e.g. "How do I debug this situation?").
568
questions
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::...
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\...
-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/...
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.
...
-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/...
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 ...
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 ...
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/...
-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 ...
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 ...
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 ...
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: ...
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?
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 ...
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' => $...
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 ...
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': ...
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 ...
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/...
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
...
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 ...
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 ...
-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 ...
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\...
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: ...
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 ...
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\\...
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--...
-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::...
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 ...
-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 ...
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'),
...
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....
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 ...
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 ...
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 ...
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 ...
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' =&...
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 ...
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 ...
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/...
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 ...
-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
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 ...
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><...
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 ...
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) ...
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 ...
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 ...
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.
...