texts:
I'm trying to do something like this with Drupal 7.

I need to generate either an XML file or a number of xml files based on the sub-parts of the over-all "Navigation" menu.

I have multiple "Portals", each with a list of pages... I need to generate an XML file for each portal, and be able to customize the hell out of it.

I've been trying Views... with XML Sitemap, feeds, etc... I just can't seem to get anything workable.


texts: How do I (in general) track down what happens on form submit?

texts: I am working on a site that uses the Chosen module. There is a field that I need to edit programatically. When I use the actual field edit interface, Chosen adds an option called "Apply Chosen to the select fields in this widget?" When I set that value and submit the form, all is well... it changes what I need changed. However, I need to be able to track down what this is actually doing on the back end so I can change the value of this option for this field programatically... once... in an update hook. The user needs to still be able to edit this value using the form... I just want to flip its value this one time. I don't know where to start looking. In the Chosen module, I can see where it adds the option to the form, but I don't know what piece of data that option is stored with, nor how to see what the form is doing when it saves it so I can duplicate that functionality. It's hard to even know the right terminology to ask this question.


texts: Create link to views page that preselects the filters of an entire vocabulary?

texts:
I have a view that filters by different taxonomy terms, using multiple vocabularies. Im using the better exposed filter module.

I need different links to this view page which make different options pre-selected. By copying the url from when 1 term is selected I can easily make a link which works in this way:

my-site/resources?tid%5B%5D=22&keys=

I also need to make a link where all the terms from a vocabulary are selected. The client for this website will be able to add new terms to this vocabulary. If I simply copy the url with all the terms selected then this wont select a new term when its created.

How can I create a link to the view page which preselects all the terms from a vocbulary, that will still select all the terms when new ones are created?


texts:
I've attached file to a node with Media module. I have custom templates/file/file-link.html.twig file, which is rendering the download link with {{ link }} tag.

{{ devel_dump(link) }} outputs this:

I need to print File name as pure text without any link rendering for some cases.

I've tried {{ link.text }}, {{ link.text.string }} and other options, but none of them gave me what I wanted.


texts:
I'm working on a process to prompt users to a login when clicked on a link first. For instance, if click on http://www.example.com/tester, the user will be prompted to log in. After loggin in, the user will be redirected to the current page http://www.example.com/tester.

I've tried LoginToboggan as well as Login Destination.

Login Destination should allow for "current" but it doesn't work.

Both of the modules have similar ways to do it i'm sure.


texts: Drupal Content Admins for specific Language

texts: For a new Project with Drupal 7 we have 4 different languages: IT, AT, EN, SP and for each language an Content Admin. We need a solution that the Content Admin see only Nodes of his language for editing. Is there a module or how to implement it?


texts: What is the difference between template_preprocess_search_result() and template_preprocess_search_results()?

texts:
I am seeing 2 functions like template_preprocess_search_result() and template_preprocess_search_results() in Drupal 7. I just got confused on which function I should use when modifying my search results.

Can anyone tell me what the basic difference between these 2 functions is?


texts: How to get Block Plugin Id? when block created using block type entity?

texts:
I have created the Block type entity using Drupal 8 UI. Now I have to Place that block entity programatically in theme region. The related question discussed.
Here

As solution given by @Shawn Conn is fine when we define our own block plugin class. As in my case I don't. I created Block type using UI


texts: sort users in view by amount of nodes created in drupal 6

texts:
Here at Drupal Answers I found how to do it in drupal 7 though but obviously I need it for a D6 site.

So far I haven't found any filter in my view settings that will allow to do this, nor ar relationship that similar as D7 in D6.

UPDATE: Looked a bit more into the question about the drupal 7 version of this issue. Seems like that question is only about mentioning the amount of nodes created in the view, not using that amount as a sort criterium. Looks like we're still at square one....


texts: Add multiple user-roles in install profile

texts:
I would like to create multiple roles with the same permissions in my install profile. To add one user in your install profile, it's quite simple. I use this snippet:

    // Make the new role
    $role = new stdClass;
    $role->name = 'User 1';
    $role->weight = 3;
    user_role_save($role);

    // Permissions to assign to the role.
    $perms = array(
    'access content',
    'access content overview',
    );

    // Grant the permissions. This function takes care of all necessary cache resets
    user_role_grant_permissions($role->rid, $perms);

I tried with an array, but it didn't work out. Drupal just ignored the array.

The Array didn't work out...:

    // Make the new role
    $role = new stdClass;
    $roles = array('Eindredacteur 1', 'Eindredacteur 2');
    $role->name = $roles;
    $role->weight = 3;
    user_role_save($role);

    // Permissions to assign to the role.
    $perms = array(
    'access content',
    );

    // Grant the permissions. This function takes care of all necessary cache resets
    user_role_grant_permissions($role->rid, $perms);

Anyone who can give me some advice?


texts: I am working on a website developed by a previous developer so I am studying how I can edit the style without source code or any extension... is there any possibility to do it?


texts: just want to change checkbox value while submit

texts:
I am using drupal 7:

$form['title']['#tree'] = TRUE;
$form['title']['node_first'] = array(
    '#type' => 'checkboxes',
    '#options' => array(
        'value' => $value->title,
    ),
);
$form['title']['node_second'] = array(
    '#type' => 'checkboxes',
    '#options' => array(
        'value' => $value2->title,
    ),
);

i am getting this output after submitting (when first checkbox has been checked) :

    Array
(
    [title] => Array
        (
            [node_first] => Array
                (
                    [value] => value
                )

            [node_second] => Array
                (
                    [value] => 0
                )

        )
)

desired output:

Array
(
    [title] => Array
        (
            [node_first] => Array
                (
                    [value] => True
                )

            [node_second] => Array
                (
                    [value] => False
                )

        )
)


texts: How to configure a server with 4g of memory to run drupal 7

texts:
I'm installing Drupal 7 on a new server with 4 GB of memory. I'd like to get some hints on how to configure it properly, how much memory to give to MySQL, and how much memory to give to PHP. One thing I found out is that running Drupal 7 on Zend server is three times faster than running it on a normal Apache server. (I think it has to do with opcode caching. I noticed with devel module it uses one-third of the memory.

Can you share your configurations with me?


texts: How to update locale after editing a .po file?

texts:
I edited a .po file in profiles/l10n_install/translations/ but after this the pages of the site are not updated.

How to update the site after editing a .po file?


texts: How to tokenize a value in a custom field formatter for views?

texts:
I am using an custom field formatter for a view field like this:

function custom_fields_field_formatter_info() {

  return array(
    // the key must be unique, so it's best to prefix with your module's name.
    'custom_fields_breadcrumbs' => array(
      'label' => t('Breadcrumbs'),
      'field types' => array('entityreference'),
    ),
  );
}

/**
* Implements hook_field_formatter_settings_form().
*/
function custom_fields_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {

  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
   if ($display['type'] == 'custom_fields_breadcrumbs') {
    $form = array();
       $form['active'] = array(
      '#type' => 'textfield',
      '#title' => t('Mark as active'),
      '#description' => t('You can specify a node id, which should have class "active". Yo can use replacement tokens.'),
      '#default_value' => $settings['active'],
      '#size' => 4,
      '#maxlength' => 128,
      '#required' => FALSE,
    );
  }
    return $form;
}
function custom_fields_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {

  $element = array();
  $settings = $display['settings'];

  switch ($display['type']) {
     case 'custom_fields_breadcrumbs':
      $ids = array();
      foreach ($items as $item) {
        $ids[$item['target_id']] = $item['target_id'];
      }
      $items = array();
      // http://api.drupal.org/api/drupal/modules!node!node.module/function/node_load_multiple/7
      $items = node_load_multiple($ids, array(), FALSE);
      foreach ($items as $delta => $item) {
        $label = $item->title;
        // modeled after entityreference_field_formatter_view() in entityreference.module
        if ($display['settings']['link'] && ($uri = node_uri($item))) {
          $otpions = array();
          if (isset($settings['active']) && $delta == $settings['active']) {
            $otpions = array('attributes' => array('class' => array('active')) );
          }
          $element[$delta] = array('#markup' => l($label, $uri['path'], $otpions));
        }
        else {
          $element[$delta] = array('#markup' => check_plain($label));
        }
      }
      break;
  }
  return $element;
}

Everything works as expected, but I want to be able to use replacement patterns for my custom setting $settings['active']. How do I do this?

I think, I have to use the method:

tokenize_value()

from the views object. But I don't have the views object within the hook, haven't I?


texts: Views Slideshow Output different in IE vs Firefox/Chrome/Safari

texts:
A site I'm working on is using Views and the Views Slideshow plugin to generate a tabbed panel on the site. We modified the output of the plugin to display link names instead of IDs, which worked great. The view set the link back to the node.

We modified the view itself to instead use a link that the user specifies on the node instead of linking back directly to the node itself. Cleared the cache and FF works fine. When I test in IE, it doesn't link anywhere (the anchor's href is actually empty).

I've got all the caching on Drupal turned off, deleted the cache in IE, rebooted... the module itself seems to be outputting different HTML based upon the browser. Any ideas on where to start looking? I'm digging through the module itself right now but I'm not seeing anything that stands out.

Update

What ended up happening was a module (not the one I was working on) was detecting IE and including javascript that was for IE only. This extra javascript ran before mine and mangled some of the tags I needed to work with.


texts: How to generate iframe from Drupal 7 view (custom blog) with security token?

texts:
I have a Drupal 7 site with a custom blog created with custom content types and a combination of views. I need to be able to export this blog as an iframe with a "long security token" to be used on a Salesforce site. I have read about several modules that can generate iframes, but I'm not sure how to go about the security side of things. Any suggestions? I've looked into the Entity Iframe project, and this seems to do what I want for individual nodes, but I'm not sure how to do this for the whole view/page.

A more involved alternative can be found here Drupal Iframe Widgets but this doesn't deal with the security side of things.

So, my questions remains: what's the best/easiest way to export a view to another site with a security token?


texts: How to create a user object of a custom form and add a user in drupal 7?

texts:
i am new to drupal ,basically wanted to create a user object for my custom form and add a user.

This is my custom form

