texts: SMTP Authentication Support address/from name overwritten by Site Information

texts:
Pretty much as the title says really. I'm using the SMTP Authentication Support module to try and send account notification e-mails through our G Suite account. I've filled in a name and e-mail address in the E-mail Options section, but whenever I send a test mail it arrives from the e-mail address given in Drupal's main Site Information options, and without a from name at all.

How do I get it to display a from name in the e-mails it sends?

Using Drupal 7.67 and SMTP Authentication 7.x-1.7.


texts:
At moment Drupal add css class page-VIEWPATH to the body tag. How can I add css class page-VIEWNAME to the body tag without third party module or JQuery?

Thank you in advance!


texts: Forms with multiple conditional and multiple rows

texts:
What modules can I best accomplish a form that required conditionals

(i.e. choose radio button 1 and these sets of fields are displayed)

But as well, supporting multiple rows (i.e. a collection of name, phone, email) that can be duplicated and entered more than once?

There are a couple of choices, Inline Entity Form, Webform, Entityforms... What modules would you recommend, or is it better writing a custom solution?


texts: How does a Webform able to differentiate among radio buttons, check boxes and Lists

texts:
I am using webform module to build forms. Initially i created a simple form with few components like text-field, text-area, radios, check boxes , Drop down list and submitted it.

When i checked the database,  I found that the module is storing type "select" for the components radio, check boxes and lists in table name "webform_component". I want to know how can we differentiate them.

Please check the screenshot,

While creating the form i choose the following parameters

Gender ----> Radio

Range  ----> List

Hobbies----> Checkbox

But in the table it was shown as "select" for all the fields

Can anyone suggest the way to find out ?


texts: Provide an interface to edit only one field of a content type?

texts: I am trying to create a 'start a bounty' system, just the same as on this site using userpoints. There should be a link 'Start a bounty' which allows the question creator to start a bounty using his points. I am using userpoints for this purpose and I created a field where the user can select the number of points he would liek to give out for a correct answer. But this can only be done on node creation or while editing the entire node. The question is - how to be able to select the number of points only after clicking on 'start a bounty' without the need of editing all the remaining fields. So ideally there should be a popup with dropdown field that edits only this particular field. I guess one approach is to create a node edit form with this field only (is this possible at all?) and put it in the ajax popup... Any ideas / advice?


texts:
I'm creating an install profile and I just can't seem to get my blocks enabled.

When I check the database after using the code below in my install function it puts the records in the block table, but the status is set to 0 and the region detail isn't inserted.

I'm using code from other install profiles and I can't see why mine isn't working - works fine on things like the erecruiter profile, the omega profile, but whenever I try it never works! Anyone experienced similar?

// Enable some standard blocks.
$default_theme = 'mytheme';
$admin_theme = 'seven';
$values = array(
array(
  'module' => 'system',
  'delta' => 'main',
  'theme' => $default_theme,
  'status' => 1,
  'weight' => 0,
  'region' => 'content',
  'pages' => '',
  'cache' => -1,
),
array(
  'module' => 'node',
  'delta' => 'recent',
  'theme' => $admin_theme,
  'status' => 1,
  'weight' => 10,
  'region' => 'dashboard_main',
  'pages' => '',
  'cache' => -1,
),
array(
  'module' => 'user',
  'delta' => 'login',
  'theme' => $default_theme,
  'status' => 1,
  'weight' => 0,
  'region' => 'sidebar_first',
  'pages' => '',
  'cache' => -1,
),
array(
  'module' => 'system',
  'delta' => 'navigation',
  'theme' => $default_theme,
  'status' => 1,
  'weight' => 0,
  'region' => 'sidebar_first',
  'pages' => '',
  'cache' => -1,
),
array(
  'module' => 'system',
  'delta' => 'powered-by',
  'theme' => $default_theme,
  'status' => 1,
  'weight' => 10,
  'region' => 'footer',
  'pages' => '',
  'cache' => -1,
),
array(
  'module' => 'system',
  'delta' => 'help',
  'theme' => $default_theme,
  'status' => 1,
  'weight' => 0,
  'region' => 'help',
  'pages' => '',
  'cache' => -1,
),
array(
  'module' => 'system',
  'delta' => 'main',
  'theme' => $admin_theme,
  'status' => 1,
  'weight' => 0,
  'region' => 'content',
  'pages' => '',
  'cache' => -1,
),
array(
  'module' => 'system',
  'delta' => 'help',
  'theme' => $admin_theme,
  'status' => 1,
  'weight' => 0,
  'region' => 'help',
  'pages' => '',
  'cache' => -1,
),
array(
  'module' => 'user',
  'delta' => 'login',
  'theme' => $admin_theme,
  'status' => 1,
  'weight' => 10,
  'region' => 'content',
  'pages' => '',
  'cache' => -1,
),
array(
  'module' => 'user',
  'delta' => 'new',
  'theme' => $admin_theme,
  'status' => 1,
  'weight' => 0,
  'region' => 'dashboard_sidebar',
  'pages' => '',
  'cache' => -1,
 ),
);
$query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
foreach ($values as $record) {
  $query->values($record);
}
$query->execute();


texts: "Call to a member function label() on null", while it's defined

texts:
I'm using a module_suggestions_alter hook to force (or not) which template must be used in a specific case. The custom template I chose must is used in several cases, but sometimes, the default template must be used instead.

A while ago, I discovered that having too much templates for one node causes Drupal to choose the wrong template. I also discovered that I can remove the other suggestions so that I'm sure Drupal will choose the right template.

Now, I'd like to do the following: if the node type is equal to "node type 1" or "node type 2" (for example), then I unset every suggestions so Drupal uses the default template, node.html.twig. If not, I leave my custom template as a suggestion

  Disclaimer : I don't know if my "method" is the best one, but this is all I could think about. Feel free to tell me if this is heresy.

Here is my code:

function module_pdf_theme_suggestions_alter(array &$suggestions, array $variables, $hook) {

  $node_type = ['node type 1', 'node type 2'];
  $view_mode = "node__module_pdf";
  $type = $variables['elements']['#node']->type->entity->label();
  // Outputs 'node type 1' if I do a die(kpr($type));

  if(in_array($type, $node_type)) {
    $view_mode = '';
  }

  if($variables['elements']['#view_mode'] === 'module_pdf') {
    foreach($suggestions as $i => $suggestion) {
      if($suggestion !== $view_mode) {
        unset($suggestions[$i]);
      }
    }
  }
}

So, as I told you, if the node type is equal to one of the elements that I set in the array, it will "erase" the $view_mode content. This way, the foreach will unset everything, and tell Drupal to use node.html.twig.

My main problem however, is that even though $type gives me the correct node value when tested, it will cause a server error if I use it in my foreach, and I don't know why. Error output is the following:

Error: Call to a member function label() on null

I tried a verification to check if the node type existed, but nothing changed. How can I fix this?


texts: Sharing only one content type between 2 websites

texts:
I have 2 websites set on the same drupal 7.32 instance. There are completely different, with different databases. But I need to show some content from website1 in website2.

I just need to get a list of nodes from the database for website1 with one specific type and list some details about them in website2.

I know I can get all the nodes with a certain type like this:

$nodes = node_load_multiple(array(), array('type' => 'node_type_here'));

But this (obviously) works within the same site.

Any tips on how I can get them on a different site?


texts: Migrate: createStub() method not being invoked

texts:
I'm trying to use Migrate to import some stuff from a database into terms on a site. The terms might be hierarchal, so I'm trying to create stubs for the possible parents. However, my createStub() method doesn't ever seem to be invoked, and if I check in a prepareRow() method, I'm still seeing the source database's IDs. Can anyone see what I might be doing wrong here?

<?php
class AlbrightsCoolTermMigration extends Migration {
  public function __construct($arguments) {
    // …
    $this->addFieldMapping('parent', 'ParentId')
      ->sourceMigration(array($this->getMachineName()));
  }

  public function createStub(Migration $migration, array $source_id) {
    error_log(print_r($source_id, TRUE)); // This never fires
    static $vid = NULL;
    if (!is_numeric($vid)) {
      $vocab = taxonomy_vocabulary_machine_name_load('product_category');
      $vid = $vocab->vid;
    }
    $term = (object) array(
      'vid' => $vid,
      'vocabulary_machine_name' => 'product_category',
      'name' => 'stub',
    );
    taxonomy_term_save($term);
    return array($term->tid);
  }
}

?>


texts: Why and what wrapper should I use for my module's JavaScript file?

texts:
I am defining a d3.js script for my module like this:

test:
  js:
    js/test.js: {}
  dependencies:
    - mymodule/d3
    - core/drupalSettings
d3:
  remote: https://d3js.org
  version: "4.x"
  license:
    name: BSD
    url: https://opensource.org/licenses/BSD-3-Clause
    gpl-compatible: true
  js:
    https://d3js.org/d3.v4.min.js: { type: external, minified: true }

In my controller, I am sending my data (in $data) to the script, like this:

$page[] = array(
  '#markup' => 'foo',
  '#attached' => array(
    'library' =>  array(
      'mymodule/test',
    ),
    'drupalSettings' => array(
      'mymodule' => array(
        'test' => array(
          'data' => $data,
        ),
      ),
    ),
  )
);

It's working fine, but I've noticed that most js files in core have a wrapper - there is some information here.

Should I be using a wrapper for my script? and if so, what should the wrapper be? and why?

There is no jQuery in my script:

(function (Drupal, drupalSettings, d3) {
  Drupal.behaviors.mymoduleTest = {
    attach: function (context, settings) {

      const data = JSON.parse(drupalSettings.mymodule.test.data);

      ...

      console.log(data);

    }
  };
})(Drupal, drupalSettings, d3);

I'm wrapping my code, with these three lines top an bottom, but I don't understand if I need any of it?


texts: Make a views of data entered in composed fields

texts:
How to output the data entered in Composed Fields to Views?

I have used Composed fields of 3 subfields, it was OK while entering the data. But When I want to display the entered data in Views, I get only blank fields.

After digging dip into it, I tried rewrite the Result, Only in Write result I get Token like [field_field_name-composed], which outputs the serialized PHP code:

a:3:{i:1;s:14:"First Subfield";i:2;s:15:"Second Subfield";i:3;s:14:"Third Subfield";}

where First Subfield, Second Subfield, Third Subfield are the data I entered into 3 subfields of Composed field, and is also defined by s: before it. If it is String type and 14 Characters long, then its written as s:14:

