Menu
  • HOME
  • TAGS

Drupal 7 - add already existing block to LOGIN page

drupal,drupal-7

user/login should work. Please be sure to select the correct region and under permission no role is checked, by default it should show for anonymous users!!...

Whats the correct way of outputting html in a custom module in Drupal

php,drupal,drupal-7,drupal-modules,drupal-views

Maybe you mean using the drupal theme layer? This allows for use of .tpl files and overriding. I have a simple block module that does it here Source here. Here is some documentation on using the theme layer within a module. Here is some official Drupal docs on themeing (mainly...

Call to undefined function entityreference_get_behavior_handlers() in \sites\all\modules\community\entityreference\entityreference.install on line 46

php,mysql,drupal-7

I got the solution for this. add the following line. // Invoke the behaviors to allow them to change the schema. module_load_include('module', 'entityreference'); above foreach (entityreference_get_behavior_handlers($field) as $handler) { $handler->schema_alter($schema, $field); } in file \sites\all\modules\community\entityreference\entityreference.module Thanks & regards, Vivek...

How can i hide list entries based on user roles Drupal 7

drupal,drupal-7

if it is a simple options list field then your simplest option is probably altering the edit form yourself with hook_form_alter or hook_form_FORM_ID_alter (hook_from_FORM_ID_alter is better as it will only run for that particular form). If you use a taxonomy reference field instead, you could use taxonomy access or taxonomy...

Drupal 7 - Newly added custom page--*.tpl refuses to render

drupal-7

I found some great information at http://drupal.stackexchange.com/questions/36054/how-to-have-a-another-page-tpl-php-file-in-drupal-with-different-regions-and-blo which enabled me to solve this issue. The solution: Instead of naming your custom page page--yourcustompagename.tpl.php use a format like this: page--node--23.tpl.php If you are unsure of the node number of your custom page navigate to the content section and hover your mouse...

Installing Drupal - missing extension 'gd'

php,drupal,drupal-7,php-extension

Turned out to be a 'read the manual' moment. I hadn't set the default extension directory via: extension_dir = C:\php\ext as I assumed it would be relative within the downloaded installation. I eventually discovered this by reading the apache logs....

How to do a browser login by web service to Drupal website?

php,html,web-services,drupal,drupal-7

You should give a try to Login one time module, which provides the ability to email one-time login links to users. I have not tried it but you could analyze the code to see which function is in charge of generating the one time login URL. Once you get the...

Drupal - Query to count all nodes of content_type “A” in which field_b is “X”

sql,drupal,drupal-7,entityreference

You can set the query to be a count query only by using : $count = $query->count()->execute(); ...

Trying to write a foreach argument for a drupal7 cck field

jquery,drupal-7,cycle

You're close, give this a whirl. <div class="cycle-slideshow"> <?php foreach($content['field_slider_photo']['#items'] as $img): ?> <img src="<?php print file_create_url($img['uri']);?>"> <?php endforeach; ?> </div> ...

How do I setup Apache to serve multipe local sites at different locations?

php,apache,.htaccess,drupal,drupal-7

Your apache log is telling you that it can't find the DirectoryIndex directive, so because directory listing is turned off you will get a 403 forbidden because index file is not set. You can add it here. <Directory "/Users/fitvalet/Sites/drupal/7"> DirectoryIndex index.php AllowOverride All Require all granted Options +Indexes +FollowSymLinks </Directory>...

How to display results tagged with just one term ID when there are multiple filters

drupal-7,drupal-views,drupal-exposed-filter,drupal-contextual-filters,drupal-views-relationship

I tried using the taxonomy term pages approach, but could not figure out how to get the fields displaying properly. The fields displayed were based on the teaser in my Blog content type. And using exposed filter option was not a solution since my use case was to only display...

Drupal 7: Add text to default '/user' page

drupal,drupal-7,drupal-theming,drupal-templates

I would add a block with the text / content you need. Then under the "Visibility Settings" for that block, choose "Only on the listed pages". Obviously you can then set "user" as the path you want that block to show on, and any other pages you need that to...

global text into a link drupal 7

drupal-7,drupal-views

you may use the rewrite option to make image field as link in drupal views with replacement pattern.

Styles in Drupal menu

css,drupal,menu,drupal-7

No you can't, you need to implement your own theme_menu_link function in your theme. function YOURTHEME_menu_link(array $variables) { $element = $variables['element']; $sub_menu = ''; $element['#attributes']['class'][] = 'my-custom-li-class'; // change here to desired css class name if ($element['#below']) { $sub_menu = drupal_render($element['#below']); } $output = l($element['#title'], $element['#href'], $element['#localized_options']); return '<li' ....

How to list all child pages of current parent page in drupal 7?

drupal,drupal-7,teaser

You can do this is views by creating a view displaying the fields you require or a teaser. Then add a "Content Nid" contextual filter, in the configeration for this filter under "WHEN THE FILTER VALUE IS NOT AVAILABLE" select "Provide default value" and then "PHP Code" then the code...

relations variable of content-type drupal 7

drupal-7

You should use Drupal Entity Reference module. Download, install and enable it, and then, you have to add a new field in content type "Reports", namely customer, of type "Entity reference" (this field type was added by Entity Reference module). Once you have added this field, you have to choose...

In IE, anchor text is overflowing/overlapping instead of wrapping, but not other text

html,css,internet-explorer,drupal-7

The issue is caused by the <legend> element. There is a bug in Internet Explorer which causes the legend to be displayed without word wrap. See this article for more information. I would recommend just using a header tag instead....

Delete the values with the oldest timestamp

php,mysql,drupal,drupal-7,cron

I solve my problem with this lines of code: $giannis = db_delete('error') -> condition('variables', $variables, '=') -> condition('timestamp', $timestamp, '<') ->execute(); ...

Can't override CSS for font color

css,drupal-7

Did you add this? color: #FFF !important; The important part makes it override the other stuff....

Moving a SIte from Drupal to Raw PHP … Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

php,mysql,sockets,drupal,drupal-7

Check whether mysql is running with the following command: mysqladmin -u root -p status And if not try changing your permission to mysql folder. If you are working locally, you can try: sudo chmod -R 755 /var/lib/mysql/ Reference Connect to Server...

Drupal - Custom page with arguments

php,templates,drupal,drupal-7,arguments

You can do that in your custom module by using preprocess_page hook . For more information refer link Template Based on URL Alias ...

insert values to a table from watchdog

php,mysql,database,drupal,drupal-7

I did it : f($r->rowCount() == 0) { $query = db_insert('blablabla') ->fields(array( 'timestamp' => $timestamp, 'wid' => $wid, 'variables' => $variables, )) ->execute(); ...

Custom Drupal bootstrap using file-API

drupal,drupal-7,bootstrap,drupal-file-api

In the meantime i found the solution. All filepaths are handled relativley internally inside Drupal. Whenever you are using some Drupal bootstrap inside a file that is not located at the ROOT-directory, make sure to use a: chdir(DRUPAL_ROOT); right before your function calls....

With join what must be the fields in order to take all the values?

php,mysql,sql,drupal,drupal-7

You can call the fields method several times: $query = db_select('watchdog', 'wa'); $query->leftJoin('malgona', 'm', 'm.wid = wa.wid') ->fields('wa') ->fields('m'); It is probably better if you also define the columns for the tables as using this generic fields without column definitions will result in name collision (see Drupal:Fields) if you have...

Vertically align multiple spans inside a div - Different behavior in different browsers

html,css,drupal-7

vertical-align: middle The vertical-align CSS property specifies the vertical alignment of an inline or table-cell box. Middle Aligns the middle of the element with the baseline plus half the x-height of the parent. If you set each inline-block element to vertical-align: middle then all of those elements will be...

xhprof displaying empty run

php,drupal-7,xhprof

Found the problem. My site name includes an & which generates file name to readable by the XHProf.

Writing php code to creating menu in block show and alert

php,drupal,drupal-7,block

You will need to bring the variable $base_url and $base_path into the global scope. At the top of your function or template file add: global $base_url; and your code would be like this: <?php global $base_url; $url=$base_url.'/drupal'; echo '<ul> <li><a href="'.$url.'/article/1">One</a></li> <li> <a href="'.$url.'/article/2">Two</a></li> </ul>'; ?> ...

How i can add relative path of image in Block Body Drupal7?

php,drupal-7,block

Refering to this answer you should use base_path() function and path_to_theme() : Example : <img src="<?php print base_path() . path_to_theme() .'/' ?>images/img.jpg" /> ...

Is there a rest api for the drupal admin interface (e.g. for clearing the cache)

drupal,drupal-7,drupal-modules

You could write a small module that hooks into cron: // function that will be triggered on next cron run function <MODULE>_cron() { // clear all caches drupal_flush_all_caches(); } Then you could simply run cron: curl http://mysite.example.com/cron.php?cron_key=<YOUR_CRON_KEY> Which in turn will trigger <MODULE>_cron() that will clear the cache. Another approach...

Drupal views reset exposed filters values on change

drupal-7,drupal-views,drupal-taxonomy,drupal-exposed-filter

This is not a common requirement but anyway. If you really need that functionality you can do this using js (or jquery) so when changes a select option (assuming you are using select element) to reset the other 2 selects to the -Any- option. Check this question change selects value...

How to remove second library of jquery loading with Drupal installation

javascript,jquery,drupal,drupal-7

I can see the 3 jQuery files. One is coming from jQuery Update so this should stay. There are 2 jQuery files added via your boostrap_nova theme which could be removed. These may have been added: in the html.tpl.php template file in template.php in your theme's .info file ...

.htaccess to prevent hitbots URI “payday” and “loans”

.htaccess,drupal-7

Try adding this above any rewrite rules that you may already have: RewriteEngine On RewriteRule (?:payday|leasehold)-loans - [L,F] This will return a 403 forbidden, but you may want to redirect to something else instead. RewriteEngine On RewriteRule (?:payday|leasehold)-loans https://google.com/ [L,R=301] This redirects any request with payday/leasehold-loans to google, or you...

How i can avoid the distinct() of watchdog?

mysql,database,drupal,drupal-7

Make some empty array before the loop. Inside the loop check if the unique value exists in it. If it does just skip that loop iteration (continue). And if it doesn't store it in the array and do your blablabal(); // query without distingc // print_r($results); print out array of...

Drupal domain access auto create content

drupal,drupal-7

Use hook_domain_insert() this will give you the id of the domain that has just been created in the $domain array. Then you can create a node as follows: function YOUR_MODULE_domain_insert($domain, $form_values = array()) { $domain_id = $domain['domain_id']; $node = new stdClass(); $node->type = 'your_type'; $node->title = 'Your Title'; node_object_prepare($node); $node->language...

Android Push notification using Drupal HTTP Post error “Access denied for user anonymous”

android,drupal,drupal-7,push-notification

Enable permissions for anonymous user in Drupal administration - People/Permissions/Push permissions. It helped me.

How do i combine multiple fields from a view into one hyperlink?

drupal,drupal-7,drupal-modules,drupal-views

It would be helpful if you said how you wanted combine them, so I will assume it is similar to the same way I often do. Views has two checkboxes that you will want to use for this. 1 is the Exclude from Display at the top of the field...

Drupal AngularJS ajax simple ng-repeat update

ajax,angularjs,drupal,drupal-7,drupal-ajax

Actually html renders before response so you need render ng-repeat after response <a href="#proceed" ng-click="order.submitOrderAjax()"> <?php print t('Finish order'); ?> </a> <ul ng-if="flag"> <li ng-repeat="error in order.errors">{{ error.text }}</li> </ul> Controller app.controller('orderController', function($scope) { this.errors = []; $scope.flag=false; this.submitOrderAjax = function(){ var data = {} // some data here like...

Pass all the values of a database table without limit()

php,mysql,database,drupal,drupal-7

By default the PagerDefault limit is set to 10. You should be able to pass a parameter like 0, NULL or FALSE in order to get all the values from the table. Try something like this: // Begin building the query. $query = db_select('watchdog', 'th') ->extend('PagerDefault') ->orderBy('wid') ->fields('th', array('variables', 'type',...

Drupal 7 DB API Query with Condition db_or etc

mysql,drupal,drupal-7

I cannot execute it because i do not have the same tables like you but your generated query looks good. SELECT u.uid AS uid, fn.field_first_name_value AS field_first_name_value, ln.field_last_name_value AS field_last_name_value FROM {role} r INNER JOIN {users_roles} ur ON ur.rid = r.rid INNER JOIN {users} u ON u.uid = ur.uid INNER...

Can I use the Backup and Migrate module to back up Drupal 6 and restore in Drupal 7?

drupal,drupal-7,drupal-6,drupal-modules

Simple answer no. What you can do is to upgrade your current Drupal 6 to Drupal 7. It really depends on how complex your Durpal 6 site is. As far as I know, if you didn't use a lot of "hooks", the upgrading process will be smooth, or you need...

How to delete the items that i used from the database

php,database,drupal,drupal-7

https://api.drupal.org/api/drupal/includes!database!database.inc/function/db_delete/7 You should Google a bit before asking those basic questions. Drupal at least has a bunch of examples, tutorials... $nid = 5; $num_deleted = db_delete('node') ->condition('nid', $nid) ->execute(); 'node' is the table you are deleting record from and with condition method you can select exact row(s) to delete by...

AngularJS ng-repeat in Drupal7 Dupes Error

angularjs,drupal-7,angularjs-ng-repeat

Okay, I solved it. I had a really stupid mistake in my js file for my D7 module. (Note: refer to the jsfiddle above to understand the variables and their data) My error was this; $scope.DATA = $filter('json')(data); Which assigns a 'string' instead of a 'json object', therefore 'ng-repeat' would...

Drupal AJAX HTTP error occurred During Installation

mysql,drupal,drupal-7,drupal-ajax,drupal-commons

I set the MySQL Windows Service properties to restart automatically when failure occurs. It still randomly fails but gets a lot further and is eventually successful. I also optimized MySQL but not sure it really helped: https://www.drupal.org/node/259580...

“Page not found” all over the place with i18n on Drupal?

drupal-7,internationalization,multilingual

The i18n module does not work if you set the prefix as A/B, only as A. In other words, you can have this: /us-en But not this /us/en Which is really annoying and I wish it didn't work this way, or that someone at least added validation so you can...

Drupal 7, if contextual filter 'default value' not there, ignore it

drupal-7,drupal-views,drupal-contextual-filters

There is an option of validations when the filter value is not available. You can choose the first option of Display all results for the specified field. ...

Check if the entry in DB exists - Drupal 7

php,mysql,database,drupal,drupal-7

You need to query the table to see if the data exists before writing to it, if a row exists matching the criteria then do nothing. For example; function blablabla_cron() { // Begin building the query. $query = db_select('watchdog', 'th') ->extend('PagerDefault') ->orderBy('wid') ->fields('th', array('wid', 'timestamp', 'variables')) ->limit(2000); // Fetch the...

Generate english versions of same content on Drupal?

drupal-7,internationalization,multilingual

You could create a module implementing hook_node_insert(). This module would intercept the creation of a new node (stored with the default language) and create as many copies as needed. Each of these copies should have a different value in the field language. These copies colud be easily stored in the...

Is there a way to remove/or edit close button from ctools modal windows on drupal?

jquery,css,drupal,drupal-7

You can use use hook_css_alter to achieve this. You can find an example here. Hope that helps....

How to make a Drupal theme with PhpStorm

drupal,drupal-7,phpstorm,drupal-theming

Drupal theme is just bunch of files and it's not important what editor/environment you use to create it. There are a lot of tutorials on the net explaining how to make a theme. http://www.onextrapixel.com/2013/12/27/how-to-create-a-drupal-7-theme-from-scratch/ Google for some more and you'll find them....

How to access localhost/drupal from the internet?

php,apache,drupal-7,wamp,wampserver

Download and install ngrok. It's free. Then, from your terminal (assuming your drupal site runs on port http://localhost:8888/). $ ngrok 8888 ngrok will assign you a subdomain for you. Open the url, and you are good to go. You can also sign up for free to be able to choose...

Drupal module development, custom database tables, pages for managing those data

table,module,drupal-7

You can follow this tutorial for the basics in creating a D7 module. https://www.drupal.org/node/1074360 As far as custom database tables I suggest taking a look at this module. https://www.drupal.org/project/eck Also take a look at this video for more info about 'ECK'. http://codekarate.com/daily-dose-of-drupal/drupal-7-entity-construction-kit...

PHP mysqli random error during insert

php,mysql,mysqli,drupal-7

I can't really tell you why this happens, i guess some charset-issue with this language. Is your script saved as UTF-8, your database UTF-8 and your connection also UTF-8? One way (the best in my opionion) is to use PreparedStatements. Instead of filling the values in yourself, let the Database...

Working with Drupal site collaboratively

drupal,drupal-7

So, to make it official, if Drupal is offering you new install that means that something is wrong with database. Either it's empty or database account information is not correct or something like that. When you are moving database, you can do it with backup&migrate module (if you want to...

Get particular string using preg_replace in PHP

php,drupal-7,preg-replace

Assuming that the array that holds the comments is $comments, the following will do: $hooks = array(); foreach($comments as $comment) { if (preg_match("/Implements (hook_\w+)\(\)/", $comment, $matches)) $hooks[] = $matches[1]; } This will match text having the word Implements followed by hook_ and at least one letter followed by (). Then...

Drupal - Highlight table row depending on variable

css,twitter-bootstrap,table,drupal,drupal-7

If you build your rows like you did your header there, you can set attributes for the rows or cells. There's an example in the theme_table documentation of adding a class to a row. $rows = array( // Simple row array( 'Cell 1', 'Cell 2', 'Cell 3' ), // Row...

Drupal7 | Custom Module | How to Display Template?

drupal,module,drupal-7,drupal-modules,drupal-theming

You'll need to implement hook_block_view to define what gets displayed in your block. Also, if your template is just static content, you don't need to specify a "render element" or "variables" for your theme hook (though you could still make variables in a preprocess function)....

jslint4java external jslint options are ignored

drupal-7,jslint,jslint4java

Does the behavior exist if you use the canonical jslint file? The one you linked branched over four years ago, hasn't been updated, and doesn't seem to respect window. Compare this section in the canonical, current JSLint file, which does contain window: https://github.com/douglascrockford/JSLint/blob/master/jslint.js#L343 // browser contains a set of global...

How to manage Facebook connect in Drupal multisite?

php,facebook,drupal,drupal-7

RAW SOLUTION: I solved the problem, modifying fboauth module code. I created two functions: one returning an app id, another returning an app secret, depending on the domain i'm in. Then I substituted every "variable_get('fboauth_id', '')" and "variable_get('fboauth_secret', '')" in the module files with my customized functions. It is not...

Drupal: taxonomy filter from separate view

drupal,drupal-7,drupal-views,drupal-taxonomy

I think your main view should use a contextual filter, based in the URL given. This way, the view would only show those projects in the specified category. In the left view, you should show the taxonomy terms, but you should modify the URL given with your custom one: www.example.com/projects/taxonomyTerm...

MySQL query from PHP returns incorrect results

php,mysql,sql,drupal-7

->fetchAssoc() invariably returns a single row of query results, meaning that your array is a single record, and your loop will be putting that row's string values into $track. You then use $track as if it was an array, producing the following code equivalent: $arr = array('abc', 'def'); // your...

ob_start() unexpected behaviour in drupal 7

php,drupal-7

Use ob_get_clean() instead of ob_get_contents() You must clean and close your output buffer. The following will: 1.) Save the contents 2.) Output them only when you need them. ob_start(); require_once('templates\custom-report.php'); $html = ob_get_clean(); echo $html; ob_get_contents() This will return the buffer contents but does not erase the output from the...

How to traverse the Drupal's watchdog table?

php,drupal,foreach,drupal-7,watchdog

Look at the code below: if (isset($row->message) && isset($row->variables)){ if ($row->variables === 'N;') $dbmessage = $row->message; else $dbmessage = t($row->message, unserialize($row->variables)); $dbmessage = filter_xss($dbmessage, array()); } ...

How could i use a watchdog hook?

drupal,drupal-7,watchdog

The hook_watchdog gives you the possibility to route log events to emails, other databases, and more options. I recommend you to read the documentation. If you want to use it, you need to create a custom module and implements hook_watchdog. However, if you want to get the messages only, you...

How can I filter by “updated this month” in a view?

drupal,drupal-7,drupal-views

Remove your filter and add a contextual filter: Content: Updated month - Date in the form of MM (01 - 12). & select the option Provide default value to Current Date. This will make sure your view gets content from the current month & not from within a month range.

Are namespaces in PHP “inherited”?

php,drupal-7,namespaces

To answer the base question (and pending further code) PHP namespaces are set by whichever namespace is declared in the file. // Bar.php namespace Foo; class Bar {} // some other file use Foo\Bar; $test = new Bar(); //works // different file namespace Foo; $test = new Bar(); // works...

Add parameter to drupal content page

php,drupal-7

You can do it through following steps login to your drupal admin panel and go to edit view option add new field content: path uncheck "Create a label" option for it check "Exclude from display" option for it Now edit field name on which you want to add link choose...

PHPStorm Drush on Vagrant

drupal-7,vagrant,phpstorm,drush

Command Line Tool plugin -- no and there is no current plans for that. https://youtrack.jetbrains.com/issue/WI-23740 -- watch this ticket (star/vote/comment) to get notified on decision/progress. But you can use built-in Remote Terminal (over SSH) for that: https://confluence.jetbrains.com/display/PhpStorm/Using+the+PhpStorm+built-in+SSH+terminal+and+remote+SSH+external+tools...

How to make parent menu active when the child menu was active in menu block using drupal 7?

menu,drupal-7

Actually there is no requirement to use any module for this situation. What i have done to achieve it. I just modified template.php of zurb foundation theme. i have copied the code(foreach loop code) from here and added to the template.php file as mentioned in the page and added the...

Drupal 7 File Field Library

drupal,upload,drupal-7,drupal-modules

I'm using file field sources module: https://www.drupal.org/project/filefield_sources And it works well for me....

How can I import content to Drupal 7 using drush?

drupal-7,drush

By using migrate module,we can create a script to import content. After that using drush commands to import content. drush mi --help...

Drupal 7 uuid.module Database update 7103 fails

drupal,drupal-7

It seems is an error from the uuid module, try to downgrade the version to 7.x-1.0-alpha5 and I think it fixes the error. You can download this version here....

Removing HTML arrows from homepage

html,css,css3,drupal,drupal-7

Try: #homepage-full .node-homepage { background: none !important; } ...

Static Comments on Drupal Node

drupal,drupal-7,comments,drupal-modules

You can achieve this by deleting comment_body field from Comment fields tab of content type & adding new field of type List(Text) with options of fixed text. Check screenshot below: Step 1: Step 2: Step 3: ...

Allow only certain roles access to custom module in Drupal

php,drupal,drupal-7

Actually you don't need to define the access callback, it defaults to the user_access() function which is powered by the hook_permissions from drupal. The access arguments in the hook menu should be the same as the array key in the hook permission. So try removing the underscores from the 'access...

How to remove Drupal Simpletest tables?

drupal-7,simpletest,drush

use the below command drush test-clean Here is all command lists for Drush You will be able to run the individual test. Example comamnd drush test-run --methods Here is the list for available test. ...

Why content appears misplaced?

drupal,drupal-7,drupal-modules

Seems to me like the Show function of the calendar class outputs rather than returning a string. try this: function _page_calendario() { $objCalendar = new Calendar(); ob_start(); $objCalendar->Show(); $calendar = ob_get_contents(); ob_end_clean(); return array( '#markup' => $calendar ); } ...

Use the value of “Database log messages to keep” that user select

drupal,drupal-7

The value is stored in the variable table and uses a default value of 1000. To retrieve the value you can use: variable_get('dblog_row_limit', 1000); ...

Drupal taxonomy terms language depending - why nodes in all languages are visible?

drupal-7,internationalization,drupal-taxonomy

I have set the vocabulary to Translate. Different terms will be allowed for each language and they can be translated. and duplicated each brand for each language and then updated each node - with setting term for particular language. In my opinion this is workaround, but I couldn't find other...

How i can separate a sentence in php? [closed]

php,drupal,drupal-7

Try this:- $str = '[1234]-blablabla'; preg_match_all('!\d+!', $str, $matches); echo "<pre/>";print_r($matches); // print as an array $new_string = $matches[0][0]; // assign to an string variable echo $new_string; // print that string variable. Output:- http://prntscr.com/7ano0t Note:- it's up to you how you want. Array or string. I putted both for your convenience....

Why isn't my autocomplete.js textfield responding to input (Drupal 7)?

drupal,autocomplete,drupal-7

I ran your code in a test environment, and I got autocomplete to work by adjusting your test JSON to simply $results = array('Thing 1', 'Thing 2')

Join DB tables on Drupal

php,mysql,database,drupal,drupal-7

Your field alias u doesn't exist. You declared di and wa but not u. Change this to wa, I suppose the selected columns are from the watchdog table. $query = db_select('distinct', 'di'); $query->join('watchdog', 'wa', 'di.wid = wa.wid'); $query->fields('wa', array('variables', 'type', 'severity','message', 'wid', 'timestamp')); $result = $query->execute(); ...

Drupal Cron - help required in setting monthly and weekly cron

php,drupal-7,cron

The core cron in drupal works as everytime it is executed it runs through all hook_crons and executes them. If you want to have one cron that should execute weekly, and one monthly you can install Elysia Cron module which will let you to set different settings for every different...

Android How receive Push notification by using drupal server

android,drupal,drupal-7,notifications

Finally I found my error. I am Trying to get notification message in Broadcast receiver, but it was wrong I m getting message in this service onMessage(Context context, Intent data). public class GCMIntentService extends GCMBaseIntentService{ private static final String TAG = "GCMIntentService"; public GCMIntentService() { super(SENDER_ID); } @Override protected void...

Separate page node for a specific type of content

drupal-7

Unable to understand your exact requirement but let me answer what I got. Create a panel page and give path to this page for that specific page you want to create for your content type. If you have already created that page using "/node/add/informes" then give its link to panel...

Drupal-7 website is very very slow

drupal,drupal-7

I find http://www.webpagetest.org/ is great for analysing where your website is waiting. With that information, you have the clues you need to delve deeper into the problem. Don't try setting up all sorts of complex mechanisms if, for example, your site is using huge image files.

Convert a currency string to a number Drupal Views / PHP

php,drupal,drupal-7,views,drupal-views

You need 2 steps: Install Views PHP (7.x-2.x-dev) - that will give you a Global PHP field in Views Exclude the original field (say field_currency) which is holding the value from display in Views (using tickbox), and then use the value of the excluded field in additional PHP field: In...

Workbench hook_form_alter changes

button,drupal-7,hook-form-alter

Actually, the best solution turned out to be a custom module. The issue preventing me from seeing the data for the Send to moderation and Save as draft buttons was due to the weight of my module. Using the Modules Weight module to my modules weight appropriately so that it...

drupal_set_message do not work

php,drupal,checkbox,drupal-7

It's not worth the added complexity to try and optimize a loop like this with continue statements. Just set a flag to FALSE, then iterate over all the checkboxes and set the flag to TRUE if any are checked. After the loop completes, if the flag is still FALSE, then...

Solr Query, Syntax trouble with drupal apache solr module

apache,solr,drupal-7

You're using a lot of clauses so it is very hard to determine here what could be the cause. I can give you the following hints: a) Debug mode Copy the whole query string, go to the Solr Admin console and execute that query with and additional debug=true or debugQuery=true....

Drupal 7 - show logged in user full name and email id

drupal-7

You could use print_r($user) to look at the $user object. But i dont think global $user includes profile fields, so you might have to load the user object again like so: global $user; $account = user_load($user->uid); print_r($account); And the email field is usually: $user->mail; ...

how to limit view to just show each type one time?

drupal,view,drupal-7,content-type

You can achieve this by following the steps given below: Enable aggregation under Advanced Accordion of the view Add Nid field & set aggregation type as Count Distinct Exclude Nid field from display Add news type field & set Aggregation type as Group results together, in Group Column select Value...

How to add / update a field collection without updating parent node/entity drupal 7

drupal,drupal-7

You have to pragmatically relate your field collection to the host entity by the following code. $field_collection_item = field_collection_item_form_submit_build_field_collection($form, $form_state); $field_collection_item->save(TRUE); $host_entity = $field_collection_item->hostEntity(); $lang = 'und'; if (isset($host_entity->nid) && isset($host_entity->vid) && isset($lang) && isset($field_collection_item->item_id) && isset($field_collection_item->revision_id)) { $query =...