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
1answer
37 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
0answers
33 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
2answers
114 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 ...
3
votes
1answer
127 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
0answers
101 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
0answers
184 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
1answer
132 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
1answer
38 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 ...
2
votes
0answers
63 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
1answer
81 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. ...
0
votes
0answers
51 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 ...
0
votes
1answer
85 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 ...
0
votes
0answers
138 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. ...
0
votes
1answer
724 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\...
0
votes
1answer
175 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 ...
2
votes
1answer
353 views

How to properly attach Google Maps Api to Drupal behaviors in Drupal 7?

So, I've posted on this elsewhere and I seem to either get half answers but they've gotten me closer to a solution but not over the finish line. I'm trying to implement a custom Google Maps ...
0
votes
0answers
120 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\...
1
vote
2answers
76 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
0answers
18 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 ...
0
votes
0answers
375 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 ...
0
votes
0answers
147 views

Debugging strange memory overflows on Pantheon

We have a Drupal Commerce site on D8.6.7 running on Pantheon Performance Small servers. We do a bit of side processing besides normal e-commerce stuff like syncing up data, collecting emails, etc. ...
0
votes
0answers
576 views

How to turn off Twig debugging for a views feed?

I am trying to build a calendar rss feed from views. The rss.xml is being generated, but it doesn't appear to be accepted as a calendar rss on local systems. When I look at the source, I see it's ...
0
votes
0answers
36 views

How to trace the raw data of each element in a web page we want to check?

I'm a beginner of Drupal8, and I've encountered lots of difficulties till now. One of the biggest one is that when I enable the Theme Debug, I always confused about where the selected part comes from. ...
0
votes
0answers
328 views

Throwing an AccessDeniedHttpException() in an event causes a “max nesting level” error

I am debugging an event subscriber that checks if a user has access based on certain conditions. If they don't have access, then I am doing: throw new AccessDeniedHttpException(); However, this was ...
1
vote
1answer
484 views

Translation: File upload error. Could not move uploaded file

I would like to import an translation file *.po. When I import it, I become the error: "For security reasons, your upload has been renamed to bootstrap-all.de_.po." and "Error message File upload ...
3
votes
1answer
515 views

Settings contains a dot which is not supported, but module gets enabled properly

I'm developing a search engine module for Drupal 8. On a clean new Drupal website, I can install it from the admin GUI, but when I enable it I have the classical white screen (The website ...
1
vote
2answers
179 views

Maintenance page being rendered as an entire page load after the main page load

I've noticed that I've got a maintenance page being rendered in its entire HTML markup format after my pages. The site is not in maintenance mode, and this is not intentional behaviour. I'm trying to ...
1
vote
1answer
773 views

Debugging Module Show PHP Errors

I saw in a YouTube video someone had made a configuration where if there was a PHP bug in their module, upon cache rebuild it would show the error underneath the "The Website Encountered an Unexpected ...
0
votes
1answer
45 views

Language switcher block hides for authenticated user

I have a language switcher added to my site. It works fine as long as I'm an unauthenticated user. Logging into site replaces it with: <span data-big-pipe-placeholder-id="callback=Drupal%5Cblock%...
0
votes
0answers
81 views

Error message not converting html tags

In entity browser I tried uploading a file which is not supported. So I got the valid error message. But it does not convert the html tags which are being generated from token. Following is the code ...
1
vote
1answer
23 views

Is there a way to supress particular messages or a class of messages on the screen?

Is there a way of suppressing a particular class of messages from being displayed on the screen, such as the one displayed below? Deprecated function: Methods with the same name as their class ...
0
votes
0answers
91 views

Can't access the Status Report page

I've updated my LOCAL site with composer, updated the database but can't access the Status Report page (site encountered an unexpected error). I looked at the recent log messages and saw this error: ...
1
vote
1answer
936 views

500 error without any error log entry

Migrated a Drupal 8 site to another server running apache2 PHP 5.5.9 (should be supported). Apache returns 500 when index.php requested, but no errors are logged anywhere. I tested by forcing an ...
0
votes
2answers
86 views