function registerme_newform($form, &$form_state)
{
$form = array();
$form['account details'] = array(
    '#type' => 'fieldset',
    '#title' => t('Account Details'),
    '#description' => t('Enter Personal Credentials'),
    );
$form['account details']['first name'] = array(
    '#type' => 'textfield',
    '#title' => t('First Name'),
    '#default_value' => t('Be sure of your first name'),
    '#attributes' => array(
    'onblur' => "if (this.value == '') {this.value = 'Be sure of your first name'}",
    'onfocus' => "if (this.value == 'Be sure of your first name') {this.value = ''}"
      , ),
       );
     $form['account details']['last name'] = array(
    '#type' => 'textfield',
    '#title' => t('Last Name'),
    '#default_value' => t('Be sure of your last name'),
    '#attributes' => array(
    'onblur' => "if (this.value == '') {this.value = 'Be sure of your last name'}",
    'onfocus' => "if (this.value == 'Be sure of your last name') {this.value = ''}"
       , ), );

     $form['account details']['email'] = array(
    '#type' => 'textfield',
    '#title' => t('E-Mail'),
    '#required' => TRUE,
    '#default_value' => t('Email acts as username.Dont forget it!'),
    '#attributes' => array(
    'onblur' => "if (this.value == '') {this.value = 'Email acts as username.Dont forget
     it!'}",
    'onfocus' => "if (this.value == 'Email acts as username.Dont forget it!')
 {this.value = ''}"
       , ),
    );

    $form['account details']['password'] = array(
    '#type' => 'password',
    '#title' => t('Password'),
    '#maxlength' => 60,
    '#size' => 60,
    '#required' => TRUE,
    '#description' => t('Password should be atleast 6 characters long.'),
    );

$form['home'] = array(
    '#type' => 'fieldset',
    '#title' => 'Home Address',
    '#description' => t('Enter Personal Residential Credentials')
);

$form['home']['street'] = array(
    '#type' => 'textfield',
    '#title' => 'Street Address',
);

 $form['home']['city'] = array(
    '#type' => 'textfield',
    '#title' => 'City',
);

 $form['work'] = array(
    '#type' => 'fieldset',
    '#title' => 'Work Address',
     '#description' => t('Enter Official Address')
);

$form['work']['street'] = array(
    '#type' => 'textfield',
    '#title' => 'Street Address',
);

 $form['work']['city'] = array(
    '#type' => 'textfield',
    '#title' => 'City',
);

 $form['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Register Me'),
);

 return $form;

}

function registerme_newform_validate(&$form, &$form_state)
{
if($form_state['values']['account details']['first name']=='Be sure of your first name')
{
form_set_error('first name',t('Please enter your first name'));
}
}
function registerme_newform_submit(&$form, &$form_state)
{
dsm($form_state);
}

Is user_save method for creating an object? How to implement this please guide or suggest otherwise. Thanks


texts: Limit which roles can view a node basing on its content type

texts:
I'm using Drupal 7 and I created a new content type called "eBook," and I created a new role called "MonthlySubscriber." My intention is to allow only users with the "MonthlySubscriber" to view the "eBook" nodes. When I looked at the permission settings for a role, I saw the checkboxes that allows to create, edit and delete nodes of that content type, but there are no checkboxes for viewing nodes.

How do I limit the users who can view "eBook" nodes to just the users with the "MonthlySubscriber" role?


texts:
I have a problem after my successful migration from D6 to D7 where all inline images are not showing. Inline images are the images that are inserted in node body.

Modules being used:

Insert
Custom module

This is working fine in D6 but in D7 after saving new node the image is not showing. I have to clear the cache first or resave the node in order for the inline image to show.

Steps to replicate the problem:

Create a new node and save - No inline image showing.
Visit old nodes - No inline image showing.

My solutions so far.

drush cc all
Visit the old nodes then truncate cache_field table
Resave the node

Im wondering why the inline image is not showing in newly created node and for the nodes that are not visited yet.

Any thoughts?


texts: How to iterate through an object returned by fetchAll?

texts:
Since fetchAssoc was returning only one row, i was forced to use fetchAll.

The problem is fetchAll returns the data as an array of objects. Iterating through them is kind of painful, not impossible but seems like a long way to go for something that should be really simple.

fetchAllAssoc throws an error.

If somebody could show me a neater trick, that would be great.

    $result = db_select('raffles', 'r')
  ->fields('r')
  ->execute()
  ->fetchAll();

  dpm($result);


texts: Using hook_form_alter to set default values for multiple-value CCK fields

texts:
I was previously using the Default Value PHP field in the CCK Field Properties page to define multi-value default which was working fine. However the code is now getting so complex and I need to pass arguments to it that developing it within the CMS is becoming unfeasible, so I'd like to move the functionality out to a custom module.

I'm successfully using hook_form_alter to set defaults for single value CCK fields, so this isn't a problem. What I'm curious about is that when $form is passed to hook_form_alter, only the first element (0 or $form['field_myfield'][0]) exists, whilst I need to have from 0 to x default values.

Is the best practice simply to clone element 0 for as many default values as I need? Or is there another hook I should be using to set the initial number of empty fields before setting the defaults or something else I'm not thinking of?

Thanks :D


texts: How to auto generate barcodes for Entity Registration in Drupal 7

texts:
I read this article about using rules and a trigger to populate/create a barcode field from a serial field, tried toy follow it but the screens/ facilities of Drupal 6 seem different for v 7 and the documented steps cannot be replicated. In particular I expected barcodes to be part of the drop down for fields but it isn't

"basically you should add a new rule that fills for you the barcode when new content is created starting from the serial field. The steps are:

create a new rule
trigger it on the event: 'after new content is saved'
set some condition on the type of the content (optional)
use 'populate a field' (under CCK category) as action
choose your barcode CCK field
Use the token of your serial field : [node:field_YOUR_TOC_SERIAL_FIELD-id] -- I don't remember why I didn't use the token but the follow php code:

 array('barcode' => [node:field_MY_FIELD_NAME-id]));
?>
If you didn't use Rules before have a look here: http://dev.nodeone.se/node/646  "


texts: Archiving forums on time basis in drupal 7

texts:
I am using advance forum on drupal 7. I want to add following functionality to it:

Archiving:

I could define forum posts older than 6 months or so should be automatically be archived and visible only to admin.

Any module or pointers to achieve same highly appreciated.


texts: Why some functionality of my drupal site is different on different PCs?

texts:
I created a site but when I log in from another PC (exact same site), some things are different.
Like on my laptop, my ajax loader is working beautifully but it lags on my office computer.
There is a message on successful image update (from media module) on my PC but there is no message in my laptop (however that should be the case).

What's happening here? I'm lost.

UPDATE

I saw a JavaScript error on my PC which is very much different than the JS error on my laptop. They are the same file, same webroot and same website. Even after turning off my development environment, I am not going further.

UPDATE

Problem Solved, the origin of the issue was JQuery Conflict. After defining different reference variables, my problem is free. Although I still don't understand why this was not a problem in my machine. Is there a mechanism that I'm missing?


texts:
I created a custom field in the users profiles.

I need to display in node.tpl.php, this field for the author of the node.

I tried :

<?php
print $node_author = user_load($node->uid);
print ($node_author->field_custom);
?>

But i have an error :

Recoverable fatal error : Object of class stdClass could not be converted to string

Do you know where I'm wrong?
And, is it the best way of proceeding?


texts: My site only listens to the event after I clear all caches

texts:
I have a module with an event subscribe that I use to redirect to an age verification page if a cookie is not set, and as long as the current request is not the age verification uri.
if(!isset($_COOKIE['age_gate_ok']) && $request != '/age-verification')
{
    $welcome = new\Symfony\Component\HttpFoundation\RedirectResponse("/age-verification");
    $welcome->send();
}

Problem: the event seems to listen once only, and that is when I use drush to clear cache.
To further explain, I use clear site cache using drush and when I reload the page, it redirects me to the correct page(/age-verification) and then I pass the gate.
However, if I open the inspector to clear cookies and refresh the page, the site does not redirect me to the age verification url.
How do I have to clear cache in order to have the age verification working?


texts:
I just wanted to know if there is some way to make Drupal 7 re-build all the images for a specific style. The image style is created after the pictures were uploaded. The module using this image style will be color box.
Even though I update, delete, re-create the style, no images are generated in the according folder on the webspace.

Do you have any idea?


texts: Why drush is not maintained in drupal.org?

texts:
Drush project page says, "The Drush project has moved to Github."

I would like to know if there is any specific reason for moving to Github.


texts: How do I localize menu items added to the Main menu by a views page?

texts:
I have a multilingual site setup where the pages in the Main menu are all created by Views. Main Menu is configured to 'Translate and Localize.'

When clicking 'edit' for a menu item the 'Translate' tab does not appear in the top right hand corner when the Language selection box is set to Language Neutral.

(This, however, does appear when I change the language selection in the drop down box to something specific; however, I want to Localize, not create a translation set.)

I know I have done this before. What am I missing? Note I am using node translation (content translation) and not entity translation.


texts:
Is there a Drupal 8 way to do non-blocking HTTP client request using Guzzle?
I don't need to wait for the answer of The HTTP post, as that is slowing  down the site.
I already seen Non-blocking asynchronous HTTP requests, but I want to know if someone have a Drupalier solution.


texts: $form_state['values'] for table select returning empty arrays

texts:
I have my two table-select as -

    $form['mltag_new']['tag'] = array(
    '#type' => 'button',
    '#value' => t("Suggest Tags"),
    '#ajax' => array(
        'callback' => 'mltag_suggest_tags_ajax',
        'wrapper' => 'mltag_suggest_tags_table_div',
        'effect' => 'slide',
        ),
     );

    $form['mltag_new']['myselector'] = array(
        '#prefix' => '
',
        '#suffix' => '
',
    );

    $form['mltag_new']['myselector']['implicit_tags'] = array(
        '#type' => 'tableselect',
        '#title' => 'My Selector',
        '#header' => $header,
        '#attribute' => array('style' => 'display:none;'),
    );

    $header_learn_tags = array(
        'sno ' => t('S. No.'),
        'tags' => t('Tags'),
    );

    $form['mltag_new']['myselector']['learn_tags'] = array(
        '#type' => 'tableselect',
        '#title' => 'Tags from Learning',
        '#header' => $header_learn_tags,
        '#attribute' => array('style' => 'display:none;'),
    );
