php – Skip validation on node delete in Drupal 7-ThrowExceptions

Exception or error: How can I accomplish skipping validation when the user attempts to delete a node in Drupal 7? I am calling my custom validation function in the following manner: function my_issue_form_alter(&$form, &$form_state, $form_id) { switch ($form_id) { case ‘my_issue_node_form’:{ $form[‘#validate’][] = ‘my_issue_node_form_validate’; break; } } } function my_issue_node_form_validate($form, &$form_state) { //custom validation done …

How to enable PHP OPcode caching for Drupal 8?-ThrowExceptions

Exception or error: I want to enable PHP OPcode caching for Drupal 8 installation. I have the following in Xampp php.ini. However, I still get opcode not enabled. What am I doing wrong?? opcache.enable=1 engine = On zend_extension=php_opcache.dll opcache.memory_consumption=128 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=4000 opcache.revalidate_freq=60 opcache.fast_shutdown=1 opcache.enable_cli=1 How to solve: Here is nice post about OPCache: How to …

php – Where Drush 9 aliases file should be located in Drupal 8?-ThrowExceptions

Exception or error: I have tried some ways to create an alias for my local Drupal project, I’m referring to : https://www.drupal.org/node/1401522 https://www.drupal.org/project/drush/issues/831272 https://www.drupal.org/project/drush/issues/786766 I can connect by running this command : drush –root=C:/wamp64/www/executive-coatings –uri=http://localhost:81/executive-coatings status Output : Drupal version : 8.6.13 Site URI : http://localhost:81/executive-coatings DB driver : mysql DB hostname : localhost DB …

php – Drupal 7 how to render custom field-ThrowExceptions

Exception or error: I’ve added a custom field called ‘field_header’ to the basic page content type. How do I access this field on the page.tpl.php template so I can display it wherever I want? Ideally I would like to remove it from $content as well. Thanks! How to solve: Don’t forget not every page is …

php – Drupal – How to update a CCK NodeReference field programmatically?-ThrowExceptions

Exception or error: I’m trying to create a node (B type) & assign it to a A type node’s CCK nodereference field using node_save() method. $node_type_A = node_load($some_nid); $node_type_A->field_type_B_node_ref[][‘nid’] = $node_type_B_nid; $node_type_A = node_submit($node_type_A); node_save($node_type_A); As the result, a new B type node will be created, but no reference will be assigned to the A …

php – Drupal 7 error: The file could not be created-ThrowExceptions

Exception or error: I move drupal 7 from server(live Site) to my localhost(xampp). I change settings.php(files/defualt/settings.php) for database connection and remove cache from mysql database. now in load index, i see my website without css design(only text) and see this error : **Error message**: The file could not be created. The file could not be …

php – Drupal form submit, form after_build-ThrowExceptions

Exception or error: What is the difference between $form[‘#submit’] and $form[‘#after_build’]? How to solve: The api docs lay this out fairly well. $form[‘#submit’] will add an array of submit handlers to your form: ie when someone clicks the “Submit” button the function in the array will be called. These will be called after submission. You …