According to this site it should be just: ->condition('numbers', array_keys($my_array), 'IN') ...
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...
Probably you have the jQuery update module installed in your Drupal Website. Try to disable it. Also you can add jQuery migrate....
Your recvfrom/sendto are just MySQL queries, so it's nothing wrong with it. Inserting into menu_router table indicates that Drupal is rebuilding this table (see: menu_rebuild() API); This function will clear and populate the {menu_router} table, add entries to {menu_links} for new router items, and then remove stale items from {menu_links}....
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...
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...
The PHP Fatal Error occurs because the server is running PHP 5.4 now but you are using PHP 5.3 or an earlier version (check your version in admin/reports/status in Drupal). If this did not happen on the server up until recently then it is possible that your host updated the...
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...
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...
When Solr starts and the index folder doesn't exists Solr create it by itself. To make it possible the folder be created by tomcat user this user need to have permission to create the folder. If the tomcat user doesn't have permission to create the index folder an exception is...
php,html,drupal,phpbb,question2answer
You can integrate them all to use a single userbase (and/or search index) for sure. However, unless you find a ready bridge that accommodates them all, you will need to: study each application's databases and map the way they store users and data, build hooks into the source code on...
It is about the Cross-Site Request Forgery (CSRF or XSRF). Being a web developer I knew this term for sure but was unaware about its linking with 'Confirmation Page'. What is Cross-Site Request Forgery(CSRF or XSRF)? CSRF is an attack which enforces an end user (authenticated user) to perform some...
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 ); } ...
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(); ...
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...
Check in your settings.php if you have a base_url variable and change it. It should fixes your problem.
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...
cordova,drupal,android-gcm,push,apn
Before your Cordova/PhoneGap app can use push notifications, you need to do some setup work like registering with the server and retrieving the token. The plugin provides an easy way to do that setup work in Javascript without having to write the code yourself for each platform you want to...
You can create a custom module and then implement hook_form__alter() You would need to find the IDs of the webforms you want to target. Then: function mymodule_form_webform1_alter(&$form, &$form_state) { array_unshift($form['products']['#options'], array($_SESSION["product_name"] => $_SESSION["product_name"])); } or similar...
You can do it with .htaccess as said before. But if this happens a lot to you and if you want to manage your redirects, you can also install module Redirect https://www.drupal.org/project/redirect ...
asp.net,drupal,single-sign-on,asp.net-identity,windows-authentication
Yes, it is possible, but it is very very painful to do that. It is complicated, I only can provide a direction to do it. Key words are: WCF API and PHP soap. You need to create an API with a function being called when the user logs into Windows....
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...
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...
sql,drupal,drupal-7,entityreference
You can set the query to be a count query only by using : $count = $query->count()->execute(); ...
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...
//Error to show in the tpl if (isset($this->error['city'])) { $this->data['error_city'] = $this->error['city']; } else { $this->data['error_city'] = ''; } //To show the other text value in the form if (isset($this->request->post['city'])) { $this->data['city'] = $this->request->post['city']; }elseif (isset($this->request->get['id'])) { $this->data['city'] = $order_details['city']; }else { $this->data['city'] = ''; } you have add this...
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>'; ?> ...
There could be a number of reasons. Drupal cache is very notorious so ensure to clear cache. You can do that via instructions here Clearing the cache The easiest way to clear the Drupal cache is to go to Administration > Configuration > Development > Performance (http://example.com/admin/config/development/performance) Click the button...
php,arrays,drupal,drupal-7,array-merge
Just use array_intersect(): $array3 = array_intersect($array2, $array1); ...
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)....
php,bash,drupal,terminal,macports
Do not modify files in /usr/bin. That's Apple's turf, and there are always other possibilities to avoid changing things there, especially since Apple's next update will happily revert these changes again and scripts might rely on /usr/bin/php being exactly the version Apple shipped with the OS. Put the original binary...
You can try Automatic Entity Label module. It can be used to automatically generate, for example, node title, or product title, using tokens. You will need Token module as well. You will need to use something like that as a pattern for product title (pseudocode): [product:event_date] -- [product:event_title] -- [product:price]...
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.
As you'll have to determine how to structure the content in Liferay, I'd recommend going through the API - you'll need to create the appropriate pages, determine the layout you need for that page, position the content (e.g. navigation, web content, asset publisher, blog) on the page. This is highly...
android,drupal,drupal-7,push-notification
Enable permissions for anonymous user in Drupal administration - People/Permissions/Push permissions. It helped me.
As I read your question, the Views Field View module popped into my mind as the obvious solution (then I saw your edit). I think this will still be your best bet. Definitely avoid using php fields as that is not a good practice in general from a security standpoint....
css,drupal,libraries,beta,drupal-8
I solved the problem. The problem was that the name of my style directory was not the same as the name of my libraries and info files. What I mean is that before, I was doing something like naming my file "mytestblog.info.yml" and then trying to link to myblogsite/global-styling. Once...
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...
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...
Backup before synchronizing with drush ard or drush @dev ard or with the suited alias. You can set the backup path in the alias settings. I think you named your remote server dev. That is why I keep this in the following and use the alias local for the local...
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')
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...
Try accessing it like this: form_state.values['body'].und[0].value DEMO...
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...
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...
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()); } ...
php,mysql,database,drupal,drupal-7
You are using < (lower than) instead of > (greater than) in your code example. $r = db_select('blabla', 'b') ->fields('b') ->condition('variables', $variables, '=') ->condition('timestamp', $timestamp, '>') ->execute(); If you want to debug and view the executed query, you can make use of the dpq() function (part of the devel module)...
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,curl,drupal,module,libcurl
It may be because curl lib not exist on server. You can try installed curl on machine or no. It possible from terminal or just create test.php with code: // Check if curl module installed if(!function_exists('curl_init')) { throw new Exception("cURL module not installed."); } phpinfo(); If curl lib exist but...
I can't help you on the Drupal side, but Liferay has many different kinds of content: Web Content (the CMS), Blog Entries, Message Board Articles, Documents (and images or other media) and many more. Depending on the data you want to import, you're dealing with any of them. All of...
A few possibilities: In the settings.php (sites/default/settings.php), see if there is a $base_url set. If you can see any, comment that line. You can run a drupal site without the base_url hardcoded in the settings.php In the .htaccess look for redirects. Your safest bet is to replace it with a...
You can use use hook_css_alter to achieve this. You can find an example here. Hope that helps....
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); ...
php,symfony2,drupal,drupal-modules,drupal-8
In the routing yml file add the single quotation marks around the value for your path. Also remove the $ sign from the 2 parameters. Since beta 4 of Drupal 8 you have to specify the path as _controller which should return a render array. kalvis.routing.yml file as: kalvis.content: path:...
Use function hook_watchdog(array $log_entry) { } where $log_entry is an array with all the log data you need. Read more: https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_watchdog/7...
The only way I see this achievable is by writing a custom access callback logic. In this callback, you will check if the user has the same uid as the page he is trying to view. If so, grant him access; otherwise, block him. function my_custom_access_callback($account) { global $user; //...
string,search,drupal,solr,full-text-search
I found out that this was my own configuration fault ... I added part word search using this filters: <!-- Word Part Search Filter: --> <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="15" side="front"/> <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="15" side="back"/> As the maxGramSize was limited to 15 it couldnt work... I raised it up to...
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....
forms,search,drupal,pagination
Page parameter is working: http://www.perfectchoice.ae/properties-browse/?page=3 So some other is causing the problem. When you move to some page and it doesn't show anything try removing URL parameters one by one until you figure out which one is causing the problem. But in any case you will need some Drupal knowledge...
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....
php,wordpress,api,magento,drupal
For wordpress you can use this api: http://api.wordpress.org/core/version-check/1.7/?version=3.9.1 example code to parse: $a = file_get_contents('http://api.wordpress.org/core/version-check/1.7/?version=3.9.1'); $a = json_decode($a); echo $a->offers[0]->current; About drupal cms try this: http://updates.drupal.org/release-history/drupal/7.x http://updates.drupal.org/release-history/drupal/8.x About MagentoCE try parse this file: http://notifications.magentocommerce.com/community/notifications.rss the pattern wil be: Magento...
Make use of isset function, Try something like this if( isset($variable) ){ // do so and so.... }else { // define variable $variable = 'foo'; } ...
drupal,plugins,content-management-system,themes,drupal-modules
Themes are (usually) only styling front-end of your site. Drupal by default (must) have users system login/registration form and all other functionality related to users. When you activate your new theme logout and go to page "/user" to see your loging form. There are also "/user/register", "/user/password" and some other...
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: ...
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,html,drupal,hyperlink,drupal-6
You can access $node object. $node->nid will return you NID of the node. Or <?php if (arg(0) == 'node' && is_numeric(arg(1))) $nodeid = arg(1); echo $nodeid; // show me your nid! ?> Edit (function more general): <?php /** * Used to get the current viewed node (works when viewed in...
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...
Drupal is adding an "active" class to the links to the current page. This is different than setting the property of an <a> to "active". Use the selector a.active in your CSS instead of a:active. You should be able to inspect the properties in developer tools to ensure the class...
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...
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,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...
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 ...
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!!...
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....
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',...
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 =...
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.
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-modules,drupal-views
Try using this module: https://www.drupal.org/project/menu_token. It allows you to insert tokens into the menu Path. So, if you have 3 sub-sites: yourwebsite.com/facultyA yourwebsite.com/facultyB yourwebsite.com/facultyC you can configure your menu Path as: [faculty:name]/dean-word [faculty:name]/history etc. Now you have one sub-site menu, that shows different content depends on faculty....
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...
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...
http,ssl,drupal,https,softlayer
https://www.drupal.org/https-information has some information on how to use SSL certs in drupal specifically. Since you didn't provide the actual error your browser is giving you, I'm going to guess its a domain name mismatch error (like this https://www.digicert.com/ssl-support/certificate-name-mismatch-error.htm ). Basically you will either need to access your site via the...
I haven't seen this error before, but I think it's telling you that you have to install composer, which is now a requirement for Drush. See the installation instructions for Drush: http://docs.drush.org/en/master/install/#composer-one-drush-for-all-projects.
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...
The dc:language of a document will be set if something set it beforehand. By default in Nuxeo it's not used, it's up to the application or the user to set it if needed.