$form['#submit'][] = 'mltag_custom_submit_function';

The values- $options are being set by an ajax callback activated on the press of a button. But when I am trying to capture the values checked by the user in the table in my mltag_custom_submit_function it returns an empty array. The code I am using is-

    $selected_uids = $form_state['values']['mltag_new']['myselector']['implicit_tags'];
    drupal_set_message(print_r($form_state['values'], TRUE));

How can I capture the values selected by the user in the table correctly ?

Edit -

definition for $form['mltag_new']

$form['mltag_new'] = array(
      '#type' => 'fieldset',
      '#title' => t('MLTag settings'),
      '#collapsible' => TRUE,
      '#collapsed' => FALSE,
      '#group' => 'additional_settings',
      '#tree' => TRUE,
      '#weight' => -2,
      '#attributes' => array('class' => array('mltag-settings')),
    );

also a short snippet of my ajax function is this-

function mltag_suggest_tags_ajax($form, &$form_state) {

      $output = '';
      $tags = some_function_call();
      $algo = variable_get('algo_type');
        if ($algo == 1) {
          $header = array(
              'tag' => t('Tag'),
              'frequency' => t('Frequency'),
              );

          $options = array();
          foreach ($tags as $key => $value) {
            $options[$key] = array(
                'tag' => $key,
                'frequency' => $value,
                );
    }
    }

      //returning values for tableselect
      $form['mltag_new']['myselector']['implicit_tags']['#header'] = $header;
      $form['mltag_new']['myselector']['implicit_tags']['#options'] = $options;
      $form['mltag_new']['myselector']['implicit_tags'] = form_process_tableselect($form['mltag_new']['myselector']['implicit_tags']);

      $form['mltag_new']['myselector']['learn_tags']['#header'] = $header_learn_tags;
      $form['mltag_new']['myselector']['learn_tags']['#options'] = $options_learn;
      $form['mltag_new']['myselector']['learn_tags'] = form_process_tableselect($form['mltag_new']['myselector']['learn_tags']);
     return $form['mltag_new']['myselector'];
    }


texts: _form_comment_form_alter for certain node type

texts:
When using the hook_form_comment_form_alter, how do I only target the comment form of a single content type?

Right now it is targeting all comment forms, and I need it to just target the 'Blog' content type comment forms


texts: Views image field linked with nofollow attribute

texts:
I have a view that renders a list of articles. Each article has a title, a main image and a trimmed part of its body.

I have both the title and the image are linked to the content i.e the article's details. This is not good practice for SEO. I want to add the attribute rel="nofollow" to the links to the content of the image field.

I have tried to search for a module that may do this task but I could not find any.

Also, I have tried to use REWRITE RESULTS like the following:

[field_image]

However, it rendered wrong content because [view_node] tokens gives Read More html hyperlink.

By this way, to keep SEO, I have only to remove linking from image and this is not a suitable choice.

Is there any suggestion for modules do that or any way to rewrite the image field to be linked?

The following screen shot may offer extra visual details about my issue:


texts: Performance implications of many user roles

texts:
How does each additional user role affect Drupal performance? Looking for insights from benchmarking (preferred) and/or code analysis.

Specifically:

Do additional user roles impact performance on a per page request
basis? (e.g. every page view will be slower for every user, or no?)
Is the performance impact of additional roles proportional to the number of modules installed? (eg performance hit proportional to
#roles * #modules, or no?)


texts: How can I use Rules to publish nodes depending on changing the value in a Field?

texts:
I would like to set up rule to detect if I change one specific field in the content type.  For example if I choose the field "dyzury", then the rule will publish this node to the front page with the new value in the field.

How can I achieve this?


texts:
I have a content type with a taxonomy tag and some fields.

i use these content type in a view which groups the nodes by its tag and print out some fields.

now i want these tags in a specific order, which should be easily changed, e.g. by draggableviews and i also need the content under these tags in a specific order.
so i need a draggableview inside a draggableview... (yo dawg)
somehow...

is it somehow even possible to sort these tags and then sort the content in the tags?


texts:
Given:

I am using Drupal 8.
I have a custom "add form" of the custom entity type.
Form has an ajax submission.

Problem:

When I submit form all the values remain in fields.

Expected:

Form fields should be cleared after submission.

Form source code:

<?php

namespace Drupal\mymodule\Form;

use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Form\FormStateInterface;

/**
 * Form controller for the add/edit entity forms.
 */
class MymoduleForm extends ContentEntityForm {

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $form = parent::buildForm($form, $form_state);

    $form['#prefix'] = "
getFormId()}-wrapper\">";
    $form['#suffix'] = '
';

    $form['actions']['submit']['#ajax'] = [
      'wrapper' => $this->getFormId() . '-wrapper',
      'callback' => array($this, 'ajaxRebuildCallback'),
      'effect' => 'fade',
    ];

    return $form;
  }

  /**
   * Callback for ajax form submission.
   *
   * @param array $form
   *   An associative array containing the structure of the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   *
   * @return array
   *   The rebuilt form.
   */
  public function ajaxRebuildCallback(array $form, FormStateInterface $form_state) {
    drupal_set_message(t('Entity was successfully created'));

    // @todo Clear form values.
    //$form_state->setRebuild(TRUE);
    //$form_state->setValues([]);
    /*$entity = \Drupal::entityTypeManager()->getStorage('liveblog_post')->create([]);
    $form_object = \Drupal::entityTypeManager()
      ->getFormObject('liveblog_post', 'add')
      ->setEntity($entity);*/
    //$new_form_state = new FormState();
    //$form = \Drupal::formBuilder()->rebuildForm($this->getFormId(), $form_state);

    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function save(array $form, FormStateInterface $form_state) {
    $entity = $this->getEntity();
    $entity->save();
  }

}

P.S. you can find my attempts in the ajaxRebuildCallback() method.


texts: Hi I would like to create a custom module where I can do extra checks on a view and if those checks are not pass deny access. I'm not sure what hook to implement to achieve this.


texts: How do I create a taxonomy tag from node title

texts:
I have a "Tags" vocabulary, and I would like to automatically add the node title to this vocabulary as a tag on saving the node. I have tried to use the Rules module to do this, but I can't get it to work.

Can you help me?


texts: User information based on external database

texts:
In one of the community portal based on Drupal,

Now, there is a rich user information which is also used by external applications. This information can be LDAP, MySQL or any other different database per say. (the choice here is still open).

Now, we are also considering using Profile2 for rich user information, for authentication as well as and also for various social features.

So essentially, there are two different Applications (Drupal and External) that need to access the same data and both might need to read/modify the information. (we can be safe here in terms of simultaneous access because traffic will be very minimal.)

So what should be the right approach ? Should Drupal look up to the external database or should the external application directly modify Drupal's own database? Or should there be some sort of DB to DB sync?

Is any of the approach possible and if so, how can this be achieved?

Please note: this approach requirement is only for User specific information not any general purpose other content in Drupal.


texts: Disable creation of a page for a content type and just use teasers?

texts:
So on my website I have Content Type: Level 3 - Article Page. This page has two node reference fields where you can set Call to Actions, these display teaser versions of other articles, downloads etc and are shown below the body text of the page. See this screenshot:

I now want to also allow users to set Call To Actions on the Level 3 pages for specific Giving/Donations.

So I've created a new Content Type: Giving CTAs. Here a user can add text, a thumbnail, title, default donation amount etc.

The issue is that I only ever want to use these Giving CTAs as teasers rendered as in the screenshot. They will forward to a giving checkout page carrying the donation amount value.  I don't really want full pages to be rendered for each one. So is there a way to cancel the rendering of pages or disable it for this content type? Maybe it's actually disabling the creation of a URL and default node/id URL? I'm not sure :S


texts:
I'm using drupal 6, I wanted to give feed back on a simple quiz (that is answered during user registration - to be a profile field).  I made a template for the profile page:
user-profile.tpl.php

And the code (at the bottom of the page) works fine, but it doesn't work when I try the same code in the template(for the specific block I want):
block-block-10.tpl.php

I added this function to template.php, to (TRY) make $account avaialble to block-10

function blockaccess() {
// access globals
global $account;
global $node;
}

What do I need to change?

the code in block-block-10.tpl.php:

    <?php
    blockaccess();
    dsm($node);
    dsm($block);
    dsm($account);
  $correct_ans = "3) I'm from Spain.";
  $quiz_ans = $account->profile_quizoffer_ans;
  print $quiz_ans;
  print "--------------------------------------------
";
  print '
チラシの裏のクイズ:

Q: Where are you from?	Result
';
  if ($quiz_ans == $correct_ans) {
    print '

';
    print $quiz_ans;
    print '

CORRECT

You passed the quiz!
';

  }
  else {
    print '

';
    print $account->profile_quizoffer_ans;
    print '
INCORRECT

You didn'."'".'t pass the quiz!

The correct answer was:	';
    print $correct_ans;
    print "
"  ;

  };
  print "
"; ?>


texts:
I need to add custom validation to a form, lets says add article form.

I was expecting something like hook_FORM_ID_validate() to handle this, but cannot find anything relavant in the API documentation.

What is the way to add custom validation to a form?


texts: How to call a function in template.php through ajax from a page?

texts:
I have a button in drupal page template. When user clicks on that it will write the text in the text box to a text file.

I have written a function for that in template.php file. I want to pass the value in text box to the function using ajax. But how can I do it? What url should i give in javascript ajax function?


texts: How to add active-trail class to a links in a view?

texts: How to add an active-trail class to all links in a view, which a parents of a current page (according to a result of menu_get_active_trail())?


texts: The website encountered an unexpected error. Please try again later (WSOD). Debugging scenario

texts:
After updating Drupal using drush my website says 'The website encountered an unexpected error. Please try again later'. with white screen(WSOD).

Then when I tried to rebuild-cache using drush there was a drush fatal error originating with rules module. I got it rectified by replacing rules module with 3.x dev version.

I could rebuild the cache and update database using drush. But still the wsod is there

My next move was to enable error reporting. So I added the line