I also see the Token like [field_field_name] but it outputs blank (NULL).

So, I planned to use Views PHP to get the data from Composed Field and use some PHP code, but in Views PHP field, I am unable to use the Token [field_field_name-composed].

I want to make a Views with 3 fields to display each Subfield in its own field, is it possible?

EDIT:

I came to know this is using PHP Serialize function, but when I tried PHP Unserialize in Views PHP, I get blank string.

EDIT2:

The result of Unserialized value of above serialized field is:

print_r(unserialize('a:3:{i:1;s:14:"First Subfield";i:2;s:15:"Second Subfield";i:3;s:14:"Third Subfield";}'));
Array
(
    [1] => First Subfield
    [2] => Second Subfield
    [3] => Third Subfield
)


texts: Drupal Commerce : Shopping Cart Checkout for Orders

texts:
What I'd like to do is have an order page where the user see's a list of all products.

They'll then fill out the quantities they want and click on 'checkout'  .

So it'd look like how the Cart looks once you've added products

Has anyone done this or anything similar.   I'm currently looking at using Drupal commerce on Drupal 7.

Much Appreciated.


texts:
I have a problem with view permission, when I make a view in drupal 7 there is an option "access" when I specify the option eg:"view published content" all users that has the role of published content can see all the content that are belongs to that view. But I want some thing else, I want to give the permission for users to access just his/her own published content not all published content that are belongs to that view.
cheers


texts: Social Media Managament - Feed Scheduling

texts: I am wondering if there is a module that allows you to set up a schedule and auto post to social networks?(FB and Twitter)


texts: How to get different image styles in the same view?

texts:
I'am a newbie, and I want to make a simple view with an image field (in article nodes), that looks like this layout :

And for this, I don't want to use CSS rules to resize the view rows images, for two reasons :

I am using bootstrap grid, and I don't want to deal with relative heights, since images in articles have various sizes, so I prefer that this view do the image resizing for me.
I want to learn this view trick without relaying on CSS tricks.

I tried different tricks, like:

importing the image filed twice, making each one in different image style, rewriting them (displaying them conditionaly) based on "view result counter", but putting a condion like {% if counter == 1 %} or like {% if counter == '1' %} don't work (i think it still an open issue).
I tried also making some theme preprocess or theme hook altering to force a different image style for the first iteration.

I'm so frustrated because of such an easy task that looks so hard to me.

Any help?


texts: How to apply a patch for a Drupal module?

texts:
I'm trying to us this patch http://qa.drupal.org/pifr/test/298933

Save the patch file to the root directory of feeds module (sites/all/modules/feeds) then apply the patch by using git bash.

So I typed:

git apply -v fcollection.patch

and it returns the following error:

  checking patch field_collection.module...
  error: field_collection.module: No such file directory

I hve a field_collection module installed in my site.

So what I did to experiment is to copy the patch to field_collection module folder and run the patch from that folder.

Then I got this error:

  error: patch_failed: field_collection.module:1142
  error: field_collection.module: Patch does not apply.

How can I apply the patch successfully?


texts:
Question

I would like to make a block for printing messages from the user.

I already have a snippet of code which print me the last 5 messages, but I want to add more information like the author and the date.

Snippet of code

global $user;

$query = _privatemsg_assemble_query('list', $user, 'inbox');

$list = array();
$count=0;
foreach ($query->execute() as $thread) {
  if ($count <=5) {
    $list[] = l($thread->subject, 'messages/view/'. $thread->thread_id);
    $count++;
  } else {
    break;
  }
}
 if ($list) {
  print theme('item_list', array('items'=>$list));
}
   else {
echo '
You still have no message yet
';
}


texts: Rules data comparison: compare node field with a group

texts:
How to use rules to compare a field from the node with a specific Organic Group?

I am using rules event after saving new content of type X. Now I need to specify if in the field field_group the value is a specific group.

I am able to get the field of the node, but have no clue how to be able to compare it with a group I want.


texts: how to create a views from newly added field

texts:
I use this code to add a field to comment's table.

function cmnt_install() {
  $field = array(
      'type' => 'int',
      'not null' => TRUE,
      'default' => '0',
      'description' => 'state of the comments.',
  );
  $index = array(
      'indexes' => array(
          'sts' => array('sts')
      ),
  );
  db_add_field('comment', 'sts', $field, $index);
}
function cmnt_schema_alter(&$schema) {
  $schema['comment']['fields']['sts'] = array(
      'type' => 'int',
      'not null' => TRUE,
      'default' => '0',
      'description' => 'state of the comments.',
  );
}

function cmnt_uninstall() {
  db_drop_field('comment', 'sts');
}

now I want to create a views from comments and add this field as filter criteria or field. but I don't know how?


texts: How can I override the empty search message?

texts:
What do I have to do to override the message

  Your search yielded no results

from core search module inside core/modules/search/src/Controller/SearchController.php?


texts: How to authenticate a user which exists in an external site?

texts:
I would like to authenticate a user which exists in an external site.

Here is a use case:

In Drupal, user enters his username and password and hits submit.
Drupal tries to find that user in it's system and does not find him. At this point an error message is still premature.
Drupal then runs a custom function which does a REST call to an external site.  The REST call validates the username and password.
If the username and password pair is valid, the REST call returns a success code.
I then log him in.

Is this possible? If so, how? What hooks do I need to implement?  What method should I call to log a person in?

I can programmatically log a user in via

$form_state['uid'] = <user_id>;
user_login_submit(array(), $form_state);

but user_id needs to exists in Drupal for this piece of code to work.

I am using Drupal 7.

Thanks.


texts:
I have a Drupal 7 setup with a number of different content types, each with a common set of fields.

Each content type has its own feed, which calls a .csv that's produced from a Google Spreadsheet in tab-delimited format. Cron is set to run feeds importers daily, so when we make updates to the Google Sheet they are automatically reflected in the website

This has been working fine until recently, when we noticed the website was not updating. I checked the feeds log and see this:

I checked and the URL to the .csvs are working-- if I past them into the search bar I can download the file.

When I try to run the feeds manually from the "import" page, the screen just goes blank and nothing happens--no error or message. The same thing happens when I try to run cron.


texts: Image widget stopped working after core update

texts:
I recently did a long overdue update from 7.20 to 7.33.

However, after I've made the update, the "Image" widget has stopped working when trying to edit content through the admin screen. I cannot add or remove any images using this widget - it makes an AJAX call and the request comes back as 200, but the image upload/removal fails without an error.

I think it's a problem with the AJAX but I can't be sure.


texts:
I'm writing a new module which has a dependency on an external library. In Drupal 7 I would use hook_libraries_info giving the name of the library the required assets and Drupal would search the valid locations, libraries directories, to load these assets when required. Drupal 8 introduces *.libraries.yml and after reading https://www.drupal.org/node/1996238 it seems that module developers must now provide a path, relative or absolute, to the required assets.

In my case I will be expecting site builders to download the external library - where should libraries be located in Drupal 8?


texts: How to implement side-by-side translation?

texts:
How can you set up a translation system in Drupal which displays, for example, the English and the French node edit forms side-by-side? Is this possible using any of the contrib modules?

Additionally, how would I go about setting a requirement that a translation must always be entered when entering English content. Eg, to publish a piece of content, it must have both an English and French translation. Maybe through rules?


texts: How to enable theme on profile installation

texts: I am creating a drupal 6 installation profile and I want to enable a specific theme on installation. How can I do that?


texts:
I'm having trouble doing simple stuff in jQuery. What I wanted was to call a function when something was typed in an input field.

Now I'm just trying this: when you click anywhere on the page to call an alert box like this:

(function ($) {
    $('body').click(function() {
        alert('test');
    });
})(jQuery);

This doesn't work ... . But when I do this:

(function ($) {
    alert('test');
})(jQuery);

I get an alert box when I load the page. My js file is loaded like this:

function xmed_preprocess_page(&$vars) {
    $path = current_path();
    if ($path == 'node/add/product') {
        drupal_add_js(drupal_get_path('theme', 'subtheme') . "/js/add.js", array('weight' => 1000));
    }
}

The file is loaded correctly. I'm working with jQuery v1.10.2. What could be the problem?


texts:
I would like to use Bootstrap's scrollspy plugin in Drupal 8.
So I edited the html.html.twig file replacing

<body{{ attributes.addClass(body_classes) }}>

With

<body{{ attributes.addClass(body_classes) }} data-spy="scroll" data-target=".nav-scrollspy" data-offset="50" >

Where .nav-scrollspy is the class of my navigation block. Additionally I added the following JavaScript to my theme:

$('body').scrollspy({ target: '.nav-scrollspy' });

But as this does not work I were wandering whether or not this plugin is already integrated in Drupals Bootstrap theme. Apparently not, as I could not locate such a file in themes/bootstrap/js/.

Unfortunately I did not find such a file in the web neither, so I am asking my self, where to get it and how to add it to Drupal?


texts:
i have been handled a drupal site to work on, the problem is its very messy, they were building every single detail as a content type (using CCK), that produce around 150 content type and 560 database table ( now you can imagine the mess), and i want some document to convince my team leader that this is a bad approach to follow

if any one could help


texts:
I want to create a module that on installing and creating a new field on a content type it should alter the schema of another module.

Im trying to use hook_storage_create_field to react on creating an new field but its not running.

function mymodule_field_storage_create_field($field) {
  exit(var_dump($schema));
  $schema = _field_sql_storage_schema($field);
}

Im I misusing the hook? or there is something faulty in my module?

Update

What Im trying to do is to create a new module that extends the Link module to work like Facebook parser.

So when users add a new link a preview will show a preview like this Redsun parser
The functionality is already made and adapted into Drupal, but still having problem extending link schema to have extra fields for images and body fields.

A new widget is added to link field called "link with parser", and it will fire our extra codes to save and validate the link.


texts: Have administrators approve user accounts after users confirm their e-mail addresses and set passwords

texts:
For my current Drupal 7 project I set up the account creation process the following way:

User can register for an account.
User will receive an email telling him that the account needs to approved by the administrator
Email is being sent to the administrator asking him to approve the account.
Once the administrator has approved the account another email is sent to the user with a link, leading the user back to the portal to set his new password and to log in.

What I am after is a slight change to this process:

I want the user to get the email first to set his password and therefore confirm his email address.

