texts: Drush updates core successfully to 7.32 but is still 7.31

texts:
I'm developing a site on Drupal 7 and using drush 7.0-dev to keep the core and modules up to date. I've run drush pm-update several times successfully in the past, until Drupal core version 7.32 came out. Everything seems to go fine and drush reports no errors, but the version still stays at 7.31 after the update.

Here's the output of two consecutive runs:

me@mybox:/var/www/customer$ drush pm-update
 Name    Installed Version  Proposed version  Message
 Drupal  7.31               7.32              SECURITY UPDATE available

Update information last refreshed: Thu, 10/23/2014 - 20:21
Code updates will be made to drupal core.
WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications
to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.
Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.

Do you really want to continue? (y/n): y
Project drupal was updated successfully. Installed version is now 7.32.
Backups were saved into the directory /home/me/drush-backups/customer/20141023172524/drupal.                                                                                [ok]
No database updates required                                                                                [success]
'all' cache was cleared.                                                                                [success]
Finished performing updates.                                                                                [ok]
me@mybox:/var/www/customer$ drush pm-update
 Name    Installed Version  Proposed version  Message
 Drupal  7.31               7.32              SECURITY UPDATE available

Update information last refreshed: Thu, 10/23/2014 - 20:25
Code updates will be made to drupal core.
WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications
to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.
Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.

Do you really want to continue? (y/n):

Am I doing something wrong? Why is the core not updating? Where should I start troubleshooting? I haven't tried a manual update yet, because I'd really rather get drush working again. The server is running Debian 7 and PHP 5.4.


texts: jCarusel + colorbox, show one thumbnail and open different image

texts:
I have a jcarousel view, a colorbox, and content type that have two fields: thumbnail and full_image. This is because I don't want to be depend on Drupal scaling/cropping . I would like to show thumbnail in jcarousel and after click - open full_image.

In Views there is "Colorbox trigger" field, so I first loaded two hidden fields of both images, and then "Colorbox trigger". I set thumbnail as trigger field, and token of full_image as popup content but it doesn't work (after click, resized thumbnail appears). I feel that I'm just missing something obvious but I'm not sure what. Or maybe is this more complicated?


texts:
I have 5 different content types and I've added content / nodes. I'm using graphQL to fetch the data, however in 1 of the content types the data is not being returned. This is the latest content type I've added, so I can query data from all 4 other content types and get the data I expect without any problems using fragments.

My query for the new content type is simple.

{
  nodeQuery {
    entities {
      ...on NodeGlobalContent {
        title
        body {
          value
        }
      }
    }
  }
}

The empty result is the following.

{
  "data": {
    "nodeQuery": {
      "entities": [
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {}
      ]
    }
  }
}

If I query the node by ID, I get the following data.

query {
  nodeById(id: "20") {
    entityLabel
    entityBundle
  }
}

{
  "data": {
    "nodeById": {
      "entityLabel": "test",
      "entityBundle": "global_content"
    }
  }
}

Why can't I retrieve the data using a fragment?


texts:
We have "access callback" and "access argument" for defining the access to pages.

What is the way to restrict showing blocks? Can "access callback" also be defined in hook_block_info(), or through any other way?


texts: Can you have multiple groupings on a view?

texts:
Is there a way to toggle between several different grouping on one view?

I have a view that is a list of nodes and I need to be able to group them by node title or by created date.   Is there a way to do this without having to create two different views?


texts: Add a node as a select list in Webforms Drupal 6?

texts: I want to make a Webform in Drupal 6 where I can put a <select> list where the lists are a node. I already created a content type which is events and these events expires. So what I want is when the user submits a form he/she has the ability to select from the <select> list so when the form is submitted, when I go to the submission results, I can see the content type(events) which the user chose upon submitting the webform. Is this possible? Thanks


texts:
I have webform 7.x-3.18+3-dev and webform presav e 7.x.1.1 installed

how can I make one field be obligatory depending on another field.

Eg if someone selects phone as best form of contact they must fill out the phone field. If they choose email they must fill out the email field.


texts: How to change Omega subtheme's layout for a view

texts:
I sense this can be done with Context etc, but it doesn't feel right to issue a few more modules for the job of a few lines of code.

Something like the following has to fit this:

function mytheme_omega_layout_alter(&$layout) {
  if (arg(0) == 'node' && is_numeric(arg(1))
      && $node = node_load(arg(1)) && $node->type == 'article') {
    $layout = 'article';
  }
  else if ($view = views_get_current_view() && $view
      && $view->name == 'term_content' && $view->current_display == 'term_page') {
    $layout = 'term_page';
    print '<pre>';
    print_r($view);
    print '</pre>';
  }
}

The problem here is, views_get_current_view() looks like it doesn't play well in this hook. I couldn't find any documentation.

I'll send best of my karma-pack to any contribution:) Cheers!


texts: What happened to the arguments part of views 3?

texts:
Am I just blind?