$config['system.logging']['error_level'] = 'verbose';
it did not return any errors on the the screen.
I like to know a debugging scenario for D8 as i faced this same issue for my another D8 installation but that was rectified after rebuilding the cache. I have came across posts by user with similar issues but reasons for their issues were different. So I strongly believe that there should be a debugging scenario that can apply to all.


texts:
I've enabled the Devel query log, and it's logging most queries as expected. However, I've got this module which connects to another database and executes a few queries against that one. All queries goes through db_select(), db_query(), db_insert(), db_delete() or db_update().

However, queries executed against the other database (connection is configured on the fly, and not through the settings.php file) never appears in the query log.

Any way I can make it work, so that ALL queries appear in query log at the bottom of the page?

Note: Caching does not seem to have anything to do with it. I've cleared all caches, returned to the page, and still no queries appear in the query log.


texts: Drupal Views Search: Creating an Exposed Filter with Checkbox Options

texts:
Using basic search module and Views to make a search interface.

When I create an exposed filter for a field with multiple options I only have the option to choose 'dropdown' or 'autocomplete' for the filter settings.

Is there a way to make the filter display the options to users with checkboxes rather than a dropdown menu?


texts: How to include "Page Updated" in the footer of my drupal 7 site?

texts: I would like to display a "Page Updated" snippet in the footer of my site. Is there a module which I can use, and then include as a block?


texts: Where do I find default value for contextual view filters?

texts:
I'm finding the views in 7 to be much more confusing than in 6! I'm trying to create a block that will filter by the node ID of the page the block is embedded in. When I look at the help for Contextual Filters in the block display, it says this:

  Block displays have no source of contextual filters at all; they
  cannot pull contextual filters from the URL, and often require use of
  PHP code as a default contextual filter. Various default values can be
  applied against contextual filters to use filters in a block view. See
  "Provide default value," under "When the filter value is NOT in the
  URL" below.

  When the filter value is NOT in the URL

  Display all results for the specified field If this option is
  selected, the contextual filter is removed from the view as though it
  weren't there and all results will be displayed.

My question is, where do I find these choices for default values? When I click on the Add button next to Contextual Filters, I get a dropdown list of all content fields, not a list of options like "Display all results for the specified field".

Edited to add

  The Default contextual filter selection is available only if the action to take is "Provide default value" under "When the filter value is NOT in the URL." When that option is selected, a new fieldset will appear that will allow you to choose default contextual filters. Views provides the following default selectors by default

So where is the "When the filter value is NOT in the URL" choice?


texts: Count of Users Grouped by Date with Exposed Filter

texts:
I want to create a view that shows the count of users grouped by date. That works fine by just adding aggregation and using the "count" function.

As soon as I add an exposed filter to narrow down the date range the grouping doesn't work anymore.

I've come across recommendations to turn of the RDF module but that didn't fix the issue.

Has anyone else come across this issue?


texts:
I am working with the Metatags module, and I have these fields.

I need that looks like as in the following screenshot, when the fields meta description and meta keywords are validated.

This is my code, I don't know how can include the class error and put the * symbol.  My question is related with styles.  I want the field keywords and description looks as fields required for the user.

mymodule_form_alter(&$form, &$form_state, $form_id) {
  $form_id = $form['form_id']['#value'];
  if ($form_id == "article_node_form") {
    $form['#validate'][] = 'mymodule_test_validation';
  }
}

function mymodule_test_validation($form, &$form_state) {
   if (($form_state['values']['metatags']['description']['value'] == '')) {
        form_set_error('Description', t('field is required'));
      }
      if (($form_state['values']['metatags']['keywords']['value'] == '')) {
        form_set_error('Keywords', t('field is required'));
      }
}


texts: How do I query a content type with custom fields in the 'condition' statement

texts:
I need to query a content type both returning and filtering on conditions of custom fields.

$query = db_select('node', 'n');
$query  ->fields('n',array('field_customfield1','field_customfield2'))
        ->condition('type', 'myContentType')
    ->condition('field_customfield3',$user->uid,'=')
    ->condition('field_customfield4',$anemailaddress,'=');
$foundrecord = $query->execute();

This doesn't seem to work. My issue is I can't figure out how to reference the custom fields in queries.

Any help GREATLY appreciated!


texts: I am getting temporary file could not be copied because the destination directory is not properly configured error.

texts:
The specified file temporary://fileDTbhYD could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.

I have set read and write permissions for sites/default/files/ folders.
I am getting permission error for profile/site/theme/themename/assets/css folder in error log.
I have set the permission for this as well.
Can't get through the error.
Any solution??


texts: How to create a page category of products in Commerce 2?

texts:
Usually in commerce 1 did:
Display-products (node), in which field "Catalog" of taxonomy-term.
Create a displays. Go to the term page and see all products! Great!

In commerce 2 tried to do but failed, probably because product is not a node, and the view for taxonomy, only works on him and no teaser.

Tell me, how do organized easy catalog on commerce2?

Preferably without the panels and search_api. Thank you.


texts: How can I pass more resource IDs with a single request?

texts:
I've been using the Services module with the REST module from quite some time now.
I want to make a single PUT application/json request with an appropriate JSON raw body for it, passing more than a resource ID, instead of making different requests. So far as I read, I found I can use PUT request: http://.../resource_endpoint/resouce_name/resource_id.


texts: Welcome email after user reset password in first time?

texts: When a new user signs up with the website the user receives an email with link to reset the password and when they reset the password first time, they get a welcome email but when in future they reset their password , they will not get that welcome email.How to resolve this.


texts:
While viewing a views generated page, like for instance a taxonomy term page, is there a way to update the views generated content by passing it some parameters, like for instance a new taxonomy term.

The purpose of this would be to update a view page content via an ajax request.

Thanks


texts: How can I export content-type and content from one site to another?

texts:
I got handed over a drupal 7 site with two branches, one is now in production and other is dev. I am working on dev and had to create new content types and made changes existing content types.

In the meantime other users made some changes to content-type and content. Administration want to merge content types and retain the latest content.
What is the workflow to do this kind of stuff.
In the past I only had to clone whole site so I used rsync to sync file and export/import db.

This looks like way more complicated than I anticipated as both sites have same content types but with some degree of variation in field names and types.

From my current Drupal knowledge it seems like a very complex task.

Where should I start and which approach/technique should I use?

I went through other answers and found that the Node export module can export the node but how can I export the content and map the fields from one content type to another ?


texts: Is there any reason Backup & Migrate leaves all the .info files around?

texts:
I just discovered that there are hundreds of .info files left lying around in the folder that the Backup & Migrate module uses for scheduled backups, while only 12 of these have a corresponding .gz file.

Is there a reason to keep these?  Do they have any real value?


texts: Is there a way to disable username for logging in?

texts:
I'm using realname with this small moduel to generate username from some profile field.

Now users can login with both username and email by using LoginToboggan.

Only the problem is that I don't want to let users login with their username. It looks like LoingToboggan has the function to let users login with email but not disable username login.

Is their anyway I can just disable username login?


texts:
On my commerce site, I would like to use exact functionality like both ubercart cart links or ubercart kits have - to add multiple different products to cart at once (one click on button or link, no quantity).
Requirement is: products inside cart should behave as single products, with quantity enabled. I do not need discounts.

modules I tried:

commerce product bundle - adds all products as one product, you can only change quantity
commerce bundle - separate products but quantity fields disabled.

Rules links look promising but I am not so sure how it would work with many kits. Do anybody have a solution for this? Thank you.

User case: Create various product kits (as content types) with add to cart button. After adding to cart, products behave like normal simple products. (Ubercart has this funtctionality - while creating a product kit, you can check wether you want the products to behave in cart like a kit(a bundle) or as a separate products.)


texts: Separate filter results in the same view

texts:
How do I display the two results from two different filters in the same view?

I have this record data which has a created date field. I'd like to create a view block where display a table counting records that were created before this date and records created on of after that date.

How could I display those results from separate filters?


texts: How can I change the 'active' class in main menu to something else?

texts: I'd like to change the class in the main menu from 'active' to say 'current'.  How can this be accomplished?


texts: Allow users to uploading videos to vimeo

texts:
I am totally new at making websites using Drupal. I started on Monday (April 1st) and I've been using drupal.org and drupalize.me to start learning and building some basic stuff.
There is one thing I want to do and I've been stuck for 2 days now.

I want to be allow the users of my site to upload videos which will get stored inside my database and, using the data from my database, upload it to Vimeo site and use vimeo player as the player.

This is my goal right now but I am stuck on the very first step TnT.
I have the module "Media-7.x-1.3" installed on my site and tried using it to upload videos. I know this only allows me to upload videos from the admin end when you are creating a new content and you have to edit the "article" or "blog" post that contains the video file if you want to change something and doesn't allow the users of my site to upload the videos directly but I just wanted to get started on something.

So I followed the instructions and went to
- Structure -> Content Types -> Add content type -> name the content type (video files) -> save and add fields (everything else is left as default) -> add new field (upload videos) -> field type = file -> widget = media file selector -> save -> upload destination = public files (there are no other options for me to choose) -> save

this will bring me to manage fields page
label = upload videos -> allowed file extensions for uploaded files = mp3, mp4, wmv, jpg (i gave it bunch of random extensions so I can test it if it works or not) -> maximum upload size = 50 MB -> every other fields are left as default -> save

inside manage display page
upload videos format = rendered file -> save

after all the configurations, I go to
Add content -> video files -> title = videos -> click on "Select media" at the bottom -> Browse -> select my video file I want to upload (mp4 file, 34 MB) -> Submit
and nothing happens. no error message, no video uploaded or anything. I'm just stuck in the upload overlay page and I would have to hit cancel to get out of the page.

but if I try to upload a image file (jpg file that I allowed earlier), I can see the preview of my image and gives me an option to "Select media" or "Remove media" (the upload overlay page is gone of course).

So I have no idea why it's not working for video files or what is going on. AND this is not even what I want to do...sigh...

Please help me TnT

Thanks!


texts: In tabledrag form, how to prevent certain elements from having children?

texts:
I want to use tabledrag to manage 2 kinds of elements. Let's call them branches and leaves. Branch can be parent to both branches and leaves. Leaf cannot be parent to anything. A support for class tabledrag-parent-locked preventing change of a parent can be added, but that's not exactly what I want, I actually want to be able change parents, just to other designated parents.

