


How do I display the language settings (Site language field) on the user registration form?
I’m trying to display the user’s language settings field on the registration page, but no success so far. I’ve tried using a template (form–user-register-form.html.twig). This works for other fields, like mail, name, but I don’t know how... read more
Menu theme suggestion ignored when cache turned on
I have an alternative main menu that is used on specific node types. When turning on the cache the menu block is cached. The theme suggestion for the menu is then ignored. I tried to disable the menu cache by changing the block preprocess cache settings. But the menu... read more
Pay-Per-Node Functionality
My client would like a content type that has to be purchased by a registered user on a node-per-node basis. A previously registered user will see a view with the available content they can purchase and then that user can purchase individual nodes. These nodes that... read more
How to check in a Rules Condition if an Ubercart product is out of order?
There isn’t a good support for “out of order” in Ubercart for Drupal. I’m trying to fix that with the Rules module. I’m trying to add a rule that disables the product after the stock is updated, using Rules event After updating existing... read more
Print rendered field in views-view.html.twig
I try to render a custom node field in a views-view.html.twig and it works, the only thing is that i get the machine name and not the formatted name. Please can somebody describe me what i am doing wrong? I have tried several ways like: {{... read more
Overriding system.site.uuid with an environment variable
I have a need to have separate sites behave as if they are clones of each other; that is, they each need to have the same site UUID. Due to the environment I am operating in, I am unable to change the site UUID via drush config:edit once the site is installed as I... read more
Can’t get fid of the saved file after file_save_data
I have been trying to get the fid of the file which my custom module is saving and every time I end up getting the error “Trying to get property of non-object in report()”. I have tried file_object->id() and file_object-> fid ->value but neither... read more
How to set default form fields value from controller
How to setup default form fields value from a form created in a controller? I tryed to set the $form_state param but it does not work. … $form_state = new FormState(); $form_state->set(‘myfield_1’, ‘car’);... read more
Move all files and folders from a directory to another directory
I am unzipping some files and folders from an upload but the zip contains the files and folders one directory too deep. So currently they are located path-to-folder/anotherdirectory/ When I need them to be located at path-to-folder/ I have tried using the PHP rename... read more
I can’t get the view ID/name in hook_preprocess_views_view_unformatted()
In this function I can’t get view ID/name. function THEMENAME_preprocess_views_view_unformatted($vars) { $view = $vars["view"]; $id = $view->storage->id(); $name = $view->name; } In hook_preprocess_views_view_fields(), it works properly. Why... read more
Node view mode in page template suggestions
I would like page template suggestions when a node is using a custom view mode. I think this would happen in hook_theme_suggestions_page_alter(). I have already been able to get page-level template suggestions based on the node’s content type, so it seems like I... read more
Change max length of signature field to more than 255 characters
How can I change the max length of the drupal 7 signature field to more than 255 characters? I’ve already changed the sql data type from 255 to varchar(900), yet drupal still shows the error, as soon as a user wants to update his signature to more than 255... read more
How can I disable single option of checkboxes in drupal 8
I am using domain access module in Drupal 8. I want to disable one option/site in domain access settings in node edit page . I am trying to disable through hook_node_form_alter. Following is my array in node form alter Array ( [widget] => Array ( [#title] =>... read more
How to sub_process a non-associative array in migration.yml
I know I can use sub_process to iterate over an associative array like field_categories: plugin: sub_process source: remote_categories process: target_id: plugin: migration_lookup migration: my_existing_taxonomy_migration source: name_of_key But I don’t know how... read more
Mathjax module does not render on edit ckeditor
I have installed mathjax module and ckeditor module, but when I try to insert math code using math button on ckeditor, the math codes does not rendered correctely, math code become hidden. Math code rendered successly after content is submited. is there anyone can... read more
Unable to set cache max-age on ResourceResponse
I’m trying to create a REST API GET response. My class extends ResourceBase and this is inside its get() method. $response = new ResourceResponse([‘time’ => time()], 200); $cache_meta_data = new CacheableMetadata();... read more
One image style not generated
UPDATE: After investigting this I have concluded that the problem concerns ALL new image styles, but “old” ones are still working. Old ones are the built-in (e.g. thumbnail) and one image style of my own. Also: I use the patch to create the in... read more
How to change URL images for CDN
I have a website in Drupal 7 with “N” images in Sites/default/files and I need move this images to CDN. Is this possible? read more