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!!...
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...
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...
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...
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...
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....
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...
sql,drupal,drupal-7,entityreference
You can set the query to be a count query only by using : $count = $query->count()->execute(); ...
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> ...
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>...
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,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...
you may use the rewrite option to make image field as link in drupal views with replacement pattern.
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' ....
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...
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...
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....
Did you add this? color: #FFF !important; The important part makes it override the other stuff....
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,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....
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...
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...
Found the problem. My site name includes an & which generates file name to readable by the XHProf.
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>'; ?> ...
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" /> ...
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-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...
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 ...
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...
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...
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,drupal,drupal-7,push-notification
Enable permissions for anonymous user in Drupal administration - People/Permissions/Push permissions. It helped me.
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...
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...
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',...
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...
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...
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,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...
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...
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,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. ...
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...
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...
You can use use hook_css_alter to achieve this. You can find an example here. Hope that helps....
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....
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...
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...
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...
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...
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...
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...
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)....
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...
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,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...
->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...
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...
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()); } ...
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...
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.
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...
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...
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...
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,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....
By using migrate module,we can create a script to import content. After that using drush commands to import content. drush mi --help...
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....
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: ...
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...
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. ...
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 ); } ...
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-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...
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....
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')
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(); ...
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,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...
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...
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.
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...
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...
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...
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....
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; ...
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...
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 =...