Once that is done I want the email being sent to the administrator to approve the account.

Is that possible?

Thanks, Uwe


texts:
I am trying to use the Disallowed Content configuration from Ckeditor.
https://docs.ckeditor.com/ckeditor4/latest/guide/dev_disallowed_content.html
I am using Drupal 8.5.3 Lightning 8.x-3 and the built in Ckeditor v4.8

I have placed this js in my theme and the js is loading when I am in page edit mode.

(function ($, Drupal) {
  Drupal.behaviors.customCKEditorConfig = {
    attach: function (context, settings) {
      if (typeof CKEDITOR !== "undefined") {
        config.disallowedContent= 'div span';
      }
    }
  }
})(jQuery, Drupal);

But this is not working. I have tried with the Allowed HTML tags enabled and disabled. I got this information from these sources. http://drucafe.blogspot.com/2016/02/adding-custom-styles-to-ckeditor-in.html
and https://tutel.me/c/drupal/questions/183036/allow+empty+tags and Drupal 8 CKeditor behaves LTR in an RTL site.

I have tried the filter 3 different ways

editor.filter.disallow( 'span div' );
config.disallowedContent( 'span div' );
config.disallowedContent= 'div span';


texts: Execute jquery function if Ajax callback form complete

texts:
I got a custom ajax callback which replaces my checkbox options based on the select option.

Now after the checkboxlist get's updated i need to execute a jquery function on those checkboxes.

How can i execute this custom jquery function after the callback is done, so after the checkboxlist is updated.

Form element:

        $widget['select_box'] = array(
            '#type' => 'select',
            '#title' => 'Select bussen',
            '#options'  => $options,
            '#validated' => TRUE,
            '#default_value' => '_none',
            '#attributes' => array('class' => array('select-province')),
            //The callback
            '#ajax' => array(
              'callback' => 'ajax_select_callback',
              // 'wrapper' is the HTML id of the page element that will be replaced.
              'wrapper' => 'replace_select_div',
            ),
        );

        //Form element wich get updated
        $widget['select_box_2'] = array(
            '#type' => 'checkboxes',
            '#title' => 'Select bussen',
            '#options' => ...,
            '#prefix' => '
',
            '#suffix' => '
',
            );

Ajax callback function:

    function ajax_select_callback($form, $form_state) {
      // The form has already been submitted and updated. We can return the replaced
      // item as it is.
    return $form['line_item_fields']['field_bussen_select']['und'][0]['select_box_2']

    }

Jquery function i run on the checkboxes:

    jQuery("input[type='checkbox']").change(function () {
        jQuery(this).parent().siblings('ul')
            .find("input[type='checkbox']")
            .prop('checked', this.checked);
    });


texts: is there any way to load commerce_products into a collection in rules configuration

texts:
I need to load all commerce products that their status is "active" into a collection in rules configuration.

I searched in internet and also I tried rules bonus pack but the didn't help me.

Is there any way to load commerce products into a collection and iterate collection via loop ?


texts:
I want to remove all the default Drupal markup around content types fields.

In Drupal 7, Fences does it like a charm, but its Drupal 8 version is not stable yet. Another choice would be Display Suite Extra, in Drupal 7, and we can do it with Control markup with field templates, but in the Drupal 8 version there isn't any admin/structure/ds/extras and Check the option Enable Field templates exists.

How can I get rid of the default markup field wrappers?


texts:
I have three taxonomy vocabularies in my site and one of them using custom template files.. Parent and child term pages and that's ok.. But I don't want to use these template files for two other vocabularies.

I was trying to use TVI module and I get nice views for these vocabulary terms, but I have one huge problem. It messed up my third category page.. It's override template files.

3 vocabularies: Articles, Blogs and Notes..

Articles uses parent-term.tpl files and it's ok, but blogs and notes uses views with TVI module. When I enable TVI module my article category pages messed up..

So what I can do? I love this module, but I don't want automatic override article term pages or nothing.. Only use this module for blog and notes category pages.


texts: Insert a view into a block or a node using a shortcode

texts:
I need the following:

I have a view that lists my portfolio projects the projects have a term reference field for its category. I want a shortcode for insert the view into some of my nodes and be able for apply arguments or filters for example:

Category 1 AND Category 2
Category 1 OR Category 2
Or simply listing the project node IDs: 333,332,334

I found the Insert view module with that module I can make a shortcode like this

[view:view_name==arg1/arg2/arg3]

but how I told you I need to be able for filter in the short code Category_1 AND Category_2 for example or list the given node IDs

How would you do this using Insert view module?


texts: How to ensure emails are sent only once to users in a Views Block Operations (VBO) list?

texts:
I created a view which is a list of comments made by users to a particular node.

I then created a rule which triggers upon event "when a new comment is saved" The action is to load the view i created, loop through the list and then send an email to all the users who have previously posted comments.

My challenge is that it sends emails to the users based on the number of times they appear in the list. So for example a user who has made 3 comments to the node will get three (3) emails each time a new comment is saved.

I have tried using the Distinct query. It did not work.
I also installed the Views distinct module and selected the filter option. This filtered the list to one value each, but mails were still sent multiple times to people who had commented more than once.

Please is there a way to ensure emails are sent only once irrespective of times user has commented to the node/appears on the list?


texts:
I tested a migration from Drupal 6 to Drupal 8 on a local installation (2 differents multisites). Sometimes I get "ghost files" after running upgrade_d6_file.

  Processed 1444 items (1441 created, 0 updated, 3 failed, 0 ignored) - done with 'upgrade_d6_file'
  upgrade_d6_file Migration - 3 failed.

Then in admin/content/files, I get files like swadouotoclabruswuspitomiswulusliwokedaspamaslouawrotrephichophasichocutribuhostestus or wruhahachicregiwaspidristocospopowrucrekefrocojegephehoshapracocrewafrispugedrachupuclushipreclochoshusiclastewracrislumufraswiheracribra.

How can I fix this issue?

EDIT1:
In my use case, with a custom node content migration.Not sure about using the Skip on empty option. However file exist, ghost files are created.

id: upgrade_d6_node_diapo_hp
label: Nodes
audit: true
migration_tags:
  - Drupal 6
  - Content
  - Migration_CE
migration_group: migrate_drupal_6_ce
source:
  plugin: d6_node
  node_type: diapo_hp
process:
  # In D6, nodes always have a tnid, but it's zero for untranslated nodes.
  # We normalize it to equal the nid in that case.
  # @see \Drupal\node\Plugin\migrate\source\d6\Node::prepareRow().
  # If you are using this file to build a custom migration consider removing
  # the nid and vid fields to allow incremental migrations.
  nid: tnid
  vid: vid
  langcode:
    plugin: default_value
    source: language
    default_value: "und"
  title: title
  uid: node_uid
  status: status
  created: created
  changed: changed
  promote: promote
  sticky: sticky
  body/format:
    plugin: migration_lookup
    migration: d6_filter_format
    source: format
  body/value: body
  body/summary: teaser
  revision_uid: revision_uid
  revision_log: log
  revision_timestamp: timestamp

  #OK
  field_diapo_home:
    plugin: d6_field_file
    source: field_diapo_home
    process:
      target_id:
        plugin: migration_lookup
        migration: upgrade_d6_file
        source: fid
        -
        plugin: skip_on_empty
        method: process

#  unmapped d6 fields.
#  tnid
#  translate
#  moderate
#  comment

destination:
  plugin: entity:node
migration_dependencies:
  required:
    - upgrade_d6_user
    - upgrade_d6_node_type
    - upgrade_d6_node_settings
    - upgrade_d6_filter_format
  optional:
    - fields_instance_widget
    - fields_formatter_settings


texts:
I'm using JW Player for playing video files and it's working great.

Is it possible to play video streams with this player?

I already have a rights to stream and link for a TV station. It's in this format: http://XX.XXX.XXX.XXX:9090/stream.flv

How can I set this link for stream?

If you know some alternative player with possibility of live streaming, please let me know.


texts: Working with OG group members within entityform

texts:
I have a reference field in my form (which is an entity form type) to select a drupal member but I need the selected member to be also a member of a specific OG group.

How would that be possible with entityform and OG?


texts: Need Help passing field data from one content type to another

texts:
I am working on an Equipment Checkout system using Drupal 7, MERCI, views, panels, rules, and many other modules. I am working for a community college in Oregon. I am upgrading features on an already running system that was built by myself with the help of a few other people last year. The system is offline for the summer.

Before I jump into the nuts and bolts of the question let me give you a little information on our workflow.

When the Student want to checkout equipment (cameras, microphones, whatever) we first open up the students customer account. This is a content type called customer, that has various fields containing data about the student, name, email, L# etc. We do this to verify the identity of the student as well as to make sure that they can actually check out the equipment they are requesting.

After we have verified the students credentials. We then create a new reservation, that is also a content type. Then we input the student information into the reservation.

So what I want to do: Have a button or link on the customer page that will capture the customer data, create a reservation, and then put the data in the appropriate place.

I have done some searching looking for answers and this seems to be a common problem, but the specifics always seem to throw me off. I've tried a few modules to attempt this, autofill and prepopulate but with no success.

This is the first of many features that I am trying to implement over the next 3 months, any help would be greatly appreciated.

Thank You


texts:
I have some types provided by the Profile 2 module that I want to disable, but not delete.

How can I accomplish this?


texts:
I have set up multiple organic groups on my site that can only be joined with admin approval.

My issue now is that members can post content in groups of which they are not members. I really don't want this.

Does anyone know of a module or technique to stop unauthorized members from posting content in a group but only in groups they are members of and hence authorized to do so?


texts: Does adding more processing power increases Drupal Page Load Speed

texts:
I have a site hosted on Acquia Cloud.all the unnecessary modules are uninstalled. The site has only couple of nodes (300 almost)and lot of imported registered accounts.
Below optimizations are enabled already

http://www.goodykitchen.com

memcache
varnish
CDN - Cloudfront
Page Caching (Drupal's Default)
CSS / JS aggregation

RAM : 1.7GB
CPU : 1 ECU

Problem:

My comparison site is bbcgoodfood.com in terms of page load. I have gone through some research and they are using most of above mentioned optimizations. Is there a way to find out why their page load is so smooth. OR should i just increase the Cloud size and see my site page load. (currently i do not have many users on the site)

any clues ?
thanks


texts: How to set Blocks settings in a Drupal Installation Profile?

texts: Is there a way to have my blocks pre-assigned a region and also enabled / disabled in a profile installation? I don't want to go to the structure / block page and assign these blocks individually each time, but would rather have them setup on site installation.


texts:
I want to update some term id on some node (let suppose 1000 node),My changes is convert all news node with category(term_id) = 3040 to category(term_id)=5).