So, is there any class or module to get that effect?


texts: Drupal 8 purge module to allow SOLR index replication before cache invalidation happens

texts:
I am having a Drupal 8 website running over Acquia Infra. I have recently configured Purge module to invalidation cache over Acquia varnish and Cloudflare when cache-tags gets Invalidated.
Problem: Solr index takes around 60 to 120 seconds before full replication happens, but Purge module immediately processes queue to clear cache tags over Varnish and Cloudflare, Hence the newly created cache get generated from stale or outdated content from SOLR index if immediately browsed after updating.
Is there any possibility of adding delays (eg 2000ms) before processing Purge queue?
Any possible solution would be appreciated.


texts:
Anyone ever accomplished building a module that manages to have block configuration per instance?

The main issue with blocks is that each block does only one thing no matter where it shows up, you can't have the same block taking different parameters based on eg region.


texts: Blacklisting specific tags from an input format instead of whitelisting

texts:
I need a filter for the "Full HTML" input format that allows me to strip specific tags. I want to allow all HTML tags, except the ones specified in the input format options.

I am using Drupal 7.


texts: How do I split the CCK e.g. add node form into a wizard?

texts: I would like to split an /node/add form into multiple parts in a wizard format. Ive seen tutorials for doing this with registration but not with node/add. Any tips?


texts: How do I make a checkbox form initially have all options checked?

texts:
I have a drupal form in a module that doesn't pull in information until submitted.  Can I make the checkboxes initially checked?
  $form['search_block_type'] = array(
    '#description' => "Select content types",
    '#type' => 'checkboxes',
    '#options' => $options,
    '#title' => t('Content types'),
    '#default_value' => $default_types,
  );

I assumed it was #checked' => 'yes' but that doesn't seem to work.(from a view)


texts:
I have two OG groups - Organizations and E-hoods. and group content types - goals and ideas. I would like users to have a suggest feature which enables people to basically link groups and group content. Also the linking should be moderated.

Is there a module that does this ? or if anyone can give me a direction to work on, I can work on it too. I'm using Drupal 7 and have a limited knowledge on drupal.

Thanks!


texts:
Hello Drupal community.

I have a “Product” content type with field_alert_date field.
The field date type is “Date only” so when I get jsonapi response
by accessing jsonapi/node/product I have the following output for this field:

"field_alert_date":"2020-02-22"

However, this response will be used by another program
and that program requires data in the following format:

"field_alert_date":"2020-02-22 0:00:00”

So I need to modify the jsonapi output to add “0:00:00” (or another time) without changing the field data type.
The program is not developed by me so I cannot change this requirement.
I have to do something with the output of the jsonapi.

Could you please tell me if it is possible and how it can be implemented?


texts:
We have a Drupal7 shopping website and it uses ubercart for the shopping experience.

Before checkout we want to display a page enticing users to buy additional items, so the requirement is a separate page not a pane etc.

Could anyone let me know how to accomplish the same please.

Thanks


texts: Verifying that Webforms Hooks are firing

texts:
I'm new to Drupal but relatively proficient in PHP.  I'm attempting to use the Webform module as a ticketing system.  What I'd like to do is hook into the webform submission insert (hook_webform_submission_insert) and create an object of type 'support_ticket' each time a webform is saved.  For now, I'm just trying to make sure that I'm hooking in properly, and it looks like I'm not.  I'm using the code below in a template.php file of a custom module:

