Dmitry Boychev
  • Member for 5 years, 7 months
  • Last seen more than a month ago
2 answers
7 votes
582 views
Memory leak when looping through nodes
2 votes

Fool proof method: $memory_cache->deleteAll(); $memory_cache = \Drupal::service('entity.memory_cache'); $entity_storage = \Drupal::entityTypeManager()->getStorage('node'); $nids = \Drupal::...

View answer
2 answers
4 votes
1k views
How do I instantiate a custom class with dependency injection?
1 votes

You can't use dependency injection in your custom class without defining it as a service. The question has been answered in more detail here: Dependency injection in a custom class

View answer
1 answers
3 votes
1k views
"drush sql-sync" failing with Illegal string offset 'site' backend.inc:1030
1 votes

I had same issue and fixed it by specifying the %drush-script path for my remote machine alias. Just ssh into your remote machine and run "drush status" to find the correct "Drush script" path and put ...

View answer
2 answers
1 votes
3k views
get the content moderation value on node update
0 votes

This will give you the string such as "published" right away $node->moderation_state->value; While $node->get('moderation_state')->getValue(); returns an array.

View answer
3 answers
7 votes
3k views
Creating date field with only month and year
0 votes

Add attribute type "month", this will render as <input type="month"> Of course the modern day Internet Explorer (Safari) doesn't support this. Well it doesn't support date ...

View answer
2 answers
1 votes
2k views
How to sort a View according to contextual filters?
0 votes

When you provide a contextual filter with multiple values, views generates a query that has something like this WHERE (node_field_data.nid IN('72586', '60952', '72516', '50611', '60328', '49852', '...

View answer
3 answers
6 votes
2k views
Is there any compatibility issue with Amazon Aurora?
0 votes

I have not experienced any compatibility issues on 2 mid-size projects with over 100k nodes and over 20k users on D7. One of the sites I'm looking at has about 20 custom modules and 80 contrib ones.

View answer
2 answers
1 votes
1k views
How to have calendar popup in a form field of 'date' type?
0 votes

The reason is because at the time you asked this question, Firefox did not implement HTML5 date popup picker yet. As of right now Firefox already has it, but Safari for example still does not. To make ...

View answer
3 answers
2 votes
2k views
how can I debug theme.theme file in my theme using phpstorm?
0 votes

Also make sure you are on the correct theme to trigger debugger. A common mistake you could be doing: Lets say you want to debug a hook_form_alter that is in the YOUR_THEME.theme file, you did ...

View answer
4 answers
4 votes
3k views
What is the twig template name for a node edit form?
-1 votes

If you want to theme a specific form, for example the edit form of a node type, then all you have to do is /** * Implements hook_theme(). */ function THEMENAME_theme($existing, $type, $theme, $path)...

View answer