Receiving Error message on every attempt to add or remove content. Is this normal?

New to drupal & collaborating on a project. Error message reads "Error ; The website encountered an unexpected error. Please try again later." I've been getting that error message for 4 days in a ...
0
votes
1answer
1k views

showing errors even though display_errors is off

I want to hide all error messages to the users. I did all the three steps below Set display_errors = off and error_reporting = 32767 in php.ini Made sure this config $config['system.logging']['...
0
votes
1answer
34 views

Fatal error: Cannot redeclare casa_views_post_execute

I understand this to be two declarations of the same function, which is not allowed. But how to fix this? Everything was fine until I started to enable the MailChimp module, then the backend has this ...
1
vote
1answer
123 views

How to debug an empty cache_page table

I have a bunch of sites built off the same profile, and recently noticed the pages aren't being cached. I spent some time doing the usual: looking for drupal_set_message calls, disabling all the ...
0
votes
1answer
65 views

Can't load font woff

I have relatively simple issue but I can't fix it myself. My log is full warning with same message: page not found http://mywebsite.com/sites/all/themes/bigwig/font/entypo-icon-font.woff I have ...
2
votes
2answers
2k views

How to show kint debug info from a module on a page?

In D8 I would like to display an array in the message part of a page. I did several things but could not get it work. What to do? I installed the devel and kint modules. I currently have changed ...
3
votes
2answers
1k views

Protect drupal code injection from url

Recently my drupal site is hacked. When i see website log from drupal admin panel someone trying to inject code from url. I searched my website(drupal) directory lots of code in page appended and new ...
1
vote
0answers
42 views

Page not found errors for images

The site becomes painfully slow at times and when I look into "Recent Log Mesaages" logs such as this is frequently found. The Location shows: http://example.com/sites/default/files/styles/featured/...
0
votes
1answer
954 views

Creating a simple Drupal 8 custom service - argument should be an instance of a class, recognised as an array

I'm kind of new to Drupal 8 development and object-oriented PHP in general. I've been trying to make a simple custom block module, which includes a service with simple dependency injection. However, I ...
0
votes
1answer
98 views

Drupal Commons, can't break-contact error

I am using Drupal Commons (7.x-3.46).. Whenever trying to "break contact" of a trusted-contacts, I get an error: An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. ...
3
votes
3answers
7k views

What is easiest way to debug variables in nodes, views, blocks and page twig templates?

What is easiest way to debug variables in nodes,views,blocks and page template. Earlier we used devel module in drupal 7 ,by using dpm() function it shows very neat and clean structure ,it was so ...
-1
votes
1answer
862 views

This page is not working

When I visit my site, I get an error: This page isn’t working my---site.com is currently unable to handle this request. HTTP ERROR 500 I have taken the below steps but no luck. In shared ...
3
votes
1answer
1k views

How to debug 404 on user/login user/register user/logout?

I have a Drupal 8 site on 8.4.2. When I upgrade it to 8.5.1, after running the database updates, the paths /user/register, /user/login, and /user/logout return a 404. I can log in with Drush (drush ...
2
votes
0answers
34 views

how to create try catch in drupal 8 [duplicate]

I would like to create a custom message when user did unexpected error it should show this message Invalid parameter please enter correct values . It should not show this message. The website ...
0
votes
1answer
149 views

Error when running database update: “DatabaseSchemaObjectExistsException: Cannot add field redirect.status: field already exists.”

I'm getting the following error when attempting to run a database update: Update #7101 Failed: DatabaseSchemaObjectExistsException: Cannot add field redirect.status: field already exists. in ...
0
votes
1answer
79 views

error message when installing drupal 8

When I was installing Drupal 8 (Macos, nginx, php7.0, mysql5.6), the following error occurred, Can someone help me? An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. ...
1
vote
1answer
2k views

what when displaying a variable with kint crashes?

I am trying to find the variable name for the content link in a view. {{ kint(content) }} makes the page crash, probably because the variable is too big. The same is true for the following code. ...

1
2 3 4 5
11