function pvfk_webform_submission_insert($node, $submission){
   drupal_set_message("IN Insert");

   //Declare a new StdObj

   $new_node = new StdObj();
   //Set the type
   $new_node->type='support_ticket';

   //Set the Title
   $new_node->title='NEW TICKET';

   //Set the body
   $new_node->body = 'TICKET BODY';

   //Set other content fields
   // $new_node->field_name[0]['value'];

   //Finally use functions to save, submit, and insert the new_node
   $new_node = node_save($new_node);
   node_submit($new_node);
   content_insert($new_node);

I've cleared my cache and created new webforms - but neither a new piece of content is created nor do I see the message.  Am I missing something here?


texts:
I saw the Autocomplete Deluxe module, which has a version for Drupal 7. I am using a user reference CCK field, and I autocomplete it. I would like to reference users in the way it is done with that module: As soon as users are referenced, it should go up in some manner.

Is there an equivalent of Autocomplete Deluxe for Drupal 6?


texts: How do I change the temporary directory without using any administrative pages provided by Drupal?

texts:
I've moved my live Drupal website to Windows localhost (XAMPP), but I'm getting lots of "The file could not be created" errors. If I log in to the site as an administrator, it fails to return any more pages at all. I can view it with errors if I don't log in.

Is there a way to change the temporary file location without logging in through the interface, or using any administrative page?


texts:
Is it normal that my validateForm method in Form API doesn't trigger second time i call it?
And if yes, how do i trigger it multiple times? I've got multistep form and i want to validate each step individually. Would be perfect to validate steps with validateForm.
First step can be validated, but on click Next in the second step inputs are not validated anymore, it skips validateForm() method.
Buttons:
$button = [
      '#type' => 'button',
      '#value' => $this->t('Next'),
      '#attributes' => ['class' => ['btn-primary pull-right button-next']],
      '#name' => 'next_' . $callbackName,
      '#ajax' => [
        'callback' => '::ajaxCallbackValidate' . $callbackName,
        'url' => Url::fromRoute('route.name'),
        'options' => [
          'query' => [
            FormBuilderInterface::AJAX_FORM_REQUEST => TRUE,
          ],
        ],
      ],
    ];

validateForm() :
public function validateForm(array &$form, FormStateInterface $form_state) {
    parent::validateForm($form, $form_state);
    $values = $form_state->getValues();

    if ($values['validate_step'] && !empty($values['validate_step'])) {
      switch ($values['validate_step']) {
        case "personal":
          //Validate personal;
          //break;
        // Etc.

Edit :
ajaxCallback methods look like that :
public function ajaxCallbackValidatepersonal(array &$form, FormStateInterface $form_state) {
   $ajaxResponse = new AjaxResponse();

    if (count($form_state->getErrors()) == 0) {
      $form['validate_step']['#value'] = "step_2";
    }
    $errors = StatusMessages::renderMessages();
    $ajaxResponse->addCommand(new PrependCommand(
        '#class-name',
        render($errors)
      )
    );

    // Here i was trying to do something with validation, doesn't work
    $form_state->setValidationComplete(FALSE);
    $form_state->setValidationEnforced(TRUE);
    $form['status']['#validated'] = FALSE;
    $form['status']['#sorted'] = False;

    $ajaxResponse->addCommand(
      new HtmlCommand(
        '#form_wrapper', $form
      )
    );

    $ajaxResponse->addCommand(new InvokeCommand(NULL, 'function1'));
    $ajaxResponse->addCommand(new InvokeCommand(NULL, 'function2'));

    return $ajaxResponse;


texts: How to test upgrade availability with drush exit codes?

texts:
I need the test to only do a backup before an upgrade will take place.
I use version 8.01 and I use the following command:

drush up -n

This seems to return zero when there are no updates and 75 when there are, but I need to be sure about this.

Apparently 75 means user abort. Apparently on an up-to-date site, the upgrade process is not interrupted by the "-n" because there is nothing to upgrade and it exits normally.

On an outdated site "-n" will cause the upgrade process to be interrupted and 75 exit code is returned. Please confirm this reasoning is correct, so that I can use it in my script.


texts: help me understand the drupal way to develop this module

texts:
Coming from a pure HTML, JS, PHP background to drupal 7.x has been a tough transistion, currently I have some code that I would normally use pure JS/PHP to code but I want to make this section managable through the drupal CMS and I'm not totally sure how I would do this. I believe I should be creating a module, but I don't understand how I would create the admin interfaces.

The end result should be structured like this:

The admin can create 1 or more sessions all of which will be displayed in a drop down.
Each session will have 1 or more topic listed once selected
Each topic will have 1 or more files listed under it

For example:

Session 1

Topic 1

File 1
File 2

Topic 2

File 1

Session 2

Topic 1

File 1

So assuming I create a module and have that module display the data how then do I create the admin page the will allow a user to create 1 or more sessions, with 1 or more topics under each and 1 or more files per topic per session. In pure JS and PHP this is pretty simple and straight forward, in Drupal hell it doesn't seem so easy :(


texts: How to combine Image and Video fields in a views slideshow in a single carousel?

texts:
I have a content type called Cities and it has an Image field. Using the Views Slideshow module with jquery.cycle I am able to create a block which takes the Image from the content and creates a slideshow.

However I have a requirements to be able to add the videos also in the same slideshow. So, I added one more field in the content type as Videos field where I can post the Youtube video URL.

Now the Dilemma is to display this video also in the same slideshow as the image, so, the slideshow would continue with mixture of Images and Videos.

My question is how to combine these two fields image and videos in views slideshow, to create a single slideshow/carousel?


texts: Does Drupal Disqus Commenting have a Server Side rending for SEO indexing?

texts: Having to outsource the commenting service to disqus saves alot of time, but is there a way to have these Disqus comments rendered on the server side before displaying it to the end user? My main concern is for SEO indexing. What solutions are there to keep the SEO indexing in tact when using Disqus commenting?


texts: New to Drupal 7 and I was wondering if this is possible to do?

texts:
I am new to Drupal 7 (it's been years since I touched Drupal 6) and I have a question regarding a concept.

Is it possible to "port" an external web applications into Drupal so it appears to be part of the website, but the app itself actually lives on another server? The external web application will have no dependencies on Drupal other than it's served up via Drupal so it appears to be part of the site.

Example - I build a webform an it lives on Server A, can I server it up via Drupal and keep all of the apps functionality?

Is this possible?


texts: Entity field query pager only loads first page

texts:
How do I load any page other than the first page with Entity Field Query pager?

$query = new EntityFieldQuery();

$result = $query->entityCondition('entity_type', 'node')
  ->entityCondition('bundle', 'event')
  ->pager(4)
  ->execute();

This returns the first 4 nodes. If i have 12 nodes, how do I return page 2 nodes 4-8 or page 3 nodes 8-12.

The documentation states I can only pass $limit and $element. Have I missed something? What's the point of a pager that only loads the first page.


texts:
An RSS-feed on my site doesn't show up in the HTML <head> as it is supposed to, which makes it very difficult to find. Here's my situation:

A view is displaying the latest blog posts.
This view has two displays: a content pane and a feed. The feed is attached to the
content pane.
The content pane is shown on a page using panels and page manager.

The RSS-icon shows up at the bottom of the view, so the feed is definitely there. However, the feed doesn't show up in the the meta-tags, so the browser doesn't discover the feed like it's supposed to. Does anyone know where this goes wrong, and how I can fix it?


texts: Webform live calculations in table/matrix

texts:
I am trying to create a work time allocation webform. My goal is to create a table (6 columns and addable rows) and get a live sum of all columns at the bottom. (edit: pardon my lacking terminology.  With live I meant client side ajax or js that updates instantly when the user fills in the form, before submitting it)

I tried using a webform and webform matrix module, they allow for a table with addable rows. But I can't get the live sums to work. Is there another method or module I could use that would suite my case better?

TLDR; I need a webform with a table supporting x amount of rows and a live sum at the bottom. Any suggestions what modules to use?

The colored cells are buttons.


texts: Image styles thumbnail, medium, large to default dimenssions

texts:
My drupal create thumbnail of my uploaded image (thumbnail, medium and large).
I don't want to have redimensioned images, I want original size.

PS: drupal create 3 images per uploaded image, so, for me are lots of nodes.

How can I stop drupal from creating these?


texts:
I'd like to organize a .module file better by putting related hooks in other .inc files.  So for example, I'd like to take a bunch of imagecache preset definitions (via hook_imagecache_default_presets) out of custom.module and put them in custom.imagecache.inc.

Where in custom.module should I include custom.imagecache.inc?  I assume I'll be using module_load_include()?

If I put it in a hook_init wouldn't that include these hook definitions on every page request?


texts: Contextual filter "Allow multiple values" is gone

texts:
Why can't I see the "More - Allow multiple values" option on my contextual filter product view?

This is my view:

This is what should appear:


texts: How to set one of the fields displayed in the view to be a link to a webform submission?

texts:
I'm using the Webform MySQL Views module to allow me to display webform submission data in views. This works really well; once you get it set up you work with the view just like you would a normal one.

So here's my question: how can I set one of the fields displayed in the view to be a link to the webform submission? There's an option to make a field a link in the Rewrite Results section:

But I'm not sure how to enter the path to the actual submission. The link I need to produce looks like this (copied from Content->Webforms->Submissions->View):

http://localhost/drool_calendar/node/1/submission/5

I'm guessing I don't need to specify the server or site name, but everything from node/ on.


texts: How to translate a node without creating a new node?

texts:
I have translation enabled for the node type page, settings " Require language (Do not allow Language Neutral)." and " Normal - All enabled languages will be allowed".

However, when I'm creating and translating a node, it creates a new node instead of translating just the fields and storing the content in $node->body["en_US"][0]. How do I fix that?


texts: How do I use hook_search_api_solr_search_results_alter() to alter search results?

texts:
I want to alter the results of a Drupal 8.x search_api_solr search using hook_search_api_solr_search_results():
function sbn_search_api_solr_search_results_alter(\Drupal\search_api\Query\ResultSetInterface $result_set,
                                                     \Drupal\search_api\Query\QueryInterface $query,
                                                       \Solarium\QueryType\Select\Result\Result $result) {
 $resultset_data = $result->getData();
  // Get docs in response results
  $results = $resultset_data['response']['docs'];
  foreach ($results as $id => &$item) {
    // get the doc and array id
  }
}

I know that the docs I seek are in the search results:
dsm($result);

returns
stdClass Object
(
    [__CLASS__] => Solarium\QueryType\Select\Result\Result
    [numfound:protected] => 5
    [maxscore:protected] => 1.8644972
    [nextcursormark:protected] =>
    [documents:protected] => Array
        (
            [0] => stdClass Object
                (
                    [__CLASS__] => Solarium\QueryType\Select\Result\Document
                    [fields:protected] => Array
                        (
                            [ss_search_api_id] => entity:node/47:en
                            [ss_search_api_language] => en
                            [score] => 1.8644972
                        )

 ...
    [data:protected] => Array
        (
            [response] => Array
                (
                    [numFound] => 5
                    [start] => 0
                    [maxScore] => 1.8644972
                    [docs] => Array
                        (
                            [0] => Array
                                (
                                    [ss_search_api_id] => entity:node/47:en
                                    [ss_search_api_language] => en
                                    [score] => 1.8644972
                                )

                            [1] => Array
                                (
                                    [ss_search_api_id] => entity:file/85:en
                                    [ss_search_api_language] => en
                                    [score] => 1.784599
                                )

Let's say that the doc in question that I want to remove from $result object is:
$resultset_data['response']['docs'][$id]

How do I alter the $result object to remove this doc from results?  Every attempt I have made to access the $result object as an array has resulted in these types of errors:

Error: Cannot use object of type Solarium\QueryType\Select\Result\Result as array

Error: Cannot access protected property Solarium\QueryType\Select\Result\Result::$response

Any suggestions or documentation on this would be highly appreciated.


texts: How to integrate an Android database in Drupal?

texts:
How do I add an Android apps database contents to a Drupal site?

I have an Android app with a database having 3 tables. I also have a Drupal site with 3 content types as the 3 tables of apps databse.

What should I do so that the contents of apps database is imported to Drupal contents, so that each content type corresponds to the contents of the 3 tables in Android? Is there any module available for this?


texts: How to implement review ratings with Fivestar?

texts:
I want to build a rating functionality identical to what we can see on http://www.meineuni.de/ - there is a page of a product (or an University as in the example) and that page contains cumulative ratings taken from continuous ratings. A sample page is http://www.meineuni.de/uni/jacobs-university-bremen/bewertungen/

Business case: I want anonymous users to be able to create content of specific type and be able when creating the page, to assign ratings in several categories. This page will then be available online for other anonymous users to rate and the rating will be cumulated with the initial rating to show the weighted (initial+continuous) rating.

Is something like this possible with Fivestar in Drupal 7?

I want to find the right way from the beginning, instead of trial and error approach, which I don't mind, but that is more time consuming.


texts: I have a field in a node where users entered data in an inconsistent format.  I need to parse that data (it's HTML) and re-format it so it looks correct.  Where is the best place to do this?


texts: EntityFieldQuery: number of field values as condition

texts:
I have a node type which has a field that can contain an unlimited amount of images.

I want to retrieve a set of entities, but only entities that contain at least one image.

So far this is my query:

$result = $query->entityCondition('entity_type', 'node')
    ->entityCondition('bundle', 'reference')
    ->propertyCondition('promote', 1)
    ->propertyOrderBy('created', 'DESC')
    ->pager(12)
    ->execute();

How should I use the extra fieldCondition to indicate I only want nodes with at least 1 value for field_images?


texts: Why can't I reinstall my module after uninstall?

texts:
With last beta version of Drupal 8, I have this error:

  Error message
  Unable to install Nature Theme - Structure and configuration, block.block.kyna_block_aboutus, block.block.kyna_block_blog_more_content, block.block.kyna_block_navbar, block.block.kyna_block_user_login, block.block.kyna_block_user_menu_account, field.field.node.article.field_kyna_article_slideshow, field.field.node.kyna_folio.body, field.field.node.kyna_folio.field_kyna_folio_client,
  [...]
  image.style.kyna_image_medium, node.type.kyna_folio, system.menu.kyna-navbar, taxonomy.vocabulary.kyna_client, views.view.kyna_blog, views.view.kyna_folio, views.view.kyna_home already exist in active configuration.

Why can't I reinstall my module? I don't have this error with previous version of Drupal 8 when I try to install my module after an uninstall.

How share my site configuration (block, field, view, etc.) without this problem please?


texts: How to calculate the sum of a list of integer in Rules

texts: In a Rules component I have a list of integer (as variable data type). I have to calculate the sum of items and to expose the result. Any suggestions?


texts:
I am trying to add my JQuery code to my drupal 7 site.

In my drupal based site i have image in the featured block.
My JQuery code slides up the image after 2 seconds.

When i added the JQuery code to my page it is showing the JQuery code on the page.

Here is my code:

<script src="/drupal/sites/default/files/js/jquery.min.js"></script><script>
$(document).ready(function(){
    $(".sec1").slideUp(7000);
});
</script>

when i save the configuration, below codes are displayed in web page.

$(document).ready(function(){
        $(".sec1").slideUp(7000);
    });

How can i solve this?


texts:
I need to update my Views module in Drupal 7. Drupal won't do it automatically. It says the download is not available.

I have downloaded the new version manually, but when I try to install it via 'add new module', the message is 'views is already installed'. How do I update the module?


texts: How can I conditionally reference an entity?

texts: I would like to have an inline entity reference form that will optionally provide a write-in text form if the entity doesn't already exist. Here's the use case: I want to reference a faculty profile that is associated with a particular research project; but I want the option to also associate another person who does not have a profile on the site. In a corresponding view, if the associated person has a profile on the site, their name will link to their profile, otherwise it will simply appear without a link.


texts: Default Billing Information on PayPal site using WPS

texts:
I'm looking for a way to default the Billing Information on the PayPal site when using PayPal WPS to process my payments in Drupal Commerce (v7). Currently, I have the Billing Information defaulted correctly on my Drupal site from the user profile so the customers do not have to enter it again during checkout (already entered when they registered), but do not want them to have to fill their Billing Information on the PayPal site once redirected during payment processing.

I have done this before when creating my own "home-grown" solution using the simple Pay Now button at PayPal by setting input form fields on the page that submits the form to PayPal.

<input name="first_name" type="hidden" value="frank" />

It would be a far better experience for users that do not have PayPal accounts to have this information defaulted on the "Pay with a debit or credit card" section of the PayPal page.

Thanks for any help!
Frank


texts: Webform results can not download more than 500 submissions

texts:
As the title says, I need to download 2600 submissions of one form. The batch runs completely. However, in the download file, I have only the first 500 submissions.
I have no idea what should I do to debug.

Thanks in advance for your help.


texts:
Until last week, when i logged in as administrator, on the page of nodes,
i could edit blocks by clicking "edit this block" link which appeared in upper right corner of blocks.
But now i can't see edit block link, so for every time i want to edit block i go to "/admin/structure/block" which is very bad.

When i check the page source i can see the links like:

Edit block

What would be the problem.
How can i solve this?
Can you please help me.


texts:
I have create simple hook_menu but when i clear cache retrieve Page not Found

function sanabel_calculator_menu() {
  $items = array();
  $items['iban_generator'] = array(
    'title' =>  t('IBAN'),
    'page callback' => 'iban_generator',
    'access callback' => true,
  );

  return $items;
}
function iban_generator(){
  $branch = $_GET['branch'];
  $accountNumber = $_GET['accountNumber'];
  $number_format = "11192427" . $branch . "00" . $accountNumber . "192400";
  $checkdigit = 98 - ( $number_format % 97 );
  $iban = 'JO' . $checkdigit . 'BJOR' . $branch . '00' . $accountNumber;
  $output = '

 ' . t("Account Number") . '
    ' . t('IBAN') . '

  ' . $accountNumber . '	' . $iban . '

'. l(t('Back'), $back_form) .'
';
  return drupal_set_message($output);
}

How can fix this problem ??


texts:
Once a page is saved I want to put the current time (I know I can do it by the form, but I need to do it programmatically). My code:

function mymodule_node_presave(EntityInterface $entity) {
    $node_type = $entity->bundle();
    if ($node_type === 'page') {
            $date = date('Y-m-d 00:00:00', time());
            $entity->field_mydate->value = $date;
            $entity->body = $date;
       }
}

It changes the body correctly but not the date field.
I tried all those, none works. I can't understand where is the problem.


texts:
I added the CAPTCHA module to my drupal 6 website using this procedure and I'm trying to add the captcha to my user registration page.

However when I go to /admin/user/captcha the list with the default forms is empty. I expected the default list.

I entered user_register as the form_id, selected the standard captcha from the dropdown and pressed save. However it does not add the new form to the list. It's still empty. I also tried to save other values without success.

UPDATE:
I also tried reinstalling the captcha module and flushing cache without success. It's weird because I never had this problem on an other site with the same module/version

Installed version of the module: 6.x-2.4

UPDATE 2:
I enabled both the Captcha module and the Captcha compatibility module in the modules list.


texts: How do I override the look up on an entity reference autocomplete field? I would like to limit the look up to nodes of a certain type that have been created by the user that is creating the current node.


texts:
This problem is node titles and content text.

' character shows like this  mark.

Poland characters there is only ? characters. Example: ŁOŚĆ shows ????

But breadcrumbs shows ' character like this: '

I have trying this:

in article page but not working. Other pages doesn't work either. There I trying this method:

description, ENT_QUOTES, 'UTF-8');?>

But nothing work. So how I can do my page working with all special characters?


texts:
My module has 2 small forms which allow visitors to submit certain information.

Problem is when I am not logged in, no CSRF token is being added to the forms - so anonomous users/everyone are bypassing the CSRF. Can't find any documentation on this issue, could anyone point me in the right direction so i can get my CSRF tokens?

It is a requirement of my security testing that all forms include CSRF.


texts: Date Calender Starting Date of Field B should be equals to or advanced from the Ending Date of Field A

texts: I have created a form using webfrom module. The form contains Arrival Date and Leaving Date. I want Leaving date should either be same as Arrival date or higher than that.


texts: Book revision page showing access denied if no revision present

texts:
I've edited the content type Book to "create a new revision" whenever user publishes the page (while creation and editing the page).

I have created a custom menu Book revisions, with path node/[node:nid]/revisions using menu token module. It renders http://site-url/4/revisions with 4 as the node id of current node.
I am using Nice menus module to create the menu block and have placed it on every book page so that user can see the revisions whenever he is on the book page.

When I first create a page, and click on this menu, it gives me Access denied page (I'm logged in as user1). But, the moment I edit the page and save it, it works as expected - showing the different revisions.
Requirement: I want to display "No revisions" instead of "Access denied" to users. How can this be done?
I'm also open to suggestions to hide the menu for the first time, and again show it as soon as a revision of the node is created.

Edit: I find that if a node is not revised (edited), node_revision table has only one vid for the nid of node; and if the node is revised the table contain one vid per revision.
Using this information and a database query, I think it would be possible to find out whether a node has revision. Something like

$result = db_query('SELECT n.nid from {node_revision} n WHERE n.nid LIKE :uid',array(':uid' => arg(1)));
$temp_var = 0;
foreach ($result as $result_item) {
  $temp_var++;
}
//If revisions are present $temp_var>1
//Only one version present if $temp_var == 1
if($temp_var == 1) {
  //menu unset code goes here...
}

I am just not sure in which hook should I implement this.

EDIT: I'm using Diff module to enable the users to view the differences in two revisions.


texts: Can Views output only the first vocabulary term?

texts: Is there an easy way in Views to output the first vocabulary term only?


texts: Calculate sum in View of ISO-style timestamps

texts:
I have a text field on a node type, which the user fills out with a video duration in ISO format (no validation or anything). So, '4:33' or '04:33' would be likely values for this field.

The client now needs a View which shows all these videos' titles and durations, and adds up the durations. I've looked at solutions like Views Calc and have had no real success. I've also have bad luck formatting the duration as  a datestamp and trying to manipulate it that way. I need a way to show something like this:

+----------+--------------+
|TITLE     | Duration     |
+----------+--------------+
|Swimming  | 4:33         |
|Diving    | 2:42         |
|Running   | 1:27         |
+----------+--------------+
|TOTAL     | 8:42         |
+----------+--------------+


texts: Images not displaying after transfer to temporary site ~username

texts:
I had my site running on my local machine w/ DAMP.

I transferred (FTP) to hostgator shared server under my temporary site url http:// Address/~username. Running drupal 6.28.

My images that are under sites/default/files are not displaying.

Here's what I've done

Full html was checked
Ran update.php
Ran Cron
File permissions checked and set
Cleared cache
Reviewed status report to check issues there
Added the base_url to my settings.php file
updated my template so that it prints the base_url file
Checked file system settings
Commented out, deleted .htaccess (under files)
cleared my cache
Site is not in maintenance mode

It seems that if there has been a solution thrown out there, I've tried it. Any solutions someone could provide would be greatly appreciated.


texts: How do I redirect back to the source page after the user submits a comment?

texts:
How can I access the nid of the current page so that a user can submit their comment and be returned back to the page they just commented from. Here's what I am proposing...

function mymodule_form_comment_form_alter(&$form, &$form_state) {
  $nid = arg(2);
  $form_state['redirect'] = 'mymodule/' . $nid;
}

...to be placed in template.php. However using $node -> nid (referenced in comment.module) or $nid (referenced in my custom module) throws an undefined error. How can I access the nid to complete my redirecting URL? Or is there a better way of acheiving this?

I believe this is the part of comment.module that I need to hook into and modify - so in a wider sense my question is about hooking into a core module and modifying its function:

/**
 * Process comment form submissions; prepare the comment, store it, and set a redirection target.
 */
function comment_form_submit($form, &$form_state) {
  $node = node_load($form_state['values']['nid']);
  $comment = comment_form_submit_build_comment($form, $form_state);
  if (user_access('post comments') && (user_access('administer comments') || $node->comment == COMMENT_NODE_OPEN)) {
    // Save the anonymous user information to a cookie for reuse.
    if (user_is_anonymous()) {
      user_cookie_save(array_intersect_key($form_state['values'], array_flip(array('name', 'mail', 'homepage'))));
    }

    comment_save($comment);
    $form_state['values']['cid'] = $comment->cid;

    // Add an entry to the watchdog log.
    watchdog('content', 'Comment posted: %subject.', array('%subject' => $comment->subject), WATCHDOG_NOTICE, l(t('view'), 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid)));

    // Explain the approval queue if necessary.
    if ($comment->status == COMMENT_NOT_PUBLISHED) {
      if (!user_access('administer comments')) {
        drupal_set_message(t('Your comment has been queued for review by site administrators and will be published after approval.'));
      }
    }
    else {
      drupal_set_message(t('Your comment has been posted.'));
    }
    $query = array();
    // Find the current display page for this comment.
    $page = comment_get_display_page($comment->cid, $node->type);
    if ($page > 0) {
      $query['page'] = $page;
    }
    // Redirect to the newly posted comment.
    $redirect = array('node/' . $node->nid, array('query' => $query, 'fragment' => 'comment-' . $comment->cid));
  }
  else {
    watchdog('content', 'Comment: unauthorized comment submitted or comment submitted to a closed post %subject.', array('%subject' => $comment->subject), WATCHDOG_WARNING);
    drupal_set_message(t('Comment: unauthorized comment submitted or comment submitted to a closed post %subject.', array('%subject' => $comment->subject)), 'error');
    // Redirect the user to the node they are commenting on.
    $redirect = 'node/' . $node->nid;
  }
  $form_state['redirect'] = $redirect;
  // Clear the block and page caches so that anonymous users see the comment
  // they have posted.
  cache_clear_all();
}

Thanks.


texts: How do I allow users to rearrange the fields order during content creation?

texts:
Assume I have a content type with fields a, b, c.

How to allow users to rearrange fields (when they create one content) if they want to display fields in another order? Like b,a,c or c,b,a, etc ...

EDIT:
Panelizer do the job for my case.
There is a bug when trying to save the display. But getting both the Panels and Panelizer modules in latest dev version fixed it.


texts: Using Drupal for SaaS - New database per user?

texts:
I want to configure my D7 site so new users get their own database, so when they log content, create organic groups, etc, this data is just for them - and does not show on other user's accounts.

In a way this is a multisite, but I do not need to have each user have user.example.com, unless that is the solution to the problem.

If anyone has done this before, I'm all ears.

Thanks!


texts: How do I stop the page refresh on pressing "enter" in a form's text field?


texts: Profile Field Search module not importing bundle

texts:
We are attempting to use the module Profile field search to search profiles for terms defined using profile2, however, this is not working. I have set the profile entity field to Profile2 and the profile bundle to our custom profile type, but the terms won't appear in the search fields and won't return profiles when those terms are entered in the text box.

Any help in resolving this would be much appreciated. If you require further information, please ask.

New to this process and not very familiar with it yet.


texts: How to solve the apostrophe problem in node title? (' -> ')

texts:
Node title includes ' (apostrophe) and it appears normal while viewing the node. But in page source it appears as &#039;.

And for the same reason when I want to share this node on Twitter with some custom code put into node.tpl.php (<?php print urlencode($title) ?>) it also shows the ' as &#039;.

How to solve this problem?


texts: Allow the node preprocess function to be called after setting the theme function in hook_node_view()

texts:
In mymodule_node_view(), I set the theme function to be used with the following code.

$node->content['#theme'] = "my_custom_theme_function";

Now the node preprocess function (mymodule_preprocess_node()) is not called anymore.

How do I let Drupal run my node preprocess function, even if I set my theme function to be used?


texts: How to show a user's friends with only the Views and Flag module?

texts: Is it possible to show user's friends on a user's page (located user/%/friends) with Views by using only Flag module? So without the Flag Friend module or any other modules.


texts: How can I get the group id of a node using tokens?

texts: I try to use [node:og_group_ref], but that gives me the group node title and I need the GID, I am sure there should be a way to get it but I haven't found it


texts: Access Denied error when trying to install new modules after upgrading to 8.9

texts:
I’m  having a problem installing new modules after manually upgrading my site to 8.9.
I’m getting Access Denied errors even though I am logged in as admin (and have all permissions).
Looking at the reports, authorise.php is throwing the error. It is reporting that I am trying to execute this operation as anonymous (not verified).
I’m not understanding how this is possible and I am wondering if others have come across it. The upgrade was mostly routine and I'm still not convinced it has anything to do with the issue. But like everyone else I am prone to post hoc, ergo propter hoc conclusions.
Any help on a solution is greatly appreciated.
The following information may help someone work out the how and why :

The upgrade was from 8.6  to 8.9. PHP 7.3.19 is installed.

The site is in a subdirectory  /dev (which has not caused problems previously and does not now)

The upgrade went for the most part smoothly. I took the following steps:
(i) Various backups, put site into maintenance mode.
(ii) unpacked Drupal 8.9 on the server.
(iii) Under /dev, deleted core and vendor folders, preserving themes,       modules, sites and profiles.
(iv) Deleted all other files under /dev
(v) Copied in new core and vendor folders,  plus the top level 8.9  files including .htaccess (which contained no change in the RewriteBase)
(vi). Ran /dev/update.php

At this point an error occurred claiming I did not have the permission   to “Administer Software Updates” which I do have of course  course as  admin. When I did this step earlier on my test server there was no issue (although it  was on a different host).

To to get the update to complete,  I changed, as recommended,the $settings[‘update_free_access’] to TRUE in
~/public_html/dev/sites/default/settings.php , line 306.

So the update operation (running update.php)  was not done under admin. Is this possibly something to do with the issue?
5.There were several errors  reported at the time of the upgrade like this:
Notice: Undefined index: core_incompatible in Drupal\Core\Extension\ExtensionList->checkIncompatibility() (line 580 of /home1/uamelbc1/public_html/dev/core/lib/Drupal/Core/Extension/ExtensionList.php).
I don’t think this is important but  line 580 does reference the php version.

The Webform module is installed, and after the upgrade,  requires  many updates. Possibly related to 5?    I have not yet done these updates. All other installed modules are reported as updated.

Apart from not being able to install new modules, as far as I can tell, I still have all other admin capabilities.

Just in case it is not clear, the site is upgraded to 8.9, the redirect to /dev is working.

Here are my (scattered) thoughts on the Access Denied:
core/authorize.php contains a function:
function authorize_access_allowed(Request $request) {
  $account = \Drupal::service('authentication')->authenticate($request);
  if ($account) {
    \Drupal::currentUser()->setAccount($account);
  }
  return Settings::get('allow_authorize_operations', TRUE) && \Drupal::currentUser()->hasPermission('administer software updates');
}

This should return True. As I said before I have the “Administer Software Updates”. But that can't be right: Drupal thinks I'm anonymous.
In settings.php, there is the line
# $settings['allow_authorize_operations'] = FALSE;

Commented out. So what is the default? Is it True? (not usual). Or is set somewhere else? Should I try setting it to True?


texts: SMTP module: The following From address failed

texts:
all,

Here is something I don't quite understand.

First of all, my site-wide email address configured on Site Information page is my_gmail_address@gmail.com.

Then, I use smtp module to send emails out from my site. I configure SMTP settings with my yahoo email address my_yahoo_mail_address@ymail.com.

I tries to send a test email out to my other gmail address my_other_gmail_address@gmail.com, but failed. Email can never be sent out in this situation.

Here is watchdog log details:

Type    smtp
Date    Monday, September 22, 2014 - 11:29
User    lyon
Location    http://localhost:8888/drupal-test/admin/config/system/smtp
Referrer    http://localhost:8888/drupal-test/admin/config/system/smtp
Message Error sending e-mail from my_gmail_address@gmail.com to my_other_gmail_address@gmail.com : The following From address failed: my_gmail_address@gmail.com
SMTP server error: From address not verified - see http://help.yahoo.com/l/us/yahoo/mail/original/manage/sendfrom-07.html

Severity    error
Hostname    ::1
Operations

SMTP configuration didn't go wrong, because in the following two situations, email can be sent out well:

configure site-wide email address to be the same one configured in SMTP settings: my_yahoo_mail_address@ymail.com.
configure SMTP settings with a gmail address, then configuring site-wide email address to be any email address will work well. (People on Internet says Gmail can override it).

I don't want the SMTP configuration to be tied with Gmail account, it should support any mail host. How can I overcome this problem?

I appreciate your help.


texts: is it possible to disable ckeditor for private messages?

texts: I've ckeditor through out the site.But i don't need it for private messages(privatemsg module).Is their any way to disable CKeditor only for private messages?


texts:
So I installed metatags quick module 7.x-2.3+3-dev on D7.12. Since my site is bilingual and I do not need any per entity variations, I decided to go the path-based way and checked the Use path-based meta tags checkbox. I created a path pattern, like en/*, for each language - as instructed: without leading or trailing slashes.

No go. In the source code the metas are not output.
I tried various formatters in the Manage Display sections, but to no avail.

What is the secret then? I bet it's something very obvious ;-)


texts: How can I display a paragraph field excerpt in a search result view?

texts:
I've spent all day and night battling with Search API (with and without Apache Solr) in Drupal 8.

Does anyone know if you can use Search API to index paragraph content and then in a search views result, get back the "excerpt" of highlighted text from within a paragraph + the title of the node the paragraph is used in?


texts: How to add a wrapper and class to calendar entries?

texts:
I'm currently using the Calendar module in Drupal 7 and wish to add a wrapper with a class around the entries on days that have entries.

I've attempted to do this in the various template files and have been testing variables available with print_r for the last hour or so.

The a quick print_r in calendar-month-col.tpl.php provides the following arrays, either an empty day:

Array
(
    [entry] =>
 2

    [colspan] => 1
    [rowspan] => 1
    [class] => date-box future empty
    [date] => 2015-05-02
    [id] => events-2015-05-02-date-box
    [header_id] => Saturday
    [day_of_month] => 2
)

or a day with an event:

Array
(
    [entry] =>

          edit
          Test Event

&nbsp;

          edit
          Test Event 2

&nbsp;

    [colspan] => 1
    [rowspan] => 1
    [class] => single-day future
    [date] => 2015-04-30
    [id] => events-2015-04-30-0
    [header_id] => Thursday
    [day_of_month] => 30
)

I've considered checking for an existing string (empty days have the class "empty" or "no-entry")

Any suggestions?

Edit:
For the time being, I've put a quick solution together that will let me style the Calendar as needed.

$strings = array('empty','no-entry');
foreach($strings as $string):
  if (strpos($item['class'],$string)!==false):
    $addstring = "";
    break;
    else :
    $addstring = "event ";
  endif;
endforeach;

It's not nearly as clean as I would like, but it works.

Edit:  Added !== false to strpos.

As a side note, I ended up simply css'ing out the date-box row.


texts: Imported blogs not showing up under proper tab

texts:
In using Acquia/Drupal Commons and the Feeds module, we have successfully pulled in a few WordPress feeds. While the Organic Group is assigned and the newly created feeds appear in the OG's Home tab, they do not show up under the blog tag until I visit each one, click the edit tab, and then click save.

Given that, I assume I haven't mapped something that the group_tab_blogs View is searching on.

Additionally, if I copy the Query produced from group_tab_blogs live preview, copy it into a mysql client, and run, the results do show up. So that leads me to believe that it's something in the view filters.

Current Mapping between Source (Feed node) and Target (Blog node):

Current group_tab_blogs settings:

Update:

I can fix this by a manual running the query below. Once we set the field field_group_sticky_value of from table content_field_group_sticky to 'Not Sticky' it is now showing up.

 update content_field_group_sticky set field_group_sticky_value='Not Sticky';

However, I can't just map target fields Sticky and Group Sticky to just any value. I've already tried Published Date. So now I either need to run the above query on a trigger or adjust the view.


texts: How to have postings in blog with custom teaser length and read more links

texts:
I know this is a common request, but I have had no luck finding any answer. I am setting up a single user blog on my site. The blog has it's own page.

I have made a custom content type based on the Article content type. Then set up a View that displays these for the the blog page. The only thing I can't seem to make happen is to set up a custom teaser length with read more links that take you to each full Article node.

When I set the Row style: node/Page row style options/build mode to Teaser, I get the shorter teaser length, but no read more link to the full node.

I am using Drupal 6.


texts: How am I supposed to upgrade a site to latest core version?

texts:
I tried to update a Drupal 7 site to the latest version. The old Drush update doesn't work and it throws an error about a unknown engine type output format.

I tried to delete the web folder, extract Drupal 8 files, change the database connection settings to use the old database, and call update.php. It doesn't work, and it throws errors about MySQL encoding.

I tried to install Drush 9 to upgrade core, but it keeps complaining about the composer.json file.

I tried to install Drush 8, but it shows more errors.

How am I supposed to update an old Drupal installation to latest core version?