Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
In form_alter I insert this code to assign a default value to an Entity reference field
$form['field_localita_partenza']['widget'][0]['target_id']['#default_value'] = 'ROME';
During the insertion phase, I change Rome In Milan but when I save it forces me to value ROME and not MILAN.
I have done various tests but without success.
I don't understand why it doesn't work
This might be an unusual question. Is it possible to generate text in Drupal based on variables and 'if then else', and preferably also 'switch case1 case2 ...'?
I am developing a store in drupal and I would like to know if there is a way to show me a label on a product that was previously no longer in stock.
I am using the Ubercart module and drupal8. for drupal 7 I found a module that does what I want and I would like to know if there is any way to do it in drupal8
I have a custom module for my D7 site, what I do in this module is create a entrance in the hook_menu with a item without call back. Them I have others items being a "sub-item" of the first, something like this
I made a module with a form called SimpleForm which consisted of 2 textfields and a submit button. However, I cannot open the form using the path, it always throw HTTP error 500. I also couldn't show the form on my twig file. Can someone please have a look at my code and give me a proper explanation? Thank you beforehand.
I've recently run into an issue where after the website was launched. The web address within the iFrame changed in turn dis-configuring the graphics in the content structure. Is there a way to update this without using the hook_update? I'm just learning Drupal out of necessity to update the website.