Drush giving Killed on Shared Rackspace

My last night ruined due to this.

Here is the complete story.

I have installed composer on Rackspace. Then i installed drush with composer(composer requires drush/drush:8.*).

But i was able to run drush only from ~/.composer/vendor/bin/drush/drush. But not from drupal root.

Here was the error i was getting:


 drush cr 

I have increased php memory limit from php.ini and in settings.php of drupal as well. But no luck.

At the end following solutions works.

Check Form type in Drupal

Sometime you have to add condition on the basis on form type, either it is node type form or taxonomy type form.

But question is how you get the type of the form.

In Your form alter you can find form type. Here is the sample code from my module file.

if($form['#entity_type'] == 'node' || $form['#entity_type'] == 'taxonomy_term') { //when type of form is node or taxonomy
$form['actions']['submit']['#access'] = FALSE; // remove submit button from form.

Remove delete and save button from node on the basis of permission

Recently i was assigned to do this task.

What i have done:

1. Created a permission for required role.

2. Checked permission for current user.

3. If user does not have the specific permission disable delete and save button. Here is the code to check the permission and disable edit and save button.


Subscribe to RSS - blogs