(I'm trying to pass the current page's nid into a block where I'm theming a view and want to filter the view by the nid.)


texts: How to create a views that display all the publish content type as one output per user

texts:
Intro : I have created a two different content types because I needed two different moderation process for those two content type, each of those content type are limited to 1 per user. Those content are "Projet Description" and "Projet Images".

Now I need to combine those two content types into one with views so I can show the user projet and is related images. The problem I have for the moment when I group result together by UID is that the two node hare display separately and I see a Title for the Projet but I also see a Title for the Images.

What I need is :

USER 1
Title : My Projet Titre
first image for this project: (image1)

USER 2
Title : My Super Projet
first image for this project: (image1)

What I have for the moment is :

USER 1
Title : My Projet Title

Title : Images for the Projet
(image 1)(image 2)(image 3)

USER 2
Title : My Super Projet

Title : Images for the Projet
(image 1)(image 2)(image 3)

PS: I try to keep that as one question but I also need to have a exposed taxonomy filter for Projet


texts: select list sending old value in ajax request

texts:
I have a select list on custom module form, on it's select giving ajax call and populating the second select list. But when I select the value from the first list, it is passing old value (previously selected) to the callback function (It should send currently select value).
Following is my code.

  function get_subject($form, &$form_state) {
    $form['students'] = array(
      '#type' => 'select',
      '#options' => $student_array,
      '#title' => t('Students'),
      '#id' => 'students',
      '#value' => ($students != '') ? $students : '',
      '#required' => TRUE,
      '#ajax' => array(
        'callback' => '_subject_loader',
        'wrapper' => 'subject_div',
      ),
    );
    $form['subject'] = array(
      '#type' => 'select',
      '#options' => $subject_list,
      '#title' => t('subject'),
      '#id' => 'subject',
      '#prefix' => '
',
      '#suffix' => '
',
      '#value' => ($subject != '') ? $subject: '',
      '#required' => TRUE
    );
    $form['submit'] = array(
      '#type'=>'submit',
      '#value'=>'Submit',
    );
    return $form;
  }

  function _subject_loader($form, $form_state) {
    return $form['subject'];
  }


texts: I’m busy with a Drupal 7 Commerce site, and I need a correct and working payment method to handle the payments in ZAR (South African Rand) and not in any other currency.


texts:
I am beginning a module which implements the hook_webform_submission_insert. I am successfully getting the following data from my implementation of that hook:

stdClass Object
(
    [nid] => 3401
    [uid] => 1
    [submitted] => 1425491295
    [remote_addr] => http://myserver.com
    [is_draft] => 0
    [data] => Array
        (
            [2] => Array
                (
                    [value] => Array
                        (
                            [0] => Chandler Mann
                        )

                )

            [3] => Array
                (
                    [value] => Array
                        (
                            [0] => tecutij@yahoo.com
                        )

                )
.
.
.

I need to write code to programmatically map each value index to node fields in a process of creating nodes from custom code.

However, as the output above does not have field names, it's difficult to map correctly to the necessary node fields.

Can anyone advice how I might discover what name webform assigns to the field#id 2, 3 etc as in my code sample above?


texts: Altering ImageField Widget with FUpload enabled

texts:
I need to alter the ImageField Widget so that I can add some fields other than the Description, Alt and Title fields. I'm able to do this when I select the file field widget type as Image Uplaod, but when I select the FUpload widget type, the changes don't take effect. Here's the code I'm using:

function bridge_widgets_imagefield_extended_widget($element, $extra_values) {
  // If you need the field or widget to conditionally add a FAPI field, use these.
  $field = content_fields($element['#field_name'], $element['#type_name']);
  $widget = $field['widget'];

   if( $element['#type_name'] == 'property_gallery'  ){
  global $user;
  user_load($user);
  return array(
    //This will Replace the Textfield with dropdown select for the description
    'revise' => array(
      '#type' => 'checkbox',
      '#title' => t('Revise This Description'),
       '#default_value' => isset($extra_values['revise']) ? $extra_values['revise'] : 0,
         '#attributes'=>array('class' => 'revise-check')
       ),
    'revisedby' => array(
      '#type' => 'textfield',
      '#maxlength' => 64,
      '#title' => t('Revsied By'),
     '#default_value' => ($extra_values['revise']==0) ?  NULL : $extra_values['revisedby'] ,
       ),
       'revisedon' => array(
      '#type' => 'date',
      '#title' => t('Date'),
     '#default_value' => ($extra_values['revise']==0) ?  NULL : $extra_values['revisedon'] ,

       ),

  );
  }
}


texts: How can get path of image (src) in twig template of a module?

texts:
How can I get access to image path (source/url) in twig template of a module?
I try to render an image that's located in my module folder in module template, this image is a static image that's not assigned to a field.
I try several methods to achieve this demands for eg:

and below method:

MyModule.module

function MyModule_preprocess(&$variables, $hook) {
    $variables['base_path'] = base_path();
}

and then in template:

And i try solution that's written in this article too: Using images in custom module
But both of them refer to my theme directory instead of module directory and seems none of them work in module template.
Thanks for any solution.


texts:
I am trying to accomplish the following through feeds and want to know if this is possible.

Setup a cron to pull a CSV file via ftp from another server daily
Create a bunch of nodes with custom fields based off the CSV file

I have the latest Feeds module setup, When I go to create a node it says I can upload my CSV file, however it seems the mapping could be wrong? I was a little confused at when I was setting up the mapping. My CSV file has no headers so for the source I put in the Column Name i.e A, B, C etc.

What am I doing wrong?

Link to CSV: http://markets.naptiveagency.com/diamondlot.csv


texts: How to make filter that can find users by location of each other in miles or kilometers?

texts:
On  a lot of dating sites like this one:

http://www.pof.com/basicsearch.aspx

users can search each other by proximity, can this be done with Drupal? Like searching for users within X kilometers of my IP?


texts:
I need to customize the aspect of one single field in a editing admin form.
More specifically I want change the height of a multiselect field.
Have I to create complete admin sub-theme containing just a one-line CSS file or there is another way to achieve this?


texts: in drupal 7, how to add user pic and name to the user menu when logged in?

texts:
In drupal 7, there are default blocks such as user menu block and login block, the user menu block are especially working for the logged in user while login block are working for non logged in user.

the user menu block contains the static user menu with account, profile, logout menu item, however what I want to do is when the user logged in, the user menu can have additional menu item showing the user pic and name.

I know this could be done by making a new block with php code, but I just want to know if I want to use the existing user menu block, what and how I should change it?


texts: How can I remove emoji from all user input?

texts:
It looks like iPhone emoji are not currently supported in Drupal 7 on MySQL.

When I try to save a node containing an emoji (I  U!) in the database, I get an SQL error:

  PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect string
  value: '\xF0\x9F\x92\x9BRi...' for column 'body_value' at row
  ...

So, to avoid this very unpleasant user-unfriendly error, I would like to automatically clean all user input, including all node textfields and private message module messages.

I found several functions for removing emoji, but which hook can I use to clean all user input?


texts:
we are about to build an ecommerce webiste using drupal commerce, we are going to take product list from semantic3 and we found that it has like 70 milion product list and 10 bilion sales offer .. will drupal commerce support that amount .. and what do your recommend ... and is there a better way for import ..

Thanks


texts: How to create RSS feed for particular content type in drupal 8?

texts: I have to create the RSS feed for particular content type and found some module and try to generate some RSS feed but I won't. If you have any idea or if anyone did this Please share with me.


texts: Run feeds importer crons one after another

texts:
I have two feeds importers. I wanted to run the 2nd importer when the first is finished.

I have written a cronapi hook for those two importers.

/**
 * Implements hook_cronapi().
 */
function mymodule_cronapi($op, $job = NULL) {
  $items = array(
    'cron_one' => array(
      'description' => 'import feeds one',
      'rule' => '4 0 * * *',
      'callback' => 'mymodule_import_feeds_one',
    ),
    'cron_2' => array(
      'description' => 'Import feeds two',
      'rule' => '4 0 * * *',
      'callback' => 'mymodule_import_feeds_two',
    ),
  );

  return $items;
}

In the hook_enable I am executing the first importer

function mymodule_enable() {
  mymodule_import_feeds_one();
}

function mymodule_import_feeds_one() {
  $src = feeds_source('import_feeds_one');
  $src->save();
  // Set the directory path.
  $source = 'directory-path';
  $config = array('FeedsFileFetcher' => array('source' => $source));
  $src->addConfig($config);
  $src->save();
  try {
    $src->import();
    $src->schedule();
  }
  catch (Exception $e) {
    return FALSE;
  }
  // Prevent notices from being thrown.
  $src->state(FEEDS_FETCH);
  $src->state(FEEDS_PROCESS);
  $src->state(FEEDS_PROCESS_CLEAR);

  return FALSE;
}

In hook_feeds_after_import

/**
 * Implements hook_feeds_after_import().
 */
function mymodule_feeds_after_import(FeedsSource $source) {
  if ($source->id == 'import_feeds_one') {

    mymodule_import_feeds_two();
  }
}

The problem is, when I enable the module, it schedules both importers on next cron run.

I want to schedule only the first one and when the first one is completed then schedule the 2nd one.

How can I do that?


texts:
I'm using Drupal 7. When I post a comment to an article, its title looks like comment title.

I need only the “comment title” to be displayed, without the link.

I found the code in the comment.tpl.php template where the title of the comment is printing.

  <?php print render($title_prefix); ?>
  <h2<?php print $title_attributes; >><?php print $title>

  <?php print render($title_suffix); ?>

As is said in the file description, $title already contains the link, so I can’t change it!

  $title: Linked title

Does anybody know if there is a way to print the comment's title without a link?


texts: Password-protect page and its dependencies

texts:
I haved a Views-generated page, listing links to some downloadable files. The page itself is restricted to a certain role, and this obviously works ok, but I would also like to protect all the links listed on the page.

Currently, an authenticated user with a privilege to view the page, can send a working download link to anonymous user, which is not ok.

Of course, I could certainly protect the files directory with htaccess, but I would like to manage the access and session validity from Drupal.

Has anybody solved a similar setup? Are there any modules for that?


texts: How to take a migrated site live, when content is being added to the old site

texts: After you migrate content from an old site (currently the live site), images users, etc.. into a new Drupal site. And the new site is still being worked on by developers, it is not ready to go live yet. Editors are adding new content to the old live site. The question is do editors need to add new content to the old live site and the new Drupal site until the new site goes live?


texts:
nav arrows AROUND the blog view?

I've finally gotten pretty close to what I was aiming for on the recent blog entries view..
I've posted my version above and what I'm aiming for next..
I still need to change the page numbers below for nav arrows on the sides. Is there still something in the views settings I need to be looking for. I saw a place for arrows, but they are always above or below. Is it CSS to push them to either side and let the blogs settle between them?

css

 #views_slideshow_controls_text_previous_slide_show_of_members-block_1_1 {
    background: url(../sites/all/themes/twodrop/images/comment-arrow.gif);
    /* shows image */

    /* Hide the text. */
    text-indent: 100%;
    white-space: nowrap;
    overflow: hidden;
}
 #block-views-the-blog-block h2 {
    text-align: center;
}

I did find this thread under similar questions, but it seems a bit excessive.. surely a better answer has bubbled up in 4 years?

.. additional question, so it may warant a seperate thread, but I'm also trying to aling each section. Should I look at moving the title into the header and the date into the footer? Or is this better handled in CSS?


texts: Custom user registration email - Drupal 6

texts:
I want to add image icons for Facebook, Twitter etc with associated links and Join Us hyperlink like Join Us to the user registration email.

Can anyone give me idea?


texts: Adding a block where an admin can create users on the fly

texts:
What methods are there for creating users on the fly for Drupal 8 in a block? I'm creating a page where the admin can create content, but also there is a user reference field. I currently have it expose current users in the system that you can choose from. In order for me to create a new user to the list, I have to goto the admin/people/create page, but what methods are there to expose this user creation form on the content creation page?

I tried inline_entity_form but that doesn't work as it is still in alpha. It's best if I can just do this in core. Ajax isn't necessary as reloading the page is ok.


texts: How can I get the content type name inside the hook_form_BASE_FORM_ID_alter() hook?

texts:
I need to obtain the content type name inside an implementation of the hook_form_BASE_FORM_ID_alter() hook for the node edit/add form to made some validations.

I can't find any node object reference using kint() to access to the $node->getType() value.

I need to do a validation like this:

if ($node->getType() == 'article') {
...
}

So, how can I get the content type name inside the hook_form_BASE_FORM_ID_alter() hook?


texts:
I work on a Drupal project in business and we are facing a problem. We have a webform node with an alias ..../contact. We also have a page view .../news listing a specific type of content. Recently, when we want to go on / contact, we are redirected to the page /news. By enabling dlevel, it displays: "The user is being white Redirected to /en/news."

We have the "Pathauto" and "Global redirect" modules, but we never had a problem with these two.

We have no idea from where this redirection can come ... :(


texts: Best way to add fields to the output of a View

texts:
I have a View which lists contents. I have a few fields which are composite and have a somehow convoluted logics. What I do is to add some "dummy" fields (for example, the nid of content, or the rf (reference) of product) to the View, and then in hook_views_prerender I modify the value by the logic. For example:

$brand = $view->result[$key]->taxonomy_term_data_field_data_field_brand_name;
if($brand == WHATEVER){
   $view->result[$key]->field_field_field_rf_product_3[0]["rendered"]["#markup"] = function_to_substitute_complicated_value($parameters);
 ...
 }

Now, is it good idea to have this dummy field, field_rf_product_3, or would it be better to create a new field programmaticaly, and if so, how could it be done to be added at the proper place (after a given rendered field) in the View output?


texts: How can I use the Comment field as a way to privately message the node author?

texts:
I am working on a classifieds site where individual users can sign up and, of course, post things they would like to sell.

However, I need for users, both anonymous and signed up, to be able to contact the poster about his or her item.

Using the default comment form for this would be perfect.  What would I need to do in order to allow only the author of that node to see the comments for his node? I don't mind writing a module if I need to, but I am not sure how to get started. Even if I had to go that route, sounds like I would need to modify the permissions setting?

I know there are other modules out there like Private Message, but that's just too big and bulky when Comments work almost exactly like I need them to.

Thanks!


texts:
Views module comes with a few default views. I have enabled and modified the frontpage view, but I'd like to go back to its default state that originally came with the module on a fresh install (without my changes). Is this possible?

Thanks


texts: Use form-submit to display results table on page

texts:
I’m struggling with how to get a form-submit to return the results of a database select-query.   I can build the form and the submit-function does the select-query to collect the results and builds a render-array:

$table = array(
    '#theme' => 'table',
    '#header' => array(t($field_1), t($field_2)),
    '#rows' => $tableRowS,
);

However I can’t figure out how to get drupal to render this table instead of just rebuilding and showing the empty form again. I’ve examined the concept of redirect but don’t see a way of passing the table to the redirected page.

Any help would be appreciated.


texts:
I am really stuck and need some advice, I'd like to know how I can go about doing this, simply put:

A website contributor enters a value into a field which is placed into the html.

eg. I have say two fields that will determine an image name and the file type. In field 1 the user enters [ABC], in field 2 the user enters [123].

The output of this would be <img http://www.example.com/[ABC].[123] />

I have never worked with my own custom modules/fields etc before, a point in the right direction would be a big help.


texts:
A  module for Booking type system which allow me to add Different Hotels, Apartments etc. in Different countries. I want to show Availability calender also.

I tried uc_hotel and AG Reservation but both don't meet my requirements.

I need price calculation based on room selected. If a user select only two rooms of an apartment and the apartment has 4 rooms, then the price is based on the selected room; filters are based on availability.
I need search functionality based on location, bedroom, people capacity, accommodation type, offers; the price is based on the extra facility provided.


texts: How does file_entity_file_download work with file_file_download?

texts:
I've recently upgraded my file_entity module and now have access woes on managed private files.

file_file_download() is granting permissions, as it should, by looking up whether the user has access to the node that owns the file. This part works.

However, file_entity_file_download is returning a deny (-1 in place of headers array), but the implementation of this completely ignores the node access records - which is odd - instead just going on whether a user has view private files permission.

Some users get access to some files - there is no concept of view all private files on my site.

Can anyone shed any light?


texts: How to customize the add-to-cart form using hook_form_alter?

texts: How can add-to-cart form be customized using hook_form_alter.  Or better yet can layouts like display suite or panels be applied to the add to cart form using hook_form_alter?  I have custom line item types that I would like to show using some kind add_to_cart form regions in 2 or 3 stacked columns.


texts: I was using a computer somewhere to login my site as admin, but forgot to logout. How can I logout my account from another computer?


texts: How to: JQuery Colorpicker in a form in FLAT mode

texts:
I want JQuery Colorpicker to appear in a form in a Flat mode - allow my site users pick a color of choice.

So I did the following:
a. installed JQuery Colorpicker field
b. created a new custom module - to load a new form
c. In the form - created a color picker like this:

$form['element'] = array(
'#type' => 'jquery_colorpicker',
'#title' => t('Color'),
'#default_value' => 'FFFFFF',
);

d. Bingo! - the color picker appears as a button - and NOT as a flat mode.

e. Looking at sample code from when I make a dummy HTML file with following code, the plugin works perfectly:

$(document).ready(function()
  {
    $('#picker').ColorPicker({
      flat:true,
      layout:'hex',
      submit:0
    });
  }
)

f. I tried the following without success:
1. Added a .js file to my module's .info file
2. Tried drupal_add_js() to include the file from my module
3. Added the script to my page.tpl.php

None of above has been successful - please help!

Thanks in advance!


texts: In Drupal Commerce, on what page does this order status fire? When an order is first paid in full

texts:
I'm currently setting up my Drupal Commerce checkout Rules and came across that you have setup your own Paid Status on payment sucess. By default Drupal Commerce only updates the status to PENDING.

What I need to know on what page does the following Rule Event get fired?

  When an order is first paid in full


texts:
I'm trying to print out the url path from the title in my twig template however I haven't been successful so far.

Printing out the title containing the link works fine using:

{{content.title}}

However, I would like to seperate the URL from the title so I can use it in other areas of my twig template. For example:

Example text

I've tried various combinations and suggestions from stackexchange/drupal forums but to no avail. e.g. {{ url }}, {{ uri }} etc.

Any ideas?


texts: Is there a way to quickly copy the same ordering and layout from manage fields to manage displays?

texts: I have a content type I made in Drupal that has over 50+ fields and all sorts of fieldsets, divs, and horizontal tabs.  I got the Manage Fields ordering and look to be what I want, but the manage display is all out of order and missing some field groups like the divs, fieldsets, and horizontal tabs.  I would need to add them all back in one-by-one!  Is there a quick way I can just click a button that would automatically take the existing layout from "Manage Fields" and use that for "Manage Display" for a content type?


texts: Adding SUM per node ID to Views in Drupal 6

texts:
I have a list of IDs, and these IDs have several amounts associated with them.

I need to sum the amounts per ID, and spit that out as the amount.

Here's my query alter:

function my_module_name_views_query_alter(&$view, &$query) {
  if ($view->name == 'my_module_name') {
    $query->add_groupby('nid');
    $query->fields['credit_amount']['aggregate'] = TRUE;
    $query->fields['credit_amount']['field'] = 'SUM(amount)';
  }
}

This is the ultimate output, but it doesn't work:

       [credit_amount] => Array
            (
                [field] => SUM(amount)
                [table] => my_module_table
                [alias] => credit_amount
                [aggregate] => 1
            )

What exactly am I doing wrong? How do you group by an ID field (in this case, nid from an organic group node) but aggregate an amount field per that node? The query would look essentially like this:

select n.title, sum(lf.amount) from node as n
join credit as lf on (n.nid = lf.og_node)
group by lf.og_node

This is in Drupal 6


texts: Drupal Custom Login Page Using Zen Sub-theme

texts:
I have a custom Login Page in my website

I am using Zen for my themes.

I already have the Login page using the naming convention (e.g xxx--xxxx--tpl.php) but I can't display my form in this page.

here is my cpde

page--user_block--login.tpl.php:

ONREVUE LOGIN

 /****This is where I want to display the form ***/

Register|Forgot Password?

My Template.php code

function Alphasys_theme(&$existing, $type, $theme, $path) {
$hooks = zen_theme($existing, $type, $theme, $path);
 // Add your theme hooks like this:
/*
  $hooks['hook_name_here'] = array( // Details go here );
*/

$hooks['user_login_block'] = array(
  'arguments' => array('form' => NULL),
       'template' => 'page--user_block--login',
);

 // @TODO: Needs detailed comments. Patches welcome!
 return $hooks;
  }

  function Alphasys_preprocess_user_login_block(&$vars) {
  // Modify the text of the submit button
 $vars['form']['submit']['#value'] = t('Login Now!');

  $vars['form_markup'] = drupal_render($vars['form']);
}

I don't know what's the problem with the Code but it seems I can't make to work...

I already tried to put

<?php echo $form_mackup ?>

in my page--user_block--login but doesn't work.. I already tried to clear the cache..
but it is not working either..

Please help me...Responses are much appreciated..Thanks


texts: Price by multiple attributes in Commerce

texts:
I need to dynamically alter a price based on the value of two attributes in Commerce. I'm quite new to commerce so not exactly sure how to achieve this. Using rope as an example, the price needs to vary based on both the length of the rope and it's diameter. I know I could create a line item for each length if that was the only variant, however due to both length and diameter being variable this becomes more of a challenge.

Anyone have any ideas?


texts: appling different styles based on taxonomy

texts:
I have a site with 120 categories of content. I've used taxonomy to make these categories. now I need to have some different styles base on the taxonomy which is used in nodes. OK? how can I do it.

I need something like page--article.tpl.php which you use to have different styles for different content types. but here I want to separate styles based on taxonomy

as my website is very big and heavy and has 700k visitors daily, I avoid using modules like panels or context! this modules will kill my site's performance and speed! so I need simple approach without using modules.


texts: How to use long/lat OR full address in Google Store Locator module?

texts:
I wonder if there's a way to use EITHER long/lat OR full address for store content type in the Google Store Locator module.

Has anyone done something along those lines?


texts:
Up until recently, I've been using version 6 of drush, and it worked like a charm. Since I started delving into Drupal 8, I installed drush 7 on my Mac using the install instructions (using Composer) for global drush. Initially, it was fine, but whenever I try to run it now, it just hangs. When I run it with -d, it gets this far:

Using the Drush script found at /Users/steve/.composer/vendor/drush/drush/drush.launcher using pcntl_exec

Running which drush shows the correct path  (/Users/steve/.composer/vendor/bin/drush), but like I said, running drush by itself or with any other command, it just hangs. From what I understand, the only error logging is to the screen, but since there's nothing being displayed to the screen, I'm not sure where to look. I don't have memcache installed (unlike this guy), so I know that's not the problem. Any suggestions?

Thanks

UPDATE: I am using Drush 8 not Drush 7 (I fixed the title accordingly). After a couple days, it's back to hanging again, and even using -d shows nothing.


texts: What to name field collection theme file?

texts:
There are several articles here that address theming field collections but none that specifically cover the naming conventions required to actually get them recognized by Drupal.

field--field-field-collection-name.tpl.php does not work for me. Perhaps because I am theming the edit page of my field collection, but field--field-collection-name--edit.tpl.php doesn't work either. I have tried every permeation and order of names I can think of with no success.

Surely there is a way to theme a page whose URL is domain-name/field-collection/field-field-collection-name/*/edit.

Any help?


texts: Is There a way to search non drupal solr index?

texts: I have a huge solr index. I'd like to build my UI within a Drupal site. I tested the apachesolr module but it only focuses on a Drupal node. Does anyone have a similar project?


texts: Removing Drupal GET Form apparently unnecessary parameters

texts:
I have a FORM built with Drupal 7 Form API, with URL (action) pointing to:

www.example.com/search-products

and the default method POST. My SEO mate has asked me to change the method to GET, so for SEO indexing purposes the URL will be explicit, for example:

www.example.com/search-products?brand=BRAND%201&model=Model%20Fantastic

I have changed the behaviour of the form by adding the following line at the end of the hook_form function:

$form["#method"] = "get";

Now the problem is that the generated URL has some "extra" info that I wouldn't want to be displayed. And it is apparently unnecessary, because if the View (landing page of the FORM) is paged, if I only pass the above parameters + the page, it works perfectly, also if I remove this extra info by hand.

The "ugly" URL is:

www.example.com/search-products?brand=BRAND%201&model=Model%20Fantastic&op=Submit&form_build_id=form-Ab-i8LlsUjtftyuTlL8b7OvZj_tM1MfyuKCnAg5-VncY&form_id=hook_form

(extra info: ... &op=Submit&form_build_id=form-Ab-i8LlsUjtftyuTlL8b7OvZj_tM1MfyuKCnAg5-VncY&form_id=hook_form )

How can I make Drupal ignore that extra info?


texts: Exclude a page from indexing on a per page basis

texts:
I would like to be able to remove a page from search engines (external and drupal). I want to add a checkbox on the content type to be able to specify which page should or should not be indexed.

My plan is to check via the hook_node_save if the checkbox is checked, and if so, edit the robots.txt to add a Disallow via the provided url. If the box is unchecked, I remove it from the robots.txt

This is complicated though. Does anyone has a better solution ?

Thanks,


texts: How to disable a permission for a moderator role which is granted to an authenticated user?

texts:
There are two roles I have created 1. Authenticated user 2. Moderator,

Authenticated user can post the content as I expected.

But for Moderator role, I don't want to give permission to add content on site.

Because of moderator is an authenticated user, he is getting all permissions of authenticated user.

And the checkbox of permission is selected and disabled, how can I uncheck it ?

Or there is any other way to prevent moderator for upload content ?


texts: Automatically creating User folders after registration

texts:
I need to prepare a simple platform for uploading files for clients.

The procedure is simple:

user fills registration form and confirms e-mail address,
Drupal automatically creates a folder in system files via token e.g.
sites/default/files/clients/upload/[account:name]
clients upload private files using Elfinder after log in.


texts: Image upload functionality for drupal 7 content

texts: I am using CKEdtor and i want image uploading functionality in drupal 7. What is the solution for that ?


texts: How to add a “Last Modified at” field in footer area?

texts:
I'm fairly new to Drupal and in my research I've seen this question asked many times over the years but I have yet to see one relevant to Drupal 8 (if it's out there, please direct me!). Specifically, I'd like to add a small bit of text in the footer that displays the M/D/Y of when the content of THAT page was most recently modified. How can this be done?

Thank you!


texts: Can I move distribution profile modules from profile folder to sites/all/modules?

texts:
I just installed a distribution profile and ran Drush up to update modules.

I have some problems with the modules located at profiles/somefolder/modules: Drush moved out the old modules but no new modules are added.

Can I move the modules from profile folder to sites/all/modules?

The installation profile is Commerce Kickstart.


texts: How can users buy nodes they can create?

texts:
I want users to pay 5$ for each node they want to create.

They should be able choose, on registration, to pay from 1 to 400 nodes and more later if needed. The nodes should unpublish after a year with an option for a user to renew. Another option is to have multiple roles for purchase, each with a predefined number of nodes he can create, and let users choose the role on registration.

Is this possible?


texts:
I want to switch my site logo for different pages. Actually there are two site logo's that need to appear on different set of pages on my drupal 6 website.

What is the easiest way of doing this? Is there any module available for doing this or some other easy steps??


texts: drush - which folder for install on VPS / root server (newbie)

texts:
good evening,

new to drupal - I want to install drush on my linux root-server, which  runs OpenSuse Linux my friend does the root adminstration.

What is aimed: i want to work on all my drupal domains - but i guess that i do not need root access. Can anyone please tell me which folder I should use to install drush?

Do you need to have my file structure? Well if so, i  can give you later this week.

Well a friend told me to take $HOME/local/drush, but cant we put it anywhere;
we just need to make sure that drush is in our $PATH. See the README.

or what is with this hint top take the domain path like so

/var/www/vhosts/mydomain.com and echo $HOME gives me /root.

So would I create a 'local' directory in /root and install drush there

so the path would be /local/drush/drush.php?
I am not just asking from a drush point of view but also from a server file structure point of view ie that I think I am not allowed to upload stuff to some server directories.

But wait - i do not want to have all root rights - is this doable?!
Can i install drush into the www-directory where all the domains are rooted!?

Thanks for any and all help - it will be greatly appreciated as allways.
zero-your drupalnovice

hi there just an update:

if someone wants to update the sites trough the terminal?

in that case:

I don't think it's matter where we put it, we could put it in the root if we'd like, once installed after pear-chanell....

http://drupal.org/project/drush

we can update any site on our

srv/www/htdocs

we just have  to get inside the htdocs/site1 and type drush sm update
do our things and get into our new site htdocs/site2 and do whatever we want to do there with drush too.

and the best thing is: one install works on all our sites.

that rocks yeah


texts: Creating a related content block in Drupal 7 using OpenCalais

texts:
How do I use OpenCalais to display related content in Drupal 7?

I would think I have to create a view, or something. I have nearly all the OpenCalais categories enabled (I'm creating a site for a newspaper), so it seems somewhat impractical to use them all as filters. I think you're supposed to use the More Like This module, but it doesn't have a Drupal 7 release. I am genuinely confused.


texts: Does Drupal have a system for noticing and logging changes to records?

texts:
Does Drupal have a system for noticing and logging changes to existing content into a database or a file log?
I am interested in something equivalent to database triggers.

I am also interested in Feeds in particular as a lot of the data will be loaded from external sources. Do Feed imports have such a facility?


texts: pattern name for override view templates

texts:
Twig template - views-view-unformatted.html.twig contains :

#}
{% if title %}

{{ title }}

{% endif %}
{% for row in rows %}
{%
set row_classes = [
default_row_class ? 'views-row',
]
%}

{{ row.content }}

{% endfor %}

I want to insert a
 tag after each
:

{{ row.content }}

{% endfor %}

It works, but for all and every {{ row.content }}. I want to do it only for certain views-blocks. Twig debugging offers me to theme a whole block (for example: block--views-block--news-left-block-1.html.twig) and I need something like views-view-unformatted--news-left-block-1.html.twig or some other way to insert the tag.

what is the correct filename to override view template?

Thank you.


texts: How do I dynamically set up different cookies for multiple domains?

texts:
My site uses the Domain Access module to maintain multiple domains and sub-domains, such as:

www.domain1.com, apple.domain1.com, orange.domain1.com
www.domain2.com, dog.domain2.com, cat.domain2.com

Users from the same domain (for example, domain1.com) should be able to go back and forth between the different sub-domains (www, apple, orange) without having to log in each time.

If I set the cookie domain inside services.yml, users from domain1 will be able to go back and forth between domain and sub-domain; however, users from domain2 won't be able to use the site.

parameters:
  session.storage.options:
    cookie_domain: '.domain1.com'

If I don't set cookie_domain, users from either domain will have to log in each time when they go between sub-domains and domain.

In Drupal 7, it was possible to change the cookie configuration dynamically as explained on cookie domain disables other top domains.

In Drupal 8, the cookie_domain is set in a YAML file that can't be changed dynamically. A workaround on Drupal 8 is to load dynamically a different YAML file as explained here: https://bit.ly/2Nwgzlr. However; this is not an option for sites with a large number of domains and sub-domains.

Writing a new YAML file per site and modifying the settings.php every time a new domain is added to the pool, is not the most productive way. There is always a way of overriding things inside the Drupal code. I hope this is not the exception.

Can anyone tell me what hook or class I can use to implement the logic I need?


texts: How to wrap first word of page title in span in drupal 7

texts:
I want to implement it with theme_preprocess function. Every my attempt fails.

function mdrupal_mono_preprocess_page(&$variables) {
  $variables['title'] = drupal_get_title($variables['node']);
  $title = $variables['title'];
  if($title) {
    $words = explode(' ', $title);
    $words[0] = '<span>' . $words[0] . '</span>';
    $title = implode(' ', $words);
  }
}


texts:
I have 2 input fields in my drupal form. When end user inserts some value in first input, I want to auto insert the second input field. How can I achieve this.

Here is my code.

input form element 1

// total fee of the payment schedule
    $form['fee'] = array(
        '#type' => 'textfield',
        '#title' => 'Fee Amount:',
        '#default_value' => (isset($fee_details->fee)) ? $fee_details->fee : '',
        '#maxlength' => 5,
        '#required' => TRUE,
        '#description' => t('Fee amount'),
        '#id' => "fee",
        '#element_validate' => array('element_validate_integer'),
'#ajax' => array(
            'callback' => 'replace_fee_instalment',
  'wrapper' => 'replace_textfield_div',
),
    );

Input field 2nd is

 $form['amount'] = array(
    '#type' => 'textfield',
    '#title' => t('Instalment'),
    '#title_display' => 'invisible',
    '#default_value' => ($amount) ? $amount : '',
        '#maxlength' => 5,
        '#element_validate' => array('element_validate_integer'),
  );


texts: $fields is undefined - custom theme creation

texts:
I'm attempting to create a custom template for a view. The template file I'm creating is being loaded (if I add some static html it renders).

I'm having trouble accessing values from the view. The tutorial I'm using advises using

dpm($fields);

To output the available fields.
This is coming up as an undefined variable.

Googling suggests using $rows instead of fields but this was also undefined in this case.


texts: How to use Recurring Dates with Views properly?

texts:
I am trying to use recurring dates for one of my content types (Event) to limit the amount of Event records.

I would like to have one Event record created for all dates of that Event.
For example if an Event occurs every week for a year I have 1 record instead of 52.

Still I would like to see 52 separate lines in the related View because I would like to be able to sort/filter the View to see current week's Events only.

How to set up a Events View for that data so that each view line shows one date only ?

I would like a View to return a list like this...

 - Event A  12-10-2011
 - Event B  12-11-2011
 - Event A  12-12-2011
 - Event B  12-13-2011
 - Event A  12-14-2011
 - Event B  12-15-2011

(Event A and B are recurring every second day )

...instead of a list like this:

 - Event A
    - 12-10-2011
    - 12-12-2011
    - 12-14-2011
 - Event B
    - 12-11-2011
    - 12-13-2011
    - 12-15-2011
 - Event A
    - 12-10-2011
    - 12-12-2011
    - 12-14-2011
 - Event B
    - 12-11-2011
    - 12-13-2011
    - 12-15-2011
 - Event A
    - 12-10-2011
    - 12-12-2011
    - 12-14-2011
 - Event B
    - 12-11-2011
    - 12-13-2011
    - 12-15-2011


texts:
I installed Gmap & Location modules to display nodes on google map, every thing is setup as what i want but the problem is:

when changing the site language the nodes disappear from the map, the language prefix causing the problem.

How to show the google map with nodes in different language?

Thanks.


texts: Use Rules to Change Field Value By Clicking URL

texts:
I am creating a simple internal ticketing system which emails customers when the status of their ticket changes (Open -> Waiting on parts). I have set up rules to do this and I haven't had any issues with it. However, I would like to create a way for customers to "unsubscribe" from the emails. I have created a checkbox field named "allow emails" which determines if customers will or will not get an email as a condition for the rule.

I would also like to include a link at the end that if clicked the customer would set the field to "no" or "off".

Note:Customers aren't actual users on the site but are nodes within a "customer" content type. The users are our internal staff that would log in to use the website.

Can rules do this by itself or do I need a separate module?

Thanks


texts: How to set the href with the pathname of the current page in it?

texts:
Inside a view I have a block for which there is a field called Global Perspective.
Inside the block override , I have rewrite rules which overrides teh out of the field with custom text.

{% if field_is_global_perspective__value %}
    Global Perspectives
{% else %}
    Global Memos
{% endif %}

This gives me the relative path, i.e  /global-memos?global_perspective=1 for the a tag.
When I click on my local the link it directs to mylocal.sj/global-memos?global_perspective=1 but the issue is on production i have my site homepage as example.com/mysite .
So when I click on the a tag on production, it is going here example.com/global-memos?global_perspective=1 , but expected is for it to go here example.com/mysite/global-memos?global_perspective=1.
I have tried to write a preprocess but failed at it.
function subtheme_preprocess_views_view_fields(&$variables) {
  // Retrieve an array which contains the path pieces.
  $current_path = \Drupal::service('path.current')->getPath();

  // The hostname of the site
  $host = \Drupal::request()->getHost();

  if($host == "example.com") {
    $variables['pathname_id'] = "/councilofcouncils";
  }

}

and then tried to add the pathname_id to the rewrite rules like this
Global Perspectives


texts: Disabling text field for all users / roles

texts:
is there an easy way to disable (readonly) fields in the backend for ALL users and roles (also superadmin).

I already found a module -> https://www.drupal.org/project/disable_field but this module allows superadmins to edit the fields.

Why do i need this?

Because the 5star rating module isn't ported to D8 yet i need a solution to realize a 5star voting in D8 with the vote data (5star rating) from an old drupal installation.

My thought was to work with a field collection, where i want to import the main 5star rating values from the old site into the new installation.

Afterwards i want to build a custom 5star voting.

The users should not be able to change this values in the field collection.

Any ideas?

Regards

M.


texts: Block expands more than the height of content when using collapsiblock module?

texts: I have applied the collapsible property to one of the block using Collapsiblock in Drupal 7. everything working fine, but the issue is that, after clicking for slide, it slides more than the content height and then after again in back slides and then fits to the content. I want that it just slide till its content and stops on first instance. Please see attached Image.


texts: How to store values to field collection or paragraphs programmatically?

texts:
How do I store values to either a field collection or a paragraphs field  programmatically?

Could somebody please provide a working code example of how you do this?

I would have a field holder containing the following three fields where I want to store down my data:

field_title - (1 value text field)
field_text - (1 value text field - long)
field_sources - (unlimited no of values text field)

Thanks for helping me out.


texts: how to start fresh and add custom backgrounds

texts:
I am completely new to Drupal 7 and have searched the web hard for a good tutorial that teaches me how to add a custom background to Drupal sites, but to no avail.

I have a Drupal 7 multi-site set-up and I am just trying to change the background image of the Bartik theme to a custom image.

In my project directory I have the following folders:

mysite/files
mysite/modules
mysite/themes
mysite/tmp
mysite/settings.php
mysite/default.settings.php

Could someone please tell me a way to create a custom background, exclusively, for the site "mysite" without editing any of the core files?

Thanks.


texts: How to do a URL redirect to the latest content?

texts:
This should be pretty simple, but what would be the best way to set up a 301 redirect to the latest post of a node type, for example.

For example: example.com/blog/latest -> example.com/node/*

Ehat I was originally was doing was using views, getting the path of the latest post (+ random, also in views) and rewrite the results with a simple Latest.

But, since I need to include this in email message, a URL is desired (as well as adding Google Analytics UTM Parameters).

What would be the simplest, site builder way to do this?


texts: When creating a new user with a order, how to email the new user login details

texts:
I am using Commerce Admin Order Advanced. It allows the following extras when creating an order in Drupal Commerce

Search users by email or profile name before creating the order
Select existing customer profiles before creating the order Validates
Check a new customers email against existing customers to prevent duplicates
Moves customer profiles to the top of the admin order form
Provides copy address profile functionality on the admin order
interface (uses the same settings as the checkout pane for this
feature)

But it also will create a new user with an order, however there is no email sent to the new user with a one time link to login and set a password.

Does anyone know how this could be achieved?


texts: One click download button for webform submissions

texts:
I have webform submissions and want to download all its data with one click download button. Right now it show other options like below:

But I want only a single download button for this. Is there any way to achieve this?


texts: How to group nodes by a term of specified level taxonomy level

texts:
I'm trying to define a View listing content nodes which are tagged with a hierarchical taxonomy. The nodes are collected using contextual filter "Content: Has taxonomy term ID (with depth)" and this I got working. However I still need to group the nodes using a criterion/field that's not easily available. I'd call it "Second-level term", that is to say that in the following example:

Top Term 1
  Term 1.1
  Term 1.2
    Term 1.2.1
      Term 1.2.1.1
Top Term 2
  Term 2.1
    Term 2.1.1
  Term 2.2

I need to group nodes using Term 1.1, Term 1.2, Term 2.1 and so on, regardless of how deep the term on a node is. For node tagged with Term 1.2.1.1 I still would need it to appear in the group of Term 1.2

One way that came to my mind was to establish two child-parent-grandparent relationship, but when I do so, the grandparent relationship cannot be used for Grouping field.

What would be the easiest way to do that then?


texts: Commerce View + Multiple products on product_reference field

texts:
i'm having troubles at making a custom view of some products i have in my commerce.

Here is a simple example:
I have 1 T-shirt, with 4 colors. Each color has it's own price (they are all different), and it's own images (4 images per t-shirt).

Now, i need something like this

And my real design is this one

I just seen, that Views can't be used since there is now way to replicate the default node functionality, since every field won't refresh (remember there are 4 variables...prices and images)

I can use a "custom node-type.tpl.php", and make some custom "field-field-name.tpl.php" too, to make my design.......BUT how do i add an image gallery per product???

hope it's clear, i do not speak english.
thanks for everthing.


texts: How can I split the User name and password group in the register page?

texts:
I want to split the User name and password group in the register page into separate fields but they are wrapped into "

Register
..."

The open "div" is set as prefix on the account name field but I can not find the close div.


texts: How to specify radio buttons in baseFieldDefinitions?

texts:
In the baseFieldDefinitions method of my custom entity, I see I can provide a checkbox list with code like...

$fields['my_field'] = BaseFieldDefinition::create("list_string")
      ->setSetting('allowed_values', $$my_options)
      ->setLabel('My Field')
      ->setRequired(FALSE)
      ->setCardinality(-1)
      ->setDisplayOptions('form', array(
        'type' => 'options_buttons',
        'weight' => 5
      ))
      ->setDisplayConfigurable('form', TRUE)
      ->setDisplayConfigurable('view', TRUE);

But how would I specify radio buttons so the user can make only one selection from the list?


texts: How to change the referenced entity field value?

texts:
I have a node that has a node reference to another content type. What I want is to update the referenced node field value on updating the node;

Let me clarify the issue.

For example I have a node of type "Basic Page" which having a relationship to a node of type "Article". I want to sync fields in two node let say I have a name field(Text) in both nodes.
On updating  basic page node I want to populate the referenced node Name field with that of the value in the basic page node Name field. How can I do that?

This is what I have done so far:

Event - After updating existing content.
Condition - Content is of type Basic page.
Action - Fetch entity by id(id from the entity reference field).
Action - Set a data value .

I am stuck at the fourth step I can't select the name field of the entity fetched in the data selector.

How can I populate the referenced node field with the value of the blog page node field?

Note: This is just for example In real case I want to map multiple fields from one node to another.

This is the exported rule:

{ "rules_on_updating_basic_page_nodes" : {
    "LABEL" : "On updating Basic Page nodes",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "ON" : { "node_update" : [] },
    "IF" : [
      { "node_is_of_type" : { "node" : [ "node" ], "type" : { "value" : { "page" : "page" } } } }
    ],
    "DO" : [
      { "entity_fetch" : {
          "USING" : { "type" : "node", "id" : [ "node:field-article:nid" ] },
          "PROVIDE" : { "entity_fetched" : { "entity_fetched" : "Fetched entity" } }
        }
      }
    ]
  }
}


texts: http to https htaccess always redirecting to home page

texts:
I have found following .htaccess code on stackoverflow.com to convert the http requests to https

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

it is converting the http to https but always goes to the home page

suppose If I am trying to go to http://domain.com/about-us it routes me to https://domain.com

Just for information I am using redirect and global redirect module but even if I am disabling them both the result is same.


texts: For a non-english single-language site, is it still best practice to write t()-strings in the theme in English?

texts:
On Drupal 7 with the i18n-modules, in what language should your default strings be written in? In modules it's obvious that all strings should be in English (for reuseability) and use t().

But a custom theme will only be used for the specific site. If the site is not in English it seems lika an awkward practice to first write everything in English and then translate to the specific language.


texts: A clean solution for adding _target attribute on flickr thumbnails

texts:
I have a module relying on media_flickr.

Some images in the body are thumbnails with anchors:

What hook to use to add the _target HTTML attribute on links?

The markup is to be found in

body['und'][0]['safe_value']

I prefer not to use javascript.


texts: Drush 6.6.0 Site-Install fails with 'No database to operate on.'

texts:
I am having some problems running drush site install through Puppet.  When it comes for puppet to execute the following command I get an error.  It appears as though the database URL is being truncated and then some non-verbose error tells me SQL cannot execute?  If I try to install the site via the web-UI it works without any issues.  I can connect from this machine using mysql client and the username/password.

[root@site:/var/www/html/drupal]#
#-> /usr/bin/php /var/webdeploy/src/composer/vendor/drush/drush/drush.php \
site-install -y -r /var/www/html/drupal \
--db-url=data.rds.awsdomain.com/dbname \
--db-su=user \
--db-su-pw=password \
--account-name=admin \
--account-pass=admin \
--account-mail=mail@example.com \
--site-name="site name" minimal

You are about to CREATE  the 'ata.rds.awsdomain.com/dbname' database. Do you want to continue? (y/n): y
Unable to generate CREATE DATABASE sql for                         [error]
No database to operate on.                                         [error]


texts:
I've created a view to display items with a certain content type. I'd like to display the terms in an associated taxonomy along with them. Many of these nodes have more than one term selected.

The output currently displays nodes one time for each taxonomy term assigned. How can I adjust this so that it displays each node once with every term associated with it?

Thank you!


texts:
I am building a site in Drupal and I'm using the Panels module to create my page layouts. I have created the layout that I would like for my homepage and created the content that I'd like in there.

I have set it to 'promoted to homepage' yet, when I visit the homepage, I just get the title and submitted date, and a read more link. The layout isn't being seen, you have to click through in order to see the page.

How can I turn off the 'read more' link and use the panel as the homepage?


texts: How to add one another library files with different name from the theme name?

texts:
I try to define a separate library with different name from the theme name, according to this artcle:
Adding stylesheets (CSS) and JavaScript (JS) to a Drupal 8 theme
For example a library with below details:

Theme name: MyThemeName
Library Name: Library A
Library File Name: libfile.info.yml

libfile.libraries.yml

LibraryA:
  version: 1.x
  css:
    theme:
      css/Style.css: {}

And then attach this library to all page in:

MyThemeName.info.yml

libraries:
  - MyThemeName/LibraryA

I would be happy to hear what the problem is, share your experiences and guide me to know what is the right way to add another library files with different name from the MyThemeName?
Thanks for any help.


texts: How do I get a view to display as themed within a simplenews html email?

texts:
I am trying to create a simplenews newsletter, also using Simplenews Scheduler, to weekly send out a newsletter with the content defined by views.

I have a content type set up, and the views defined. I have the views inserted into the content type using Viewfield. This all works fine and the email sends with the views content. However, the styling is not correct.

My views return lists of full nodes which I have set the View Mode of as "Email: HTML". Within the templates in my theme I have added the mark-up I want for the node with that View Mode. When viewing the newsletter on the site (as a node) it all looks correct. However, when I send the newsletter, the email I receive has the view in it's raw format (like that which is displayed in the view preview) and has none of the mark-up I've specified.

How can I get the correct mark-up showing? I don't know if I'm just missing a setting somewhere or something.

Many thanks.

My newsletter template (simplenews-newsletter-body--13--email-html.tpl.php) is as follows:

<?php /*This appears in the email*/ ?>
TEST NEWSLETTER TEMPLATE

    <?php /*The following should print the full newsletter node including the views*/ ?>
    <?php print render($build); ?>

    <?php /*The following should print a single view*/ ?>
    <?php print views_embed_view('news_upcoming_events','block_1'); ?>

The event node template (node--event.tpl.php) which is returned in the view used in the newsletter template:

<?php if($view_mode == 'email_html'){ ?>
    TEST EMAIL TEMPLATE

<a href="<?php print $node_url; ?>"><?php print $title; ?>

<?php print render($body); ?>

<?php }else{ ?>
    NORMAL VIEW
<?php } ?>

The newsletter template all appears fine in the email. I see the line TEST NEWSLETTER TEMPLATE, but the event node templates are not used in the views output. It is instead some generic drupal/views output.

This is the way the view is setup.

And this is the preview displayed with in the view setup. This is also what is appearing in the email when the newsletter is sent, instead of the mark-up declared in my template file. (It is correct when viewing the node on the website though)


texts:
I installed SMTP module for Drupal 7.
I enabled it and press Settings button to go to Settings menu.
But there is no Setting menu there...
How to reach it?


texts: Display User Relationship request dialog on content profile page

texts:
I need to create an 'add friend' link programatically.

       $content .= '
' . l('Add to your friends', 'relationship/' . $tid . '/request/1?destination=user/' . $tid, array('html' => true, 'attributes' => array('class' => 'add`-friend')));

It leads me to another page with confirmation form for the invitation.

Could anybody tell me how (if possible) I can display this confirmation form in dialog?


texts: How do I add a  after every field element on the node edit form?

texts:
There are two approaches that have failed:

In the theme, add a theme hook for the node edit form.  Then, create a template file for the node edit form.  This won't work for my case, because the form is rendered in the template file with drupal_render_children, and therefore the contents of the form are not reachable within the template file--I need to add the divs in between the form elements.
Use hook_form_alter.  This won't work for my case, because you have to target a specific form item.  The users may, for example, add a new node field after I hand it off to them, and my existing hook_form_alter wouldn't have a way to catch it.

What I want to do is simple; in between every element on the node edit form, insert a

 to separate them.

Or, I could add the "clearfix" class to the existing div containers around the form elements.

Do we have a solution for either method?

[EDIT] Here is the solution using hook_form_alter():

<?php
/**
 * Implements hook_form_alter()
 */
function mytheme_form_alter(&$form, &$form_state, $form_id) {
  if (preg_match('/node_form$/', $form_id)) {
    $language = $form['language']['#value'];
    foreach ($form_state['field'] as $field => $field_contents) {
      $form[$field][$language]['#suffix'] = '

';
    }
  }
}
?>


texts: Show different fields on node edit and node view depending on the sub-type of the node

texts:
I have a specific node type that I want to show/hide different fields in the page layout for both the node form and when viewing the node.

For various reasons I don't want to have to create a new/separate Node type for each. Not sure how best to achieve this in Drupal 7?

There are actually two content types involved here. 'Open Calls' and 'Projects'

I have an idea submission system built in D7. Users login and browse through available 'Open Calls' for projects.

Each call has a link to 'Apply Now'. This link takes users to the new node creation for a 'Project'.

Each 'Project' has an entity reference field that is required that links the Project to the Open Call. This field is auto populated when they click the Apply Now button.

Ideally, I would be able to specify in the Open Call (rather than the project) what kind of project page layout they see when clicking the Apply Now link.

I want to be able to post Open Calls for slightly different kinds of projects. For example an Open Call for artworks (paintings etc.), or alternatively an Open Call for performances.

Clicking apply now on each of these should take the user to the New Project node creation screen with different fields for artworks / performances. (Some fields will appear on both).


texts: Setting date_popup year range to more than the 3 years default in Drupal 7

texts:
I have a custom module and using date_popup. Currently the popup only shows a 3 year range in the date popup.

  $form['startdate'] = array(
    '#type'       =>  'date_popup',
    '#title'      =>  'From',
    '#default_value'  =>  filter_get('browse-startdate'),
    '#date_format'    =>  'Y-m-d',
  );

What is needed to make the range higher?


texts:
So I have a product content type with a title field and a file upload field and I created a bulk operation to enable the user to upload a single file, selecting which titles to upload that file for.

But what my client really wants is a page (instead of modifying each individual node) with a list of the product titles and a file upload next to each since most of the products use different files.  My view is defined with a table style instead of the bulk operations style and has the title field and the file upload field displayed but in the preview, the file upload field column only shows the file names for the titles which already have a file uploaded and the rest of the rows blank.

Is there a way to expose this file upload field like you do a filter so the user can upload a different file for each title ??


texts: Delete/Edit selected record from rendered tabular form results

texts:
I have made a form and retrive form submissions into a tabular format. I put 2 links ahead every single submission - Edit/Delete

Now, when I click "edit", its corresponding edit form should open. Similarly, when I click "delete", that particular entry should get delete from database.

I know it's pretty simple doing in php, but don't know how should i do in Drupal.
Please help.

Some code that I practiced: first I created a menu to show results of my form.

$items[MID_MENU_PARENT . '/component/show'] = array(
    'title' => 'Component List',
    'description' => t('Records'),
    'page callback' => 'component_list',
    'access arguments' => array('administer site configuration'),
    'file'=>'component_list.inc',
  );

/**
   * My callback function
**/
  function component_list(){
       $query = db_select('mid_components', 'n')
               ->fields('n')
               ->execute();
       $rows = array();
       while($data = $query->fetchAssoc()){
      // Fill the table rows
       $data['operation'] = l(t('Delete'), 'admin/mid-modules/component' . $data['cid'] . '/delete');
       $data['operation'] .= "|";
       $data['operation'] .= l(t('Edit'), 'admin/mid-modules/component' . $data['cid'] . '/edit');
       $rows[] = array('data' => $data, 'style' => 'word-break:break-all;',);
  }

 // Prepare table header
  $header = array( t('S.No'),t('Component Name'));
  // Output of table with the paging
   $output = theme_table(
     array(
           "header" => $header,
           "rows" => $rows,
           "attributes" => array(),
           "sticky" => true, // Table header will be sticky
           "caption" => "",
           "colgroups" => array(),
           "empty" => t("Table has no row!") // The message to be displayed if table is empty
         )
      );
  return $output;
}

 /**
   * Menu href to edir particular entry
 **/
    $items[MID_MENU_PARENT . '/component/%show/edit'] = array(
          'title' => 'Edit Component item',
          'page callback' => 'component_list_edit',
          'page arguments' => array(3),
          'access arguments' => array('administer users'),
          'type' => MENU_CALLBACK,
     );


texts: What to do when a module depend on a specific version and you are running the latest dev version of it

texts:
What is the best practice for working with module one, that depends on 7.x-1.1 (or better) of module two and you are running the latest dev version module two.

I ask this because currently scheduler_workbench depends on scheduler 7.x-1.1 or better and I am running the latest development version of scheduler. If I try to install scheduler_workbench it prevent me from installing it. When I try to do a database update, it complains about the version and prevents update database from running (though I can update the database through drush still).

I could easily add 7.x-1.1 into scheduler info file and everything is good.  However, I do not feel this is the best option.   The version is not correct and if I update the module it will remove the version number.


texts: How to add CSS and JS files on node pages from theme's template.php

texts:
I am trying to add JavaScript and CSS files to one node type page from my template.php file but it is not working.  Here is my template.php code:

<?php
// $Id: template.php,v 1.13 2010/12/14 01:04:27 dries Exp $

function mttheme_preprocess_html(&$variables) {
  $node = node_load(arg(1));
  if ($node->type = 'sales_team_page') {
    drupal_add_css('misc/jquery.fancybox-1.3.4.css');
    drupal_add_js('misc/jquery.mousewheel-3.0.4.pack.js',
      array('type' => 'file', 'scope' => 'header')
    );
    drupal_add_js('misc/jquery.fancybox-1.3.4.pack.js',
      array('type' => 'file', 'scope' => 'header')
    );
    drupal_add_js('misc/jquery.fancybox-calls.js',
      array('type' => 'file', 'scope' => 'header')
    );
  }
}

Does anyone know why it is not working?


texts: User-submitted reviews of multiple aspects of a business?

texts:
My site is based off of user-submitted reviews of businesses. Instead of just an overall rating as provided by fivestar, I want users to rate different aspects & services provided by the business. For example, I'd want them to rate "staff" on a scale of "very unhelpful" to "very helpful," and "quality of clothing" on a scale of 1-10. I'd ideally also want a form field where the user could enter, for instance, how much they spent at the store.

What would be the best way to create a review form for users to fill out, and then to subsequently display the average ratings/amounts of each individual aspect on the business node?

Additionally, I'd need to add up all of these average ratings in order to create an overall "grade" of the business (i.e. if there are two aspects to be reviewed, each worth 10 points, and one has an average of 5 while the other has an average 6, then the business would get an overall grade of 11/20). Hopefully this would be possible with whatever system is suggested. Preferably, I'd like to use Display Suite to display the gathered averages and overall grade since I already have a template for my pages created in it.


texts: How do I control if an ajax webform has errors?

texts:
I have a webform that sends an email upon submission. Ajax is enabled so when I hit submit and there are errors on the form they will show instantly. However if there are no errors I would like to hide the form along with the success message.

Some pseudo code (sort of):

Drupal.behaviors.sendMail = {
  attach: function (context) {

    $('#webform-client-form-340', context).ajaxComplete(function(event, xhr, settings) {
      if ($('.alert-errors').length == 1) {
        thisForm.highLight()
      } else {
        thisForm.hide();
      }
    });

  }
};

This doesn't work because the .alert-errors div is not yet there on ajaxComplete.
So how do I check for errors, highlight the form if they are present and otherwise hide the form?


texts: Block drush rsync command when specific alias is set as destination

texts:
I already have policy.drush.inc inside my Drupal drush directory at sites/all/drush.  Also, I have a policy set to prevent sql-sync if the @staging alias is set.  Thus,

drush sql-sync @dev @staging

will fail with the output Per sites/all/policy.drush.inc, you may never overwrite the staging database.

This was done with

function drush_policy_sql_sync_validate($source = NULL, $destination = NULL) {
  if ($destination == '@staging') {
    return drush_set_error('POLICY_DENY', dt('Per sites/all/policy.drush.inc, you may never overwrite the staging database.'));
  }
}

This function is working, and I want to do the same for the rsync command, so basically duplicated the function and replaced sql_sync with core_rsync as in

function drush_policy_core_rsync_validate($source = NULL, $destination = NULL){
  if ($destination == "@staging") {
    return drush_set_error("POLICY_DENY", dt("Per sites/all/policy.drush.inc, you may not sync external files to staging"));
  }
}

However, I still get the 'You will destroy data from $remote and replace with data from $local` warning when executing

drush rsync @dev:%files @staging:%files

How can I block drush rsync from executing and why does this function work for sql-sync but not `core-rsync'?


texts: How to render the textfield from custom advanced theme setting?

texts:
I'm working on a custom theme with message field(textfield) in custom advanced theme setting.

In "theme-settings.php", I added a "textfield" for "message" field

<?php
function MYTHEME_form_system_theme_settings_alter(&$form, $form_state) {
    $form['message_value'] = array(
        '#type'     => 'textfield',
        '#size' => 12,
        '#maxlength' => 100,
        '#default_value' => theme_get_setting('message_value'),
        '#description' => t('Some text here'),
    );
}
?>

In "template.php", I added "theme_get_setting"

<?php
  function MYTHEME_preprocess_page(&$vars) {
    $message = theme_get_setting('message_value');
  }

And in my "page.tpl.php", I render the "message" if it is not empty

<?php if(!empty($message)) echo $message; ?>

The problem is, it does not render anything and has no error.

It works if I put the theme_get_setting in page.tpl.php

<?php $message = theme_get_setting('message_value'); ?>

How to make it work if I want to put that in "template.php"?


texts:
I am working on a Drupal 7 site. One View on the site that lists hundreds of publications around a scientific theme has this great set of exposed filters in a bar at the top that allows researchers to search the publications. Unfortunately, the site owner and graphic artist went a little wild with another section, and designed this great set of filters that should bring up results in a View, but the filters aren't on a View page. Can the "exposed filters" for a View Page be placed on a different page altogether?

Thanks for your help!


texts: Override user register default URL to set up password

texts:
in order to create a sign in/sign up workflow on a decoupled Drupal(React on front).
I've used the core provided rest resource /user/register with Rest ui, and after giving the permission Access POST on User registration resource to anonymous users , i was able to register users via the resouce /user/register?_format=hal_json without any authentication

I wonder if there is a way to override the link that is by default sent to the newly users via mail to setup his password ?

I don't want the users to setup their passwords on a Drupal page with a Drupal form.


texts: How do I delete all terms in a vocabulary?

texts:
As reported here I have big problems with huge vocabularies in Drupal 7. Now I want to empty the big vocabularies, but I can't do that via the admin interface, because its running out of memory, so it can't be loaded any more.

How can I delete all terms of a vocabulary form the command line using drush and MySQL?

I know, I could do something like that:

DELETE FROM `database`.`taxonomy_term_data` WHERE  `taxonomy_term_data`.`vid` = 17

But what else would I have to delete?


texts: Drupal 6 alternative to Drupal 7's managed_file Field API type

texts:
Is there a Drupal 6 alternative to the Drupal 7 managed_file field type?
I have an configuration form using multiple image fields, and I'm using managed_file field type in Drupal 7 which works perfectly and saves a bunch of work. This type doesn't seem to exist in 6, the fields just don't show up at all and theirs no mention of it in the 6 Field API reference, so I'm guessing it doesn't exist or exists in a different way?

Any alternatives/suggestions on how to implement this functionality in a Drupal 6 version would be greatly appreciated.


texts: How do you clear cache on a block when node of certain bundle added or updated?

texts:
If you want to clear cache on a render array when any node is updated you can add as a cache_tag, "node_list":

  '#cache' => [
    'tags' => ['node_list']
  ],

But there isn't a way to do this when only nodes of a certain bundle are added or updated.

If you have a block, for example, and you'd like to clear the cache on it when any node with bundle "article" is added or updated, how would you do this?


texts: An ajax http request terminated abnormally with debug info

texts:
I received the following error while adding image in my blog post:

Location: http://www.mysite.com/file/ajax/field_screenshot/und/0/
form-YKEwrcYmmrIxDcswqmKmGPwZwYZDtkhPmp_C9v49L94
Referrer: http://www.mysite.com/node/5536/edit

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
'public://images/davidwachira/algebraic_equation_in_c.png' for key 'uri': INSERT INTO {file_managed} (uid, filename, uri,
filemime, filesize, status, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2,
:db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array (
[:db_insert_placeholder_0] => 27454 [:db_insert_placeholder_1] => algebraic_equation_in_c.png [:db_insert_placeholder_2] =>
public://images/davidwachira/algebraic_equation_in_c.png [:db_insert_placeholder_3] => image/png [:db_insert_placeholder_4] =>
25601 [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 1375233694 ) in drupal_write_record() (line 7136 of
/var/www/clients/client1/web2/web/includes/common.inc).

I have already tested all browsers and it returns the same error.

Anyone knows how to fix this?

BTW, I'm using Drupal 7.


texts: Commerce message notify sending duplicate emails

texts:
I have created a custom commerce order status called 'Sent'.

When an existing order is updated from 'Invoiced' to 'Sent' I have a custom message type ('Order sent') and, using Rules, a custom rule which creates a message entity and sends the 'Order sent' message.

The rule is as follows:

{ "commerce_message_commerce_order_message_order_sent_e_mail" : {
    "LABEL" : "Commerce order message: order sent e-mail",
    "PLUGIN" : "reaction rule",
    "WEIGHT" : "3",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "message_notify", "entity" ],
    "ON" : { "commerce_order_update" : [] },
    "IF" : [
      { "data_is" : { "data" : [ "commerce-order:status" ], "value" : "sent" } }
    ],
    "DO" : [
      { "entity_create" : {
          "USING" : {
            "type" : "message",
            "param_type" : "commerce_order_order_sent",
            "param_user" : [ "commerce-order:owner" ]
          },
          "PROVIDE" : { "entity_created" : { "entity_created" : "Created entity" } }
        }
      },
      { "data_set" : {
          "data" : [ "entity-created:field-ds-message-commerce-order" ],
          "value" : [ "commerce-order" ]
        }
      },
      { "entity_save" : { "data" : [ "entity-created" ], "immediate" : "1" } },
      { "message_notify_process" : {
          "message" : [ "entity-created" ],
          "save_on_fail" : "0",
          "save_on_success" : "0"
        }
      }
    ]
  }
}

At the moment, I am receiving 3 duplicate emails and can't work out why?


texts: How to use downloaded images, for specific field?

texts:
I have dropdown list with 2 options.
First one is to upload image, where I use image upload field and imagecashe for re-sizing uploaded image.
And Second option is to get picture from other site.

If user choose to get picture from other site, i don't know how to use downloaded image.

I downloaded image using following code

$managed = TRUE;
$path = system_retrieve_file($image, 'public://down_images/', $managed);

When this image is downloaded I want to use it as logo. Logo is image field which is added to user account.

How can I do that?


texts: Let the user set the target of the link in a link field

texts:
Link module has been added to core in Drupal 8, but it doesn't seem that all its features has been ported.

For example, letting the user choose the target of the menu. In Drupal 7, the module would let me create a field and in its configuration set an option to let the user choose the target. In Drupal 8, I don't see that option.

Is that option present in Drupal 8?


texts: How to programmatically disallow some users to comment on some nodes?

texts:
I've been asked to implement the following:

I have a content type with a user reference field from the References module;
a user creates a node and references another user using that field;
only that user and the node's author are allowed to add comments to that node;
at some point the author closes comments, but that's part of another question :)

I've browsed the API of node (both module and API itself) and comment, and couldn't find anything useful. In fact I tried with two of the most promising functions (hook_node_view and hook_node_view_alter) without success.

I'd appreciate pointers to look at.

(yes, I know I said "complex", but this is just the starting point :)

EDIT: Partial solution ahead

function _comment_access_check_permission(&$node) {
    if(user_is_logged_in()) {
        global $user;
        $account = user_load($user->uid);
        $account_uid = intval($account->uid);
        $asker = field_get_items('node', $node, 'field_asker');
        $asker_uid = intval($asker[0]['uid']);
        $author_uid = intval($node->uid);

        if($account_uid == 1 or $account_uid == $asker_uid or $account_uid == $author_uid) {
            return true;
        } else {
            return false;
        }
    } else {
        return false;
    }
    return true;
}

function comment_access_preprocess_comment_wrapper(&$vars) {
    if(!_comment_access_check_permission($vars['node'])) {
        $vars['content']['comment_form'] = array();
    }
}

function comment_access_preprocess_comment(&$vars) {
    if(!_comment_access_check_permission($vars['node'])) {
        unset($vars['content']['links']['comment']['#links']['comment-reply']);
    }
}

This code effectively hides the comment form for those users that are not supposed to comment on a given node.

BUT. If one goes to comment/reply/$nid or comment/reply/$nid/$cid the form is still shown, which is not acceptable. Another overview of the API didn't ring any bell to me, so if you have any suggestion…


texts:
I would like to customize the node add form of the CCK theme for these reasons:

It is a very large customization job.
I'd like to place my fields in my own way instead of trying to do this with css.
I also need to use Bootstrap for responsive design.
I also need to add some classes to labels and text fields.

Can anyone give any pointers on how to achieve this?


texts: Drupal 7 - Array to string conversion in DatabaseStatementBase

texts:
I have an error on a Drupal 7 site that I cannot solve.

Notice: Array to string conversion in DatabaseStatementBase->execute() (line 2168 of ...

I cannot use dpm, can't find a way to debug, and can't see what is the data that causes the problem.

Anyone would know how I could debug this? really appreciated


texts: How to get Views Total number of records in Page.tpl.php file. (Before Views rendered)

texts:
See this image for more understanding.

I want to fetch Views total number of records in page.tpl.php before views.tpl called. Is it possible to fetch that row total  before views rendered?
I am also using contextual filter for this view. Views have page type display.

I have also used module views_record_count. but this will print total number of records on Views header or footer. (Not outside of views)


texts: How to edit Team Members from Drupal site

texts:
I have been tasked with updating my companies website done in Drupal and I can find dozens of ways and places to configure a block, I just cannot find where I can make a simple, basic edit to the content and remove a Team Member.

When I use the search toolbar in Drupal it directs me only to the instances/ mentions of the Team Member block and NOT the actual list of Team Members. I've found the Tiers that are used to place them in the block, but still no actual list of said Team Members.

I don't know if my attached screenshot is at all helpful, but any suggestions on where to find these Team Members would be appreciated. BTW, they are not a part of the 'People' admins of the site.


texts: Allow user to completely delete account (and data), not just cancel it

texts:
I want users to provide option to cancel their own account. I know this is supported in D7, and I am using that only. But I want it in a manner that, when a user selects to cancel that account, all of his content and comments should be deleted. Right now, it is just blocking the user account, and keeping his all content.

If I grant user the permission "Select method for cancelling own account", then he may selects the option to retain his content upon cancellation, which I don't want.

So is there any way that when user cancels his account, cancellation method will delete the user account completely, without asking user to select from options.

-- Thanks for your time.


texts: Field Permission Issue even without Field Permission Module

texts:
I ran into a strange issue.

I have a content type with a field for user-reference (say XYZ). Now, I used the module nodeaccess_userreference to grant the referenced users in the field XYZ the permission to edit the node.

The edit button did show up and the referenced user was able to edit the content except for one field : "Body" field!!

I've no module for field permissions or anything like that. Why is it happening? All the fields are editable. I've been trying to debug the issue but so far no clue.

Kindly suggest what the problem might be or some approach to debug it.

I will update here as soon as I find some solution.

UPDATE:
The issue has been resolved. It was a text-format permissions issue. If anyone ever comes across such an issue, be sure to check your text-format permissions. They are the ones that never cross your mind.


texts: Search boxes for individuals content types

texts:
I'm trying to have a search facility for different content types on their term pages.

So I have a view that lists all the terms that link through to a page that lists all the nodes that has that term. On this page I want to have a search box which can be used to search any node within it's content type. Now this is fine if I only needed to search one content type, using the Custom Search module I can tell Drupal to only search one content type.

However I need to do exactly the same as above but for a different content type. What would be the best way of implementing this?


texts: How to add css and js to a views-view-table--viewname.tpl.php

texts:
I am theming a  particular view "test" so my theme file is "views-view-table--test.tpl.php".
Its working fine.

I want to add css and javascript to the "views-view-table--test.tpl.php" file
Used the below code to add css and javascript. but its not working:

drupal_add_css("themes/bartik/style-test.css", $type = 'file', $media = 'all', $preprocess = FALSE);
drupal_add_js("jquery.min.js", $type = 'file', $media = 'all', $preprocess = FALSE);

How to add css and js to views-view-table--viewname.tpl.php file.


texts: How to create different Panels for Add and Edit node?

texts:
There is a default "add/edit node" panel inside the Pages content.

When I use it, it utilize the its variant for both add and edit forms.

I would need to differentiate between both of these two instead of having a common panel for both of them.

Do you have any solutions?

(My Drupal version is 7.x)


texts: Image captch is not reloaded when user enter wrong captch

texts: So in my project contact us form is there . In that I used image captch. But problem is there when user insert wrong captch then ajax throw error message but after that image captcha is not reloaded. For reloading captch require refresh whole page .So then user also try to insert captch once again then also throw error. So for that mean for reloading image captch what should I do.. ? please help me I am stuck on that issues...


texts:
Some of search engines (yandex in my case) want me to output favicon with type image/x-icon.

But drupal 7 outputs it without this type.
How could i override this through template.php or any other suggestion?
Thanks!


texts: Passing arbitrary data into a node prior to preprocessing

texts:
I am looking for a way of passing arbitrary data though node_view() to a preprocess function.

I am using the following code.

  $node = node_load(1);
  $node->mycustomdata = 'mydata'; // This is the data I want passed through.
  return node_view($node,  'teaser');

I want mycustomdata to be available to me inside my preprocess function so I can add it as a template variable.

function MYMODULE_preprocess_node(&$variables) {
  $node = $variables['node'];
  $variables['mycustomdata'] = $node->mycustomdata; //  Here is where I want to access the data.
}

How can I achieve this?


texts: Getting "--> ;" on front page after editing custom html.tpl file

texts:
I am newbie and using Drupal - 7.

I have added script tags into my customized html.tpl file.

And now I am getting this "--> ;" into front page of my website.

This is the code for my customized html.tpl. file with script tags.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
  "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" version="XHTML+RDFa 1.0" dir="<?php print $language->dir; ?>"<?php print $rdf_namespaces; ?>>
<head profile="<?php print $grddl_profile; ?>">
  <?php print $head; ?>
  <title><?php print $head_title; ?></title>
  <?php print $styles; ?>

<body<?php print $attributes;?>>
<?php print $scripts; ?>

    <?php print t('Skip to main content'); ?>

  <?php print $page_top; ?>
  <?php print $page; ?>
  <?php print $page_bottom; ?>

Can anyone please help me?

Thanks!


texts: how to connect android app to drupal database?

texts:
I have a Drupal Site with content. I now want to make an Android App. Obviously, I would like Android App to access my Drupal site database - has anyone tried this?

From what I have read (from Google), it seems that I could use something like the phonegap module, or the Services module.

Am I on the right path? Are there other modules/tools/features I should be researching?


texts:
I'm trying to post data from ajax to php page which I made in the hook_menu, called "handler".
So I have "domain.com/handler" which I try to do this in it:

function handler(){
  print_r($_POST);
}

and the hook looks like this:

$items['handler'] = array(
  'title' => 'Handler',
  'description' => 'handler for File Upload',
  'page callback' => 'handler',
  //'access arguments' => array('access my_module_name via ajax'),
  'access arguments' => array('access example ajax'),
  'type' => MENU_CALLBACK
);

and on my js file i do this:

$.ajax({
  url: "/handler",
  type: "POST",
  dataType: "json",
  data: {"name":"John","location":"Boston"}
})

and its wrapped inside Drupal.behaviors.mymodule = {...}
when I run the ajax, the response I get is an empty array.
why don't I receive the data?


texts: how to include one drush make.yml file in another?

texts:
With the INI-style drush .make files I could say includes[common] = "common.make" in say, drupal_master.make but I can't see a way of breaking my make.yml files into smaller reusable chunks.
I've tried

imports:
  - common.make.yml

(like Symfony uses elsewhere) as well as other guesses and I can't see any examples or documentation on "including" YAML drush make sub-files.

Can it be done?


texts: Fields of type address are not set when using businessrules

texts:
I'm using webforms with businessrules(beta10) to create a node entry from a webform submission as described in
https://www.youtube.com/watch?v=3FAgt8aijYA&feature=youtu.be.
I'm using tokens to get data from the webform submission. eg. [webform_submission:values:title].
This works for text, email and urls without problems, but not on address.
I've tried:
[webform_submission:values:address:0]
|[webform_submission:values:address:0]
[webform_submission:values:address:0:raw]
[webform_submission:values:address:0:value]
[webform_submission:values:address:0:address]
[webform_submission:values:address]

but none seem to work.
outputting those tokens into a text field displays the correct values, but setting a field of type address doesn't work.
Does anyone know what went wrong?


texts: In drupal 7 views, can views data be cached for logged in authenticated users?

texts: For drupal 7 views 3.x, can you cache the data for logged in authenticated users? And where would this setting be located? A screenshot would be great! thanks!


texts: Is there a module that lets one person do a bulk publish/update?

texts:
On my site I need the ability to let multiple people edit and add content, but I need that content to be only able to be published at one time by one person.

Is there a module out there that lets a user of a certain role publish all of the new and updated content at the same time?


texts:
Have struggled with this for a couple of days and find no easy solution (TWIG?)
Drupal commerce 2.X (D8)

I need to move the price before/above add-to-cart button
Like this:
Color:
Red
Size:
Medium
Price:
$ 49,00

Add to cart

I need to do this because the price of the product changes when you choose variation.

Thanks!


texts:
I need to build a preset witch if the original image have width<100 or height<100 resize the image to have the smaller side = 100px

There is a way to do this?

I need this because I have an image displayed with cluod zoom and the zoomed imaged used now is in image style "original" but if the image is small we can have this kind of bug:

Normal (not hover)

Zoomed (hover)

As you can see if the image is smaller than the notzoomed one so I need to fix a minimum dimention.