- Go to admin/config/search/search_api/index/*your solr server*/workflow.
- Check the box ‘Index Hierarchy’.
- Select the taxonomy fields where you would like to apply the hierarchy.
Previously I was confronted with an error while simply using the Drupal l() function. In this l() function I was trying to give the HTML a-tag a specific class attribute value. The following code was in my module:
l(‘some url text’, ‘the-path-for-the-current-active-page’, array(‘attributes’ => array(‘class’ => ‘custom-class’)))
When calling the page containing the link from above, I received the ‘operator not supported for strings’ error. It seemed that the l() function that at default tried to set the class attribute ‘active’, was causing the error. By removing the parameter for setting the class attribute, the problem got solved. My link now looks like:
l(‘some url text’, ‘the-path-for-the-current-active-page’)
This doesn’t cause any errors anymore.
Since the Drupal Core update of version 7.34 all modules being updated contain an mtime text rule in the .info file.
This is caused by the Drupal core system.module file.
// Add the info file modification time, so it becomes available for
// contributed modules to use for ordering module lists.
$module->info[‘mtime’] = filemtime(dirname($module->uri) . ‘/’ . $module->name . ‘.info’);
Creating anchor links in views in Drupal can be very easy. You can to it this way:
- In the view render the output as fields.
- Add the field ‘Content: path’.
- Open the fieldset ‘Rewrite results’.
- Check the rewrite output checkbox.
- Enter the following text in the rewrite output textarea:
- <a href='[path]#youranchor’>Your custom link text</a>
The [path] token is the path alias of the node and can be found in the replace patterns section.
If you want to show all levels of the taxonomy term in the path, you can simply enter the following to your taxonomy url pattern in admin/config/search/path/patterns
In the OSX execute the following command:
chown -R $USER ~/.drush
In case you receive the following message:
chown: ….drush/cache/default: Operation not permitted
Then execute the command again, but with sudo:
sudo chown -R $USER ~/.drush
More info can be found on https://drupal.org/node/1488682
Delete a field within a content type
// Get the field instance object for a particular content type
$field = field_info_instance('node', 'your-field-name', 'content-type-machine-name');
// And delete it
Delete all instances of a field
// Get the field instance object
$field = field_info_field(‘your-field-name’);
// And delete all instances of this field