I know I can do it with several methods( use views bulk operation, write batch running etc, .... ) but my question is about performance of below approaches

Approach based on old method ( node_save)

$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node')
        ->entityCondition('bundle', 'news')
        ->propertyCondition('status', 1)
        ->fieldCondition('field_category', 'tid', array('3040'));
$result = $query->execute();
$nids= array_keys($result['node']);
//ym($nids);

$nodes= node_load_multiple($nids);
foreach ($nodes as $node){
    foreach($node->field_category['und'] as $i=>$item){
       if($item['tid']==3040){
            $node->field_category['und'][$i]['tid']=5;
            node_save($node);
        }
    }

}

Approach based on entity wrapper method

    $query = new EntityFieldQuery();
    $query->entityCondition('entity_type', 'node')
            ->entityCondition('bundle', 'news')
            ->propertyCondition('status', 1)
            ->fieldCondition('field_category', 'tid', array('3040'));
    $result = $query->execute();
foreach($result['node'] as $nid => $stub_node) {
  // Load the full node and wrap it with entity_metadata_wrapper().
  $node = node_load($nid);
  $wrapped_node = entity_metadata_wrapper("node", $node);
  if ($wrapped_node->field_category->value()->tid == 3040) {
    $wrapped_node->field_category->tid->set(5);
    $wrapped_node->save();
  }

in first approach we have one node_load and one node_save but in second approach we have one node_load one creating entity metawrapper creation and one entity wrapper save.
I want to know which method has better performance?
let suppose we have the same situation for both 2 method, I just want somebody tell me ( take a benchmark on one node and  in bulk ( multi node) mode and tell me the performance of both that which one of this method is faster in the same situation.
please provide your answer with facts or benchmark testing result


texts: Development to staging to production process

texts:
I am looking for suggestions on the right way of moving configurations and code from Dev to Staging to the Production environment for Drupal 8 Site. I also need to set up a Reference environment which will be a replica of the production environment but on a server with less resources.

I am using git for code, so it is an easy task to move code changes around.

The site is developed iteratively, hence I need to deliver content types, views and display in an iterative manner to the production site, which will have content already present based on the previous iteration.

I can see some documentation on this topic but all of them are about Drupal 7 or earlier versions.

Any help/suggestions or pointers will be appreciated.


texts: Add fields dynamically using javascript or triggerring add field dynamically

texts:
I have a content type called article.
I have added a field called attribute which can have unlimited values.
At present there is an 'Add another term' button present in the add/edit node page to add those extra values.
But I want these fields added dynamically and values populated based on the values entered on the body field, i.e. if I had entered #abc, #cdf, #aws on the body field, on blur even, three attribute terms must be generated with values  abc, cdf, aws.
I have added a javascript code to add the fields, but when saved, only the first value only gets saved.What more should be done or anything is missing?
How can this be done. I have done the part of extracting the values. i need to know how form field can be added?

function isevencheck(value) {
    if (value%2 == 0)
        return true;
    else
        return false;
}
    jQuery.noConflict();
    jQuery( document ).ready(function() {
        jQuery('#edit-body-und-0-value').blur(function() {
         var text = jQuery('#edit-body-und-0-value').val().match(/\#(\w)+/g)  ;
        $i=0;
        contents="";
        for (var obj in text) {
            if(isevencheck($i)){
                cls="draggable odd";
            }else{
                cls="draggable even";
            }
             text =text[obj].replace('#', '') ;
            contents+='

&nbsp;

<input class="text-full form-text" type="text" id="edit-field-attribute-und-'+$i+'-value" name="field_attribute[und]['+$i+'][value]" value="'+text+'" size="60" maxlength="255">

Weight for row 1 <select class="field_attribute-delta-order form-select" id="edit-field-attribute-und-'+$i+'-weight" name="field_attribute[und]['+$i+'][_weight]"><option value="-1">-1</option><option value="0" selected="selected">0</option><option value="1">1</option></select>

';$i++;

        }
 jQuery('#field-attribute-values tbody')
  .html(contents);

});
    });

I think the thing that is left to be done in this is to rebuild form using ajax. How that is to be done?


texts: Why does my module's hook block_list_alter only list a few blocks?

texts:
function mymodule_block_list_alter(&$blocks) {
  foreach ($blocks as $block_id => $block) {
    debug($block->module);
  }
}

the above code debugs only two messages, each time "system". I've changed the weight of my module which still just debugs very few blocks. What am I missing?

The module itself provides a block which I simply want to hide from the block list/ overview. It has a webform dependency.

Thanks


texts:
In my Drupal 7 site I want to display how many times user's content was flagged.
As option I want to set a global variable counts and display it in different parts of *.tpl.php files. The value can be calculated with flag_get_counts($entity_type, $entity_id) for each user's node_id. Function that calculates counts should be called in template_page_preprocess() to update value each time page is reloaded.

What is more efficient approach to implement this?


texts:
I have a website http://www.apisnatura.com  with the modulle MULTILINGUAL - INTERNATIONALIZATION.

I manage to create the pages of each language and when i click any language icon the main menu changes and the rest of the pages also change.

My question is... how do i change the main page content after clicking the different language icons with the relevant language.

I been looking around and i am getting crazy looking for a solution.

Any help will be great to carry on changing the content for this web.

Cheers


texts:
I want to write definition lists with ,  and  tags with drupal commons 3 in CKEditor. I am writing code directly (while I am in source mode) then switch to WYSIWYG and go back to source. CKEditor change this tags to paragraphs.

How to not transform definitions tags (dl, dt, dd) ?


texts: Why isn't the page cal back needed in Ajax jQuery?

texts:
In the following code, I didn't set any page arguments, but I can still tse the parameter in example_result(). Why it works?
function example_menu() {
  $items['example-menu'] = array(
    'page callback' => 'example_result',
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK,
  );

  return $items;
}

function example_result($para) {
  $items = array('a', 'b', 'c');
  return drupal_json(array('values' => $items));
  exit;
}


texts: Is it possible to understand and use Relationships and Contextual Filters without knowing SQL?

texts:
Are there any good, layman descriptions of contextual filters and relationships for those site builders that aren't developers?

Is it possible to be comfortable with Relationships and Contextual Filters without knowing SQL? If so, how?


texts: Build and update a form based on another form

texts:
On the checkout page, I wish to load a form on a modal whose data depends on the uc_addresses select address drop-down.

I have declared a form through hook_form and add the form to the checkout page through mymodule_form_uc_cart_checkout_form_alter:

  $form['panes']['delivery']['modal'] = drupal_get_form('form_id');

My question is: how will I rebuild the form when a different drop-down option is selected? Note that I have tried to add a parameter in hook_form:drupal_get_form('form_id', 'address_id') my problem is the form rebuild when the option is changed.


texts: Drupal taxonomy-term text-body dependency

texts:
i'm using drupal for a website where i post from time to time different events. For this, i made a taxonomy type with four vocabularies, each stands for another event type.

Now my question:
I know that i can put a default text in the body of events which appears when a new event were created. But i want that this text depends on the taxonomy term which is chosen for this event.

I'm guessing that i have to write an php script with an if ... then ... condition. But where i have to write this code and how can i address the taxonomy terms and the body of new events?

I'm a beginner, so please answer a bit more detailed. If i know at the end how to do this, maybe it will help me with a lot of other stuff. Greetings


texts: How to automatically assign child taxonomy terms?

texts:
I'm building a virtual network like Instagram but its contents (images) are about a certain event.  The strategy of selecting taxonomy terms is to display all of the tags (about 20 ones) and a checkbox and users can check any one of them. I use ttr_configurable_widget to do so.

The problem is there are many synonyms for a word and I don't want to display the synonyms, as an example in tagging the words female, women, girl, sister, daughter, lady are almost the same so when some one search for female the lady tag should be searched as well, furthermore this tag should be displayed as a hidden element in the web page(for search engines)

So there is a main tag like women and a set of synonyms. What I need to do is to format the tags as follow

Then only display the woman, when a user selects woman its synonyms also be attached to the content.

It is also preferred to load the synonyms but hide them in the node display page.

How can I do this?

The Taxonomy Term Reference Tree Widget and Taxonomy Group Fields are almost doing this but in these widgets users can check or uncheck the children even if the parent is selected.


texts: How to send an eMail on specific dates indicated in 3 different date fields?

texts:
In 'Add user page' I have added extra fields like:

date of orientation
out of date
anniversary date

I want to remind the users by sending a mail on all 3 of the above mentioned dates, but I am not able to figure out what exactly I need to do.

So far, I have tried with the Date Reminder module and walk through admin->site configuration->date reminders. But there I couldn't see any email setup page. I've also gone through a Rules tutorial but I am not getting how to achieve what I want to do.

Is there anybody familiar with the Rules module who has some suggestions about this? Or if some other module is available to do this?


texts: I have a comment form on a panel and a view below it to display the posted comments. I wonder if there is a way, after posting a comment, to keep the viewer on the the same panel page without being redirected to the comment page? The behavior would be like posting the comment with ajax. Thanks. :)


texts: How to change field values in a view programatically?

texts:
I'm working in a custom module that displays date fields. I want to be able to change the date's timezone programmatically.

I've tried implementing hook_views_pre_render(), but that doesn't allow me to format the field value. I'd really like to do the theming inside my module code since that's where the logic is regarding my timezone.

As a total hack, I could use hook_views_post_render(), but then I'd be doing search/replace on the text and that seems like a poor solution.

What other hooks inside my module are available?


texts: How to get custom indexed field to show up in view?

texts:
I have a custom field I have added to my search index, and I have confirmed that there is data being indexed there, and I can query against it in a view using my global index.  But when I add the custom field as a display field, the field doesn't render.

I'm noticing the same behavior when I add the urls with the AddURL processor.

I can see the fields are there, and I can query against them with filters, but when added to a view as a field, they won't display.

I noticed that if I go into SearchApiQuery.php on line 527 and change this:

foreach ($result->getFields(FALSE) as $field_id => $field) {

to this

foreach ($result->getFields() as $field_id => $field) {

Then the view displays the results, but it also causes a lot of lag, and is obviously a hack I don't want to do.

What am I doing wrong?  Why can't I display a custom solr indexed field in a view?


texts: Remove email validation from Feed Import

texts:
I'm trying to import about 15000 users from a CSV file. Most of the users have valid email addresses, but some (+/- 5000) don't, they're also not blank fields.

Is there a way that I can bypass the email validation? Or a module that can easily help with this?

I've tried re-importing the CSV file with "Do not replace existing users" and removing the email field from the mapping, and I still cannot import them and am getting the "User name missing or email not valid."

I have Optional Mail installed, and have tried importing after disabling the email field for registrations and edit pages and still get the same error.

Any ideas?


texts: Drupal Views adding a view to node-customcontenttype.tpl.php

texts:
I've created a "homepage" content type, and I've created the node-homepage.tpl.php template file, but it doesn't seem it is used, even after I cleared the cache about 10 times.

I am also trying to display a view in this custom template file. How can I achieve this?


texts: How to grant Userpoints after adding a comment once?

texts:
I created a Rule that grants Userpoints to users when they comment on a node. However, I would like to grant these points only once per node per user. That means future comments from the same user on that node should not result in extra points.

How can I do that?


texts: In Drupal 8, how can I add a class to teaser p html tag. I want to style the paragraph in teaser only, not when whole content is shown.


texts: Multi-site user share with different databases

texts: I am trying to setup multi-site on Drupal 9.1 using a shared codebase with separate databases.  Working within each site separately has been fine, and I'm ready to start working on sharing users and content between the different sites.  I'd like users to be shared between the different sites, and for content I would like to be able have links between related pages on each (ex: a translated piece on one site links back to the raw scans on another site, and vice versa), though I anticipate I would be coding some sort of shared database/table for my content linking needs.  I have been able to find how to perform this in Drupal 7, but not so much 8 and 9.  The closest I have seen is the Domain Access module, however that appears to have been made where all the sites are sharing a single database and not separate.  Is there a known way to set this up in Drupal 9?


texts:
I have a route of a page, and I want get the link for it on every language of my site.

On my site the contact page is: en/contact for English, and es/contactenos for Spanish.

I am trying using the following code, but I am getting just the URL for the current language set for the site.

$route = 'contact.site_page';
$url = new Url($route);
$uri = $url->toString();

How do I get it for every language available for the site?


texts: how to get the value of list field type (check boxes)

texts:
$node=node_load(18);
$logo_img = file_create_url($node->field_site_logo[$node->language][0]['uri']); //origional image path
$show_logo = $node->field_options_site_logo['value']; //original image path
if(isset($logo_img)) {
  $web_logo = theme('image_style', array('path' => $node->field_site_logo[$node->language][0]['uri'], 'style_name' => 'site_logo'));
  print $web_logo;
}

I created CMS option of uploading site logo. I also added an option of show/hide this logo (form in node 18). Using the above code, I am able to load the image but don't know how to hide it if this option is not selected. I just want to know how to get the value of this check box. I can write the condition to show or hide this. Please help. Also, please let me know how to include alt option to the above image.


texts:
So I moved my website from local to the server, and now I cant upload any pictures on the server anymore. after clicking on the "browse server" and hitting on "upload" and the ajax loading circle works a bit and back to step one. nothing happens!

also I can upload files via ftp or filefield but not via imce, thought it might be imce, updated to the latest version. still no changes.

There's no error in my dblog and client error console neither.


texts:
I am fairly new to Drupal and i'm working on a already existing site, so i'm facing a lot of issues. I need to make a page that shows nodes of a certain type, it has to contain the following features:

It has to show a search form on top of the page (the site is using the Apache Solr module) to search only content of one type
It has to show nodes grouped under their taxonomy fields. There are 3 vocabularies and nodes have to be listed for each vocabulary, for example:

Vocabulary 1

Term 1

Node 1

Node 2

Vocabulary 2

Term 2

Node 1

Node 3

Nodes can be shown more than once for each Taxonomy term

I know i'm asking a lot and probably the question is borderline with the stackexchange rules, but i have tried a lot of modules and solutions (for example using the Views module) but i just can't get what i want no matter how i try


texts: How can I remove a property from an entity in Drupal 7

texts:
I have a custom entity that was create a long time ago.  Now we want to update the schema to remove a property (not a field) that was defined in the original schema.

I've reviewed the Drupal API for managing schema for custom entities and I don't see anything that allows me to remove the column during a hook_update_N function.

Am I missing something obvious here?


texts: Exporting a view from one site to another

texts:
I'm a Drupal beginner with a problem.

I'm gonna do some updates on a live site which requires some new views to be created, and with that some new content types and blocks. I'm working off my local dev site doing these changes there first and then I'd like to be able to export these views as a package with the content types and blocks that they handle. Is this possible?

Of course I could just export my local database and import it on the live site, but the problem is that the live site is very active so the database is always changing. And my updates will take at least a week to do, so I can't keep up.

Any suggestions?


texts:
In drupal 6 , Term Node Count were the module which was developed to store number of nodes containing each taxonomy term in DB , but it is not developed for Drupal 7 . Now my question is : "Is there any module like Term Node Count in Drupal 7 ? if not what solution do you present for this problem "

Note : In a project with thousands of taxonomy term I want to know which terms are used most and on the fly calculation will become too time consuming.


texts: How can we use form directly without using drupal form handler

texts:
I want to post a html form into block as content and wanted to submit the form to a page.
where I will need to get the form values using $_POST and do some process on it.

How can i do that without using drupal_form(), drupal_form_submit() handlers.

Any way we can achieve it.

Thanks.


texts: Assign existing field to new content type programmatically

texts:
I'm developing a module that create a several new content types:

function create_new_content_type($type, $name){
    $t = get_t();

    $new_node = array(
        'type' => $type,
        'name' => $name,
        'base' => 'node_content',
        'custom' => TRUE,
        //'description' => 'This is an example node type with a few fields.',
    );
    $content_type = node_type_set_defaults($new_node);
    node_add_body_field($content_type);

    // Check if we create content type or update.
    $status = node_type_save($content_type);

    // Replacement rule for the messages.
    $t_args = array('%name' => $content_type->name);

    if ($status == SAVED_NEW) { // create case
        watchdog('node', 'Added content type %name.', $t_args, WATCHDOG_NOTICE, l($t('view'), 'admin/structure/types'));
        return true;
    }

    return false;
}

after that creates a new fields for that type (for example):

function createTextField($name, $label, $bundle, $required=FALSE){
    // Create the field base.
    $field = array(
        'field_name' => $name,
        'type' => 'text',
    );
    field_create_field($field);

    // Create the field instance on the bundle.
    $instance = array(
        'field_name' => $name,
        'entity_type' => 'node',
        'label' => $label,
        'bundle' => $bundle,
        // If you don't set the "required" property then the field wont be required by default.
        'required' => $required,
        'widget' => array(
            'type' => 'textfield',
        ),
    );
    field_create_instance($instance);

}

Lets assume I have already existed field with name field_my_custom how can I attach it to my new created content type? (if I understand right in the method above I only create new fields).


texts: How do you clear menu caches programmatically?

texts:
I am developing a custom module. In this module, I want to delete menu caches programmatically. For this, I have used

\Drupal::cache('menu')->invalidateAll(); // for clearing the menu cache
\Drupal::service('plugin.manager.menu.link')->rebuild(); // rebuild the menu

But somehow, menu cache seems not being cleared and still the old menu is being displayed. How can I force Drupal to have my updated menu being displayed?


texts:
I have created a form where customers select two fields for a transportation. From origin to destination. My list of geographical locations could be close to 5,000 records. What is the best way to keep this location in the database? Taxonomy or store as a list for selection on each field?

Any recommendation is more than welcome. I'd need to store something like this:

El Salvador SVCSC   Cara Sucia  Cara Sucia, SV  SVCSC|Cara Sucia, SV

El Salvador SVCNG   Chalatenango    Chalatenango, SV    SVCNG|Chalatenango, SV

An important point is that I need users to select this with autocomplete like any airline website does (Kayak, Hipmunk, etc).


texts:
I've created a function that have custom content type and all went well, but the problem is now I'm unable to overwrite the node view page:

Here are my functions:

function xxx_theme($existing, $type, $theme, $path) {
  return array(
    'xxx_print' => array(
      //'variables' => array('node' => NULL),
      'function' => 'theme_xxx_print',
    ),
  );
}

function theme_xxx_print($node) {
  return '
test
';
}


texts: Is there a way to suppress warnings on the D8 Status Report page?

texts:
On my D8 status report (admin/reports/status) I have warnings about an issue I might wish to ignore. Is there any way to suppress the warnings on that report page once I have seen them and made my decision?

If it matters, the warnings are about using a CDN instead of installing libraries locally with YAML Form, which produces a wall of ten yellow warning rows in my Status Report. If we decide to continue using the CDNs instead of installing, we'd like to not see those warnings taking over so much real estate on the Status Report page in the future.


texts:
What I want to do is remove the title of a specific content type from where it normally shows throughout the site and print it somewhere else in the template.

I have a custom node.tpl.php for the content type, lets call it node--custom-content-type.tpl.php and it sits within a little submodule I made for this content type and section on the website. Let's call that mycustom_subtheme. I have also created a custom page.tpl.php, page--custom-content-type.php.

I was able to successfully re-print the title later on in the template, thanks to Aram's explanation here, by putting <?php print $title; ?> after <?php print render($content); ?>. I'm looking to find a way to remove it from it's original section just for this content type; See screenshot below.

Things I've tried:

I tried the Exclude Node Title module, but as I feared, it actually renders the title null, which isn't suitable for my purpose of retaining the title but just moving it. For this reason, this post isn't what I need.
I tried hide($content['title']); and hide($title); just to see if that would work in node--custom-content-type.tpl.php.
I tried moving the $title data to something like $title2 and then replacing $title with "Custom Text" but am not sophisticated enough to pull that off.
I tried adding custom CSS to no avail (the title is H2 in my node template): body.node-type-custom-content-type h2.title, {display: none;}
And finally, I even tried all the suggestions here. At the very least, copying the page.tpl.php and removing the title should have worked.

Here is a pastebin of my codes: custom node template and custom page template

Does the original node.tpl.php inherit the title anyway if node--custom-content-type.tpl.php simply doesn't mention it?


texts:
I would like to be able to upload youtube videos to the new site I am currently building. I would like to have a page which will list ALL the youtube videos uploaded, and then on the homepage, I would like to have a single video selected from the list of already uploaded youtube videos (changeable).

I would like it to be as simple as possible. I was thinking of a YouTube Field module. Is this simple enough?

I was thinking of possibly using Views to list all the Youtube Videos... but how would I embed the one on the homepage?

Any feedback and advice would be appreciated.


texts: To pass the tid as an array value in callback funtion

texts:
Am using drupal 7 site,am using a callback function to get the nodes list tagged to the particular tid,  the process is if i gave the tid value 25 it must return the nodes list which are tagged to this tid.As far this it is working fine.I wish to give the tid as multiple values ie as an array value, the thing am expecting is , if I give 25,17,28 (these are tid values) the result must be the nodes tagged to these tid's .Below is my function

'actions' => array(
        'selectNodes' => array(
          'file' => array('type' => 'inc', 'module' => 'services', 'name' => 'resources/taxonomy_resource'),
          'help'   => t('Returns all nodes with provided taxonomy id.'),
          'access arguments' => array('access content'),
          'callback' => 'taxonomy_service_select_nodes',
          'args'     => array(
            array(
              'name'         => 'tid',
              'type'         => 'string',
              'description'  => t('The vocabulary ids to retrieve, separated by comma.'),
              'source'       => array('data' => 'tid'),
              'optional'     => FALSE,
            ),
            array(
              'name'         => 'pager',
              'type'         => 'int',
              'description'  => t('Whether the nodes are to be used with a pager (the case on most Drupal pages) or not (in an XML feed, for example).'),
              'source'       => array('data' => 'pager'),
              'optional'     => TRUE,
              'default value'=> TRUE,
            ),
            array(
              'name'         => 'limit',
              'type'         => 'int',
              'description'  => t('Maximum number of nodes to find.'),
              'source'       => array('data' => 'limit'),
              'optional'     => TRUE,
              'default value'=> FALSE,
            ),
            array(
              'name'         => 'order',
              'type'         => 'int',
              'description'  => t('The order clause for the query that retrieve the nodes.'),
              'source'       => array('data' => 'order'),
              'optional'     => TRUE,
              'default value'=> array('t.sticky' => 'DESC', 't.created' => 'DESC'),
            ),
          ),
        ),
      }

can anyone please tell me how can I pass this tid value as array to the callback function used here?


texts:
I have a node template file that requires a lot of logic. So much so that in order to make things easier I have created functions inside my custom node.tpl file. What is best practice for separating logic from the node.tpl?

Thanks!


texts: How do I remove product duplicates in a view?

texts:
In my view I have duplicate entities for my product list, this is different from Drupal 7 as you could use the distinct module.

How can I remove the duplicates from my commerce product views in Drupal 8?


texts: Add text fields between checkboxes on a node form

texts:
How do I add text fields between checkboxes in a List on a node edit form ?

Looks like this:

How do I do it with form_alter ? Or other methods?


texts: Webform module - Contact form will not send webform emails to users with the same domain, but will send to all other email accounts I set

texts:
I have a Drupal 6 site. Using the Webform module.

I have it set to send all submissions to the webform to my email address (me@gmail.com) and the clients email (tim@domain.com) - for some reason webform is not sending the email to tim@domain.com only to my email address.

I tried different variations of emails, using other email addresses associated with the clients domain i.e. sales@domain.com but none of them work. But when I use other gmail and yahoo emails, the results come through just fine.

Any ideas?


texts:
I tried using entityquery for comment by nid but its not working here is my code :

$query = new EntityFieldQuery();
    $query->entityCondition('entity_type', 'comment')
    ->entityCondition('entity_id', 257, '=')
    ->addMetaData('account', user_load(1));

and also I tried changing to nid but still its showing all the comments instead of by specific nid:

$query = new EntityFieldQuery();
    $query->entityCondition('entity_type', 'comment')
    ->entityCondition('nid', 257, '=')
    ->addMetaData('account', user_load(1));

can someone tell me I am doing anything wrong?

thank you


texts:
I've got a huge problem with my template preview. For all of my post (page, article and so on), I have not the good region in my page.

My theme is extended Classy.

If I go to see the page (not from the preview), I have the good page.
But if I want to see the preview of this page, I've got some missing region (I guess this is a region).

See my page--post-type.html.twig

        {% include '@theme/layout/header.html.twig' %}
    {% include '@theme/includes/page-head.html.twig' %}
    {% include '@theme/includes/page-breadcrumb.html.twig' %}
    {% include '@theme/includes/page-entry.html.twig' %}

 {{ some displayed data }}

{% include '@theme/layout/footer.html.twig' %}

My included files a working (for both preview and view), but the preview isn't in this page is guess.

The last included block is this for the preview :

  BEGIN OUTPUT from 'themes/theme/templates/block/block.html.twig'

And for some reason, after I have this :

  BEGIN OUTPUT from 'core/themes/classy/templates/content/node.html.twig'

if it helps, my .theme file :

    /**
 * Implements hook_theme_suggestions_page_alter().
 */
function theme_theme_suggestions_page_alter(&$suggestions, $variables) {
//    $node = \Drupal::routeMatch()->getParameter('node');
    if ($node = \Drupal::routeMatch()->getParameter('node_preview')){
        $node = \Drupal::routeMatch()->getParameter('node_preview');
//        if ($node instanceof \Drupal\node\NodeInterface) {
//            $suggestions[] = 'page__' . $node->bundle() . '_preview';
//            $suggestions[] = 'page__node_' . $node->bundle() . '_preview';
//        }

    } else {
        $node = \Drupal::routeMatch()->getParameter('node');
        if ($node instanceof \Drupal\node\NodeInterface) {
            $suggestions[] = 'page__' . $node->bundle();
            $suggestions[] = 'page__node_' . $node->bundle();
        }
    }

//    dump($suggestions);

}

And I have also this function alstef_preprocess_node() which I took from this : Place block region in node template

I've been stuck for hours, any help you be appreciated.

PS : I'm working on drupal 8 with a custom Theme (here called 'theme').

EDIT : I've just made a dump of my node, and the node is null is i'm on my page--post-type.html.twig or page--post-type-preview.html.twig with the preview (change thanks to suggestions)


texts: How to use select option values in another select option value?

texts:
I am using a webform module, where I have a select field with two values

  A|Animals
  B|Birds

I am going to use another select field with some values like this

  A|Elephant
  B|Tiger
  C|Lion
  D|Eagle
  E|Parrot
  F|Sparrow

Now I want first three options belongs to Animal category and next three belongs to Bird category (these two are another select option values). How can I select option values belongs to another select option value in webform?

Note:
1. The first select field with two values(Animals and Birds) will be hidden from user. Users will not see this select field. This is visible only to admin. This I will take care in css.
2.  I do not want to use <Group Name> since I want to put the select option values in another select option value.


texts:
I have a view in Drupal 7. I have too languages, english and finnish (the default language).
I want to translate the label (Puh) of a field in the view. When I search for the string with the translation interface it looks like in the picture.

The problem:
Puh (is a finnish translation) and seems to be in the wrong textbox.
There is no place to give the english translation.

Any hints?
Here are the Internationalization modules I have enabled:
Multilingual - Internationalization  Block languages (i18n_block)                          7.x-1.7
 Multilingual - Internationalization  Field translation (i18n_field)                        7.x-1.7
 Multilingual - Internationalization  Internationalization (i18n)                           7.x-1.7
 Multilingual - Internationalization  Menu translation (i18n_menu)                          7.x-1.7
 Multilingual - Internationalization  Multilingual content (i18n_node)                      7.x-1.7
 Multilingual - Internationalization  Multilingual select (i18n_select)                     7.x-1.7
 Multilingual - Internationalization  Path translation (i18n_path)                          7.x-1.7
 Multilingual - Internationalization  String translation (i18n_string)                      7.x-1.7
 Multilingual - Internationalization  Synchronize translations (i18n_sync)                  7.x-1.7
 Multilingual - Internationalization  Translation sets (i18n_translation)                   7.x-1.7
 Multilingual - Internationalization  Variable translation (i18n_variable)                  7.x-1.7


texts: $drupal_hash_salt is empty in my installations

texts:
This is the code in settings.php

$drupal_hash_salt = '';

From what I know it should be a random string and I shouldn't change it at all and it has a direct effect on the website security. But why this variable is empty? Is there any problem and what should I do to assign a string to this variable?


texts:
I made a panel for showcasing individual nodes. That panel has a left column that contains a view with a list of all nodes (think teasers), and a right column with the node content.

In the view which generates the list of nodes in the left column,
how can I highlight the current node?


texts:
The ultimate goal here is to take a somewhat large (about 15,000 nodes) and complex (many contrib and custom modules) site from Pressflow 6 to Drupal 7, so I am assuming I should make the shift to Drupal 6, then upgrade to Drupal 7. Is that the safest path? Is there a better way? And if this is the best way, I was curious about the strategy or things to think about when making the move from Pressflow 6 to Drupal 6.

I have seen a lot of things about going from Drupal to Pressflow but not so many going in the opposite direction. I did find this question: is there a safe way to convert a pressflow website to drupal 6?

But like everything I found about moving from Drupal to Pressflow, people just say it is a drop-in solution, but what does that actually mean? I have done a diff between base Drupal 6 and Pressflow 6 and I can see the differences. But if I do a diff on base Drupal 6 and our Pressflow 6 site there are a lot more differences and it doesn't appear that just dropping in the Drupal 6 core and overwriting what is there will turn out well (though I will have to try this as an experiment to confirm).

In short, I am looking for a more in-depth answer to how to migrate from Pressflow 6 to Drupal 6, other than just saying it is a drop-in replacement. For example, what files/dirs definitely have to be replaced, which files/dirs should you definitely not replace, what if any changes are required to the DB (my impression is that there are none), etc?

Thanks!


texts: How do I make changes to the user registration function?

texts:
Just to clarify: I don't mean customizing the registration page. I've already managed to customize it to display what I want. What I'd like to know is if it's possible to make any changes to the function that inserts the info to the database after the user submits the form. The site I'm working on has a phpbb3 forum and I'm looking for a way to get a user registered in both after registering in the main site. I'm aware of the phpBB SSO module but that handles signing in, not registration. Also, I haven't been able to get phpBB SSO to work, either. Thanks.

I'm using phpBB3 instead of Drupal's Forum module because this is a migration from an already existing site that used phpbb. The client wants it this way and getting everything to look and function like their original site would take too long.


texts: How to track and report which data is used or accessed the most for a site on an internal network?

texts:
I have a Drupal site set up on Solaris 10.

I made custom PHP file to allow users to pass parameters in URL to retrieve feedback in xml format, and a couple of views to display data in table format.

Is there a way to track which data is used or accessed the most and display it in a report? So I can get rid of the data less frequent used.

Note: The site I built is for internal network, so the outside world doesn't have access to it (and therefor I cannot use Google Analytics).


texts: Editing the post time displayed for comments in Drupal 7

texts:
I need to display the post time of comments for a particular content type. I want these post times of comments to be in the "time ago" format.

Example: 1 minute ago

How can I do this in Drupal 7?


texts: How do I limit use of Simple XML Sitemap to certain roles?

texts:
For my Page content type, I want nodes created by administrators to be in my Simple XML Sitemap, but I want to exclude nodes created by non-admin users.
Administrators have permission to administer Simple XML Sitemap, and regular users do not.
On the Page content type settings, I have checked the box to index nodes of type Page by default.  (You must enable indexing by default in order to get the Simple XML Sitemap settings widget on the node edit screen.)
I tried to change the settings in hook_form_alter(), but it doesn't work because non-admin users do not ever see the Simple Sitemap widget (it is not attached to the form if the user does not have admin permission for Simple XML Sitemap).
So I'm stuck:

I have to enable indexing by default on the node edit page to get the widget to appear.
Non-admin users do not have access to the widget, so I cannot change the value for non-admin users with hook_form_alter() (I have to accept the default).

How do I resolve this paradox?


texts: using hook_update to add a new cck field

texts:
I am using d6.

I have a live site with an already built content type. I needed an extra column in the table, so I added this on install... I know realize how limiting this is and have rebuilt the content type to include this column as a field and I have unset the field in the form.

I have updated the code for this content type to include the new field, but when I move the code to my dev site, I do not see the new field.

Note: The content type was exported to code using the features module.

I thought maybe I need to run hook_update, but I haven't worked out how to do this.

This is what I have so far.

function mymoduel_update_6004(){
  #REF: http://drupal.org/node/1031548
  drupal_load('module', 'content');
  drupal_load('module', 'mymodule');
  content_notify('install', 'mymodule');
  content_notify('enable', 'mymodule');
  return array();
}

I run update.php... but no visible changes :(

Has anyone got any ideas how I can update my cck content types?


texts:
I'm trying to do a redirect after hitting the submit button in a Drupal 8 reset password form.

I use the theme_form_alter hook and a function as a new submit actions. The problem is, that the redirect works but no email is send.
If I uncomment the line for the new submit hook the mail is send but of course there is no redirect.

function theme_form_alter(&$form, &$form_state, $form_id) {
  if($form['#form_id'] == 'user_pass') {
    $form['actions']['submit']['#submit'][] = 'user_pass_redirect';
  }
}

function user_pass_redirect(&$form, $form_state) {
  $url = \Drupal\Core\Url::fromRoute('entity.node.canonical', [
    'node' => '87',
  ]);

 $form_state->setRedirectUrl($url);
}

I'm doing exactly the same thing for the contact_message_personal_form form and it works.

So, I have no idea why that happens for the contact_message_personal_form and the user_pass has isn't working.

Thanks for your help


texts: How can I render plain text as HTML in a template?

texts:
I've run into a wall trying to render a SVG image markup code into html from a plain text field.
I'm looking to render the SVG code from a plain text field without overriding the plain text field rendering everywhere else.
plain text format currently converts all HTML tags and <> to &lt; &gt;.
I created a field template and tried both outputting the field content as
{{ item.content.context.value }}

and
{{ item.content|raw }}

both render the value as string wrapping every line with "quotation marks" and converting line-breaks into <br/> tags.
I previously had the field type formatted text, but that also wrapped everything in <pre> tags, even when all tags were allowed. I'd really like to get it working with plain text.
Example of the svg-code the field has to hold in text form:
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
         viewBox="0 0 290 290" enable-background="new 0 0 290 290" xml:space="preserve">
    <g>
        <path fill="none" stroke="#78C681" stroke-width="3" stroke-miterlimit="10" d="M261.1,273.1H28.9c-6.6,0-12-5.4-12-12V28.9
            c0-6.6,5.4-12,12-12h232.1c6.6,0,12,5.4,12,12v232.1C273.1,267.7,267.7,273.1,261.1,273.1z"/>
        <circle fill="none" stroke="#1B435D" stroke-width="2" stroke-miterlimit="10" cx="145.2" cy="166.9" r="62.7"/>
        <line fill="none" stroke="#78C681" stroke-width="3" stroke-miterlimit="10" x1="16.9" y1="60.8" x2="273.1" y2="60.8"/>
        <circle fill="none" stroke="#1B435D" stroke-width="2" stroke-miterlimit="10" cx="178.3" cy="152.3" r="6.8"/>
        <path fill="none" stroke="#1B435D" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" d="M115.1,167.9
            c8.8,0,22.3,3.2,28.4,4.7"/>
        <path fill="none" stroke="#1B435D" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" d="M151.9,216.9
            c0,0,17.2-1.5,29.6-14.8"/>
    </g>
</svg>


texts:
I am trying to modify view query, basically I build my custom query and assigned it to:

$view->build_info['query'] = $query;
$view->build_info['count_query'] = $query;

everything has been done in hook_views_pre_execute. I tried to do the same in hook_views_query_alter but I wasn't able to construct more complex where clause.

Everything works fine apart from a pager. I noticed that I get pager but main query is not modified with LIMIT option so when I click on particular number of pager my result has not being updated. Below is a query which I need:

SELECT DISTINCT
  dat.field_date_and_time_value AS field_date_and_time_value,
  n.created AS created,
  n.nid AS nid FROM node n
LEFT OUTER JOIN og_membership pb
ON n.nid = pb.etid
AND pb.entity_type = :entity_type
LEFT OUTER JOIN field_data_field_date_and_time dat
ON n.nid = dat.entity_id
AND (dat.entity_type = :entity_type AND dat.deleted = :deleted)
LEFT OUTER JOIN field_data_field_og_public_to pt
ON n.nid = pt.entity_id
AND (pt.entity_type = :entity_type AND pt.deleted = :deleted) WHERE
(n.type = :db_condition_placeholder_0)
AND
(n.status = :db_condition_placeholder_1)
AND
(dat.field_date_and_time_value >= NOW())
AND
(
    (pb.gid = :db_condition_placeholder_2)
    OR
    (pt.field_og_public_to_target_id = :db_condition_placeholder_3)
    OR
    (
        (pt.field_og_public_to_target_id = :db_condition_placeholder_4)
        AND
        (pb.gid IS NULL )
    )
)
ORDER BY dat.field_date_and_time_value ASC, n.created DESC

I created it like that:

$query = db_select('node', 'n');
$query->distinct();
$query->fields('dat', array('field_date_and_time_value'));
$query->fields('n', array('created', 'nid'));
$query->leftJoin('og_membership', 'pb', 'n.nid = pb.etid AND pb.entity_type = :entity_type', array(':entity_type' => 'node'));
$query->leftJoin('field_data_field_date_and_time', 'dat', 'n.nid = dat.entity_id AND (dat.entity_type = :entity_type AND dat.deleted = :deleted)', array(':entity_type' => 'node', ':deleted' => '0'));
$query->leftJoin('field_data_field_og_public_to', 'pt', 'n.nid = pt.entity_id AND (pt.entity_type = :entity_type AND pt.deleted = :deleted)', array(':entity_type' => 'node', ':deleted' => '0'));

$query->condition('n.type', $view->argument['type']->argument);
$query->condition('n.status', $view->filter['status']->value);
$query->where('dat.field_date_and_time_value >= NOW()');
$subcondition = db_or()
->condition('pb.gid', $view->argument['gid']->argument)
->condition('pt.field_og_public_to_target_id', $view->argument['gid']->argument)
->condition(db_and()->condition('pt.field_og_public_to_target_id', $view->argument['gid']->argument)->isNull('pb.gid'));
$query->condition($subcondition);

$query->orderBy('dat.field_date_and_time_value', 'ASC');
$query->orderBy('n.created', 'DESC');

Any idea why pager doesn't work?


texts: How to make correct View for tasks for each user?

texts:
I have taxonomy vocabulary with departments. Different users have task's nodes.

I need View like this:

Department1   Task5_ForUser10
Department2
Department3
Department4   Task7_ForUser10
Department5

I've created View with taxonomy terms, Relationship with task's node and with Contextual filter "User ID from logged in user", but I see now only short variant:

Department1   Task5_ForUser10
Department4   Task7_ForUser10

How can I get View with full department list and tasks for each user?


texts: How do I create a link to the author's profile on the node that user created?

texts:
I want a create a link on each node page, which redirects to the profile page of the user who created that particular node.

How can I achieve this?


texts: I'm building a store using the commerce kickstart drupal distribution and I'm a beginner with it, however do possess some alternative Drupal 7 experience. Now, I need to add a different product variation type but when I try to add one, I and I want to add a Images field to it, the default Machine name assigned it field_images and when I try to store my variation with this field, I get the message The machine-readable name is already in use. It must be unique. - Fair enough you would think, but if I go and check in the existing sample variation types, there's multiple existing variation types that use the exact same machine name, *field_images* this is, why is that? It puzzles me why I should not be able to do the same for a new variation type.


texts: How to implement node access control with a simple field used during node creation?

texts:
I have multiple roles on the site. I have used Role reference field in Nodes to choose which Role should see Nodes. Then I have set Views to show content based on roles and Role reference field in Node.

Now I'm facing issue with Search. Search shows all content and users in different roles can see all the content.

I was looking for solution to set access per node, but Content access and Nodeaccess modules only allow access to be set after node is created. And in these case user need to set access to two fields: Role reference field AND Content access/Nodeaccess tab.
Not good. I do not want to create own content type for each role.

Is there a way to use Role reference field to set access control to node?

I did install both Content access and Nodeaccess modules and tried to use the Rules module to achieve this, but seems that neither of the modules support Rules.

Any help/tips appreciated.


texts: Anonymous view while developing without quit maintenance mode

texts:
I have a live website with 200 active users per hour, I put the site in maintenance mode for make some changes. You know the admin view is pretty different than the anonymous view of my website or other user roles views.

I need to know how to see how the anonymous and other roles will see my website after the changes I did "for see if everything is ok". I know you are going to answer "use local enviroment and then use backup and migrate" well I already use it but if preffer to ensure that everything is ok in the live site before take off the maintenance mode.

Thanks for your advice.


texts: How to know from which country people are accessing my website?

texts:
I am using Drupal7. I have a Chinese version of my site and I want to know whether they are using it or not. So I want to know which countries are using my website.

I tried to find that out like this -> if I go to the Reports>>Recent Hits then I find the hostname for the anonymous users.

I found some website that tells the country name taking the host IP address as input.

Is there any module that shows country from which the website got accessed?


texts:
I am building a drupal site using Views, search API module and user-points module.

I created the "database server", and indexed many fields of nodes.

I created a search page using views and the search API, that present content (image, title etc.)
In addition, I want to add to every content in this search view the name of the author that wrote it, his author picture.

I add the Indexed Content: Author relationship. Unfortunately, I can't find a way to add the author picture and the current total point to my view.

Can somebody advice how to do that?


texts: What's the difference between these multi-site setups in Drupal 6?

texts:
I am migrating several Drupal 6 sites to a new host. I recall the installer automatically set up my multi-site tables with just a few settings in the installer. I couldn't find these settings while I am making this migration and discovered description of multi-site configuration.

My original multi-site is of this type: Example one (this page explains a multi-site using $db_prefix property in a site's settings.php file).

During this file migration I found this type: Example two (this page explains manually crating a database table [database_name]_shared_tables).

As I said, my four sites were setup as with version one above. As I work to restore these sites from the mysql dump files, I'm wondering which process will be faster? My sites work like this,

+ default.domain (main drupal app)
|- sub1.domain (separate data)
|- sub2.domain (separate data)
|- sub3.domain (separate data)

Some of the information about multi-sites is outdated. This page suggests there are tables which can not be shared. Yet my settings.php file did not have a detailed list of shared tables, and instead had a simple prefix value, and leads me to believe the first example resolves what to share for you.


texts:
I'd like to use the Alfresco Cloud ECM with my Drupal instance. I created an alfresco site. I installed and activated the CMIS module. Here is my configuration script:

$conf['cmis_repositories'] = array(
    'default' => array(
      'label' => 'cmis.alfresco.com',
      'user' => 'my_alfreso_cloud_username@example.de',
      'password' => 'my_alfreso_cloud_password',
      'url' => 'https://cmis.alfresco.com/cmisatom'
    ),
  );

I only find these lines to configure the module. Then I added a CMIS field to my content type. When I add a new node then there is an error:

  Notice: Undefined index: cmis_field_rootFolderPath in cmis_field_field_widget_form() (line 123 of D:\Inetpub\SK1913\sites\all\modules\cmis\cmis_field\cmis_field.module).

I cannot find any other configuration forms (beside the root path setting).

What am I doing wrong? Does this module work with the alfreso cloud solution? I don't want to install alfreson on my server until I know how to use it, or even if I use it...


texts: How do I customize Drupal commerce checkout page?  I selected shipping information, billing information and payments in the checkout form builder. But the layout the fields are customized and was wondering how to change the layout of the fields like First name, last name etc...


texts:
PDOException: SQLSTATE[HY000]: General error: 1 Can't create/write to file '/tmp/#sql_e0f_0.MYI' (Errcode: 13): SELECT DISTINCT SUBSTRING_INDEX(source, '/', 1) AS path FROM {url_alias}; Array ( ) in drupal_path_alias_whitelist_rebuild() (line 380 of /var/www/html/includes/path.inc).

After noting report status for updating .htaccess in this tmp folder i found in root directory I then changed permissions to 755 and ownership apache:apache
also tried owner:apache Anyway, when tested and trying to delete content as admin it throws above error.

UPDATE: All of this occurred due to erroneous status report for drupal 7.24 saying needing to add security update to files and tmp folder .htaccess but it is a bogus bug and you need to delete them then run cron will recreate and status report disappears.

SEE http://www.ostraining.com/blog/drupal/drupal-724-tmp-directory/

problem solved


texts: How to iterate through Drupal.settings in a js file when there are lots of variables?

texts:
Am trying to create a health service locator using Google maps API on my Drupal 7 site. (FYI, I cant use location module or open layers, because, Create a hospital locator in drupal 7  )

OK, so now I have a form, which takes the users location, type of service (eg, hospital, pharmacy etc) and the proximity around which they wish to find the result, using Google Maps API and Google Places API I fetch the results (details about those near by places such as hospital) in JSON format from Google. The fetched data includes each place's name, address, rating, phone number, latitude, longitude etc. now I store those values in form_state['storage'] and then sends it to the JS file using the drupal_add_js() method.

The below code is sending the values,

<?php
for($i=0;$i<$length;$i++)
 {
  drupal_add_js(array('a'.$i =>array(
             'lat'=> $form_state['storage']['results'][$i]['geometry']['location']['lat'],
             'long'=> $form_state['storage']['results'][$i]['geometry']['location']['long'],
         'name'=>  $form_state['storage']['results'][$i]['name'],
         'rating'=>$form_state['storage']['results'][$i]['rating'],
         'vicinity'=>$form_state['storage']['results'][$i]['vicinity'],
         'formatted_address'=>$form_state['storage']['results'][$i]['formatted_address'],
         'international_phone_number'=>$form_state['storage']['results'][$i]['international_phone_number'],
         'website'=>$form_state['storage']['results'][$i]['website'],
)),'setting');

}
?>.

the details of first place is in a0, second place detail is in a1 etc.

FYI, each place details are in Drupal.settings.a0, Drupal.settings.a1  etc.
 I mean, I can access those variables in js file using,

Drupal.settings.a0.name and Drupal.settings.a0.website
similarly for second place, Drupal.settings.a1.name etc.

Now my problem is I need to iterate through these different places.

I can iterate through different variables of one particular place usin the below for loop,

for(var x in Drupal.settings.a0)
{
 alert(Drupal.settings.a0.x);
}

But, I cant iterate through different places, like a0, a1 etc.
I mean I cant attach a variable to drupal.settings..!

I tried tried putting all places in an array, i.e, a0,a1,a2 are in an array named arr[] (I have the total no. of places in Drupal.settings.my_vars.length) then, I iterate through this array and tried attaching arr[i] to Drupal.settings as Drupal.settings.arr[i].x but it doesn't work.

How can I do it...?? Is there any better way of achieving it...??

Thanks in advance.


texts: Changing a field settings on a live site in Drupal7

texts:
In the middle of entering content I discovered the length of 15 characters of a particular field I set earlier is not enough.

In Drupal6 I could change the settings of a cck field. It could be potentially dangerous, but in my case it's a lossless transform, I just want to make a maximum size of a field a little longer.

But in Drupal7 I get the message saying it's impossible to change the field settings because there is some content stored in that field in database.

This restriction seems too strict to me. A warning message seems to be enough.

So my question is what's the reasons for this behavior and what can be done in my case? Manual deleting and recreating the content is not the option.


texts: Difference between Content: Updated date and Content revision: Updated date in Views

texts: In views Filter criteria, What is the difference between Content: Updated date and Content revision: Updated date?


texts: How to make an custom content entity can be refered like user in Drupal 8?

texts: Follow project examples, I have created a content entity, but how can make it can be attached into another entity as a reference field like user in drupal 8?


texts:
I have created two profile types using profile2 module. Next added two fields to each of the profile types. Here one field of each profile type is set as REQUIRED. But when i select one field set and submit the form then the validation for other profile type is blocking me to submit the form.

Please help me to get the solution.


texts: Nested Image/Video Galleries in Drupal 7

texts:
Alright so after looking around for awhile and not finding exactly what I am looking for hopefully someone can help me out with this.

On my website I plan on having both image galleries and video galleries.
I can configure a views gallery or using Media Gallery which works wonders except for what I want to do(media gallery that is).

My videos (or even images if this is possible) section I would like to have nested galleries potentially up to 3 tiers at a time. I am assuming I can do this taxonomy but I don't want to add a new term every time a new 'series' comes out, as I don't necessarily know the name of said series before it comes out.

I would like my gallery to flow as such:

Galleries Overview

Gallery A

Gallery A1

Nested Gallery A11
Nested Gallery A12
Nested Gallery A13

Gallery A2

Nested Gallery A21
Nested Gallery A22
Nested Gallery A23

Gallery A3

Gallery A31
Gallery A32
Gallery A33

Gallery B

Gallery B1
Gallery B2
Gallery B3

Gallery C

Gallery C1
Gallery C2
Gallery C3

I am probably over thinking this and there must be an easier way to do this because I have read posts of sites with nested galleries I just cant seem to figure it out.

Final option would be to downgrade to Drupal 6. If it is truly easier this way, it is not that big of a deal, (no real content on my site yet). I know nested galleries are done on D6, and a few years back I had a D6 website with Nested Galleries which is why I am surprised this is an issue now.


texts: Drupal 7 custom submit handler not getting triggered

texts:
I am having a problem connecting a custom submit handler to a form. I am trying to switch off redirecting after the save of an eck entity on edit form. But i am not getting that far as my submit handler is not getting called.

The first debug log is as you would expect original handler and my custom one returned (so the alter part seems fine), but my on submit debug is never displayed on submission. I have switched the same code to the user_profile_form and it works fine, both debug logs coming through as expected. Why would this form be different??

Code:

function mymodule_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'eck__entity__form_edit_myentity') {
    $form['#submit'][] = 'mymodule_eck_ent_submit';
    dd($form['#submit']);
  }
}
function mymodule_eck_ent_submit($form, &$form_state)
{
    dd("smashed in !!");
}

Many Thanks
Mathew


texts: how to store images into file_managed table from android to drupal

texts:
I have tried calling Drupal file service from android and it is storing images in application/octet format and not in image/jpeg format in file_managed table.

$data['file'] ='encodedimage';
$fid = file_save_data($data);

So I thought I will call file_save_data($data) to store images where I pass the image as encoded string. But it is still storing in application/octet format and not in image/jpeg.

Can somebody help me to store as image/jpeg format into file_managed table?