texts:
I am using webform 2 pdf module, where I am trying to set up a custom content to the pdf file.

I would like to acces the webform submission data, but I have no idea how to do it. Basically I would like to access them and use them as tokens.

I am on a basic level with both drupal and php, which means I have limits.

//simple first section

Registration

1. Registered Data:

[submission:values:personal_info:key]

2.  Declaration:

// there comes the non-working php part

<?php
    $var=($fields["institutuonal info"]);
    if ($var == "spec_inst") {
      echo "some juristic stuff";
    }
    ?>

So I am trying to export webform submission results to PDF, but the result depends on the submission content.


texts: Drupal Commerce - trigger product attribute AJAX with javascript

texts:
I have a product type with Date and Time attributes. These are rendered on the Add to Cart form as select inputs and when they are changed they trigger an AJAX update of the form to show the relevant stock and price.

Using the values in the Date select list I am rendering a jQueryUI datepicker that, when selected, will also update the Date select input.

I am using the following code to update the Date select when a date is clicked on the datepicker.

$('.form-item-attributes-field-date select').val(selected).trigger("change");

This correctly selects the option in the Date select but does not trigger the AJAX update. I have to interact with the Date select dropdown manually to trigger an update, rendering the datepicker useless. Is there something I'm missing?

I have already looked at this question that suggests I use .attr() as well as .trigger() but that doesn't make a difference.

Even when I print out console.log(settings.ajax); it tells me that the triggering event is change so I can't work out why triggering it doesn't call the AJAX update

This is my code

(function ($) {
    Drupal.behaviors.datePicker = {
        attach: function (context, settings) {
            // Insert datepicker div
            $('<div id="datepicker" />').insertBefore('.form-item-attributes-field-date');

            // Get array of valid dates
            var validDates = [];
            $(".form-item-attributes-field-date option").each(function () {
                validDates.push($(this).text());
            });

            $("#datepicker").datepicker({
                dateFormat: "dd/mm/yy",
                defaultDate: $(".form-item-attributes-field-date option:selected").text(),
                beforeShowDay: function (date) {
                    var string = jQuery.datepicker.formatDate('dd/mm/yy', date);
                    return [validDates.indexOf(string) != -1]
                },
                onSelect: function (dateText, inst) {
                    var selected = $('.form-item-attributes-field-date option').filter(function () {
                        return $(this).html() == dateText;
                    }).val();
                    $('.form-item-attributes-field-date select', context).val(selected).trigger("change");
                },
            });
        }
    };
})(jQuery);

Update

I have noticed that on first page load, selecting a date in the calendar widget does not trigger the AJAX refresh. However if I trigger the AJAX refresh by actually changing the select list, then clicking dates in the calendar does trigger the AJAX. Why would this not work on first load?


texts: Views field rewrite onClick attribute not rendering

texts:
In a D7 instance, in Views under "Rewrite the output of this field" I have this in the textarea:

[field_downloads_1-description]

All data is displaying except for the onClick attribute. Any ideas why?


texts: How to assign a link or path to a button in drupalgap?

texts:
I put a navbar in the footer and placed some buttons. The display is good, but I cannot find a way to assign the link to a button like usual. The node/123 in the  does not work.

/**
 * Implements hook_block_info().
 */
function footer_intrfc_block_info() {
  var blocks = {};
  blocks['footer_intrfc_block'] = {
    delta: 'footer_intrfc_block',
    module: 'footer_intrfc'
  };
  return blocks;
}

/**
 * Implements hook_block_view().
 */
function footer_intrfc_block_view(delta, region) {
  //var content = {};
  var content = '
';
  content += '
';
  content += '
Home
';
  content += '
Saved
';
  content += '
Sponsors
';
  content += '
Setup
';
  content += '

';
  if (delta == 'footer_intrfc_block') {
    content['my_out'] = {
      markup: ''
    };
  }
  return content;
}

The link of node will show "Error Loading Page". I wonder where I can set my link by path: 'node/123' like in setting.js

I also tried:

content += '
Saved
';

and

content += '
Saved
';

but they do not work.


texts: Whenever I'm trying to edit or create a content type, it always takes quite a while to load the page. Is it because I have too many existing fields and Node Autotitle is pulling all of them and slow Drupal down?


texts: Hide block on specific page through custom contextual link

texts:
We usually require to hide some blocks on specific pages for which we need to goto configure block page and add the URL of the page where we do not want to display a block.

Instead of going to configure block page, I want to add a contextual link " Don't display on this page"

which should add the path of the current page in the list on which the block should not appear.


texts: Form API ajax add group of users and numbers

texts:
Im quite a newbe to Drupal, but have made some php.

My problem is that by the help of ajax example pages i've made ajax function to show two fields when checkbox is 1.

When i press the add button i get two more fields, but they are not sortet the way i want to.

The fields are Number and User.

The initial layout when checkbox is checked is:

Number

User

When i press the Add button i get:

Number
Number

User
User

instead of:

Number
User

Number
User

This is my full custom module code:

/*
 * Implements hook_menu().
 */
function test_menu() {
  $items['test'] = array(
    'title' => 'Test functions',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('test_form'),
    'description' => 'Test functions.',
    'access callback' => TRUE,
  );
  return $items;
}

function test_form($form, &$form_state) {

  $form['#tree'] = TRUE;

  $form['terms3'] = array(
    '#type' => 'checkbox',
    '#title' => t('add users.'),
    '#ajax' => array(
      'callback' => 'test_form_callback',
      'wrapper' => 'options',
      'effect' => 'fade',
    ),
  );

  $form['options'] = array(
    '#title' => t("Generated text fields users and usernumber"),
    '#prefix' => '
',
    '#suffix' => '
',
    '#type' => 'container',
    '#description' => t('This is where we put automatically generated textfields'),
  );

  // Since checkboxes return TRUE or FALSE, we have to check that
  // $form_state has been filled as well as what it contains.
  if (!empty($form_state['values']['terms3']) && $form_state['values']['terms3']) {
      if (empty($form_state['num_names'])) {
        $form_state['num_names'] = 1;
        }
        for ($i = 0; $i < $form_state['num_names']; $i++) {
            $form['options']['number'][$i] = array(
                '#type' => 'textfield',
                '#title' => t('number:'),
            );
            $form['options']['Name'][$i] = array(
                '#type' => 'textfield',
                '#title' => t('Name of user:'),
            );
  }
          $form['options']['add_user'] = array(
            '#type' => 'submit',
            '#value' => t('Add'),
            '#submit' => array('test_form_add_more_add_one'),
            // See the examples in ajax_example.module for more details on the
            // properties of #ajax.
            '#ajax' => array(
              'callback' => 'test_form_callback',
              'wrapper' => 'options',
            ),
          );
          if ($form_state['num_names'] > 1) {
            $form['options']['remove_user'] = array(
              '#type' => 'submit',
              '#value' => t('Remove'),
              '#submit' => array('test_form_add_more_remove_one'),
              '#ajax' => array(
                'callback' => 'test_form_callback',
                'wrapper' => 'options',
              ),
            );
  }
  }

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

  return $form;
}

/**
 * Callback for autotextfields.
 *
 * Selects the piece of the form we want to use as replacement text and returns
 * it as a form (renderable array).
 *
 * @return array
 *   Renderable array (the textfields element)
 */
function test_form_callback($form, $form_state) {
  return $form['options'];
}

/**
 * Submit handler for the "add-one-more" button.
 *
 * Increments the max counter and causes a rebuild.
 */
function test_form_add_more_add_one($form, &$form_state) {
  $form_state['num_names']++;
  $form_state['rebuild'] = TRUE;
}

/**
 * Submit handler for the "remove one" button.
 *
 * Decrements the max counter and causes a form rebuild.
 */
function test_form_add_more_remove_one($form, &$form_state) {
  if ($form_state['num_names'] > 1) {
    $form_state['num_names']--;
  }
  $form_state['rebuild'] = TRUE;
}

Hope someone can help.


texts: Is it necessary to export features with a version number?

texts:
By default, modules generated with features are created with a version string in the *.info file.

I think the convention is to increase this version number when the feature changes.

In a distributed development work flow with a lot of merging, a linear version increment is not a useful model or metaphor.

Is the version number, and incrementing it, useful or necessary for anything?

I work in a project where until now almost none of the features has version number. But recently a colleague reported problems reverting the features on deployment, if they don't have a version. Of this could be pure concidence, and caused by something other than the missing version number.


texts:
My Drupal 7 site uses both Webform and Secure Pages modules. I've created webform which is available as a block inserted to the bottom of another Drupal node. This node should be accessible using http protocol, but the submission of the form should be encrypted using https.

There is an option in the Secure pages (called "Secure forms") for entering form ID's, which should have https flag set to true. So I've enetered the form ID ("webform_client_form_183") here and the result is, that the module generates correct form action (). But, when I submit the form (from let's say URL http://mysite.com/thepage), the form content isn't saved to the database and URL https://mysite.com/thepage is loaded to the browser instead. The form here is filled in with the data I've entered in previous step and submitting the form from https://mysite.com/thepage does finally the right thing and data are stored in the database.

What I should do to correctly submit (using https) the form from page located at http://... URL?


texts:
I want to display a block on first login only and never after that, is there any module or something possible for that?
I have a block which is visible always on the first page, but what i need is to show the block only once and never ever after. That block contains a link to start a javascript on page for the tour(Joyride Module). The problem is, If i select "Play tour once", It plays the tour once for every session and as soon as user comes after some time, I will restart the tour. I want the tour to start only once after login. I have decided to do it by showing the link to manually start the tour in a block and that block would be visible only after first login. So, is it possible?


texts:
I have an entity with entitylisthandler.

In entitylisthandler, i have a function to build row like:

public function buildRow(EntityInterface $entity) {

    /* @var $entity \Drupal\mymodule\Entity\xyz*/
    $row['id'] = $entity->id();
    $row['config_name'] = $entity->link();
    //$row['first_name'] = $entity->first_name->value;
    $row['ctype'] = $entity->ctype->value;
    return $row + parent::buildRow($entity);
  }

In @line 3:

$row['config_name'] = $entity->link();

I'm calling link function here which calls entity canonical link.

How to change this default value 'canonical' to some other link like 'delete-form'?

This is the Drupal core link function which I'm trying to override in entitylistbuilder file.

public function link($text = NULL, $rel = 'delete-form', array $options = []) {
  return $this->toLink($text, $rel, $options)->toString();
  }

I have changed its argument from 'canonical' to 'delete-form', but it won't work.


texts:
I need a somewhat complicated view setup. I don't know if I can even do it with views...

I have a page, we'll say the url is "/example". When a user hits "/example", they'll see a main content area and a sidebar. The main content area has a list of nodes. The one requirement I can't seem to figure out is how to have this list be limited by time, rather than number. I want the last 3 months of nodes to show up, not a set number.

Then in the sidebar is an "archive" view (seems best to me to just have it be a separate view from the main one, even though it concerns the same content) where the years should be listed (if they have nodes) and under each year the months should be listed (again, only if they have nodes).

Such as:

2012
February
March
2011
April
December
2010
January

I see an example "archive" view in the default views, but it's not quite set up like this.

I know views is very capable, but can it do this?


texts: How do I specify the debug_mail_directory for the devel maillog?

texts:
In settings.local.php, I have set my local dev environment to use the Devel module's mail logging function:

 $config['system.mail']['interface']['default'] = 'devel_mail_log';
 $config['devel']['settings']['debug_mail_directory'] = "???";

The DevelMailLog documentation says that:

  Filename pattern controlled by 'debug_mail_file_format' config setting.

What do I put for the filename pattern?  I have tried several patterns:

public://devel_mail
private://emails
sites/default/files/devel

But none of these work.  I checked watchdog, but apparently devel mail doesn't leave any logs.

NOTE 1: There is a note in the docs that config settings are broken, but the linked issue is already fixed.

NOTE 2: By default, when I enable devel and export the config, the value for debug_mail_directory is temporary://devel-mails, but I don't want to store them in the temporary directory; I want to store them in the Drupal files directory if possible.


texts: Feeds - How to set a blank source value programmatically

texts:
I'm triggering a Feeds import in a custom module I made. I need to set a value of a blank source in that code because that value is not in the source file (in this case is a xml). Is it possible to do this?

Below is the code I have.

$path = $url . '/path_to_my_file/myfile.xml';
$feeds_source = feeds_source($feeds_importer);
$feeds_config = $feeds_source->getConfigFor($feeds_source->importer->fetcher);

$file_exists = get_headers($path, 1);

# check if file exists:
if ($file_exists[0] == 'HTTP/1.1 200 OK') {
    $feeds_config['source'] = $path;

    $config = array(
        'process_in_background' => TRUE,
    );

    $feeds_source->setConfigFor($feeds_source->importer->fetcher, $feeds_config);
    $feeds_source->importer->addConfig($config);
    $feeds_source->save();
    $feeds_source->startImport();

    while (FEEDS_BATCH_COMPLETE != $feeds_source->import());
}

UPDATE:

Below is a more complete code. I have 3 functions. The first one is the original but one. Notice tha I get the $VALUETOPASS variable from the function arguments.

The other 2 functions are the ones rooby suggested.
The problem is how to have the $VALUETOPASS in the last function. At this moment I only need that.

function MYMODULE_CustomImport($VALUETOPASS) {
  $path = $url . '/path_to_my_file/myfile.xml';
  $feeds_source = feeds_source($feeds_importer);
  $feeds_config = $feeds_source->getConfigFor($feeds_source->importer->fetcher);

  $file_exists = get_headers($path, 1);

  # check if file exists:
  if ($file_exists[0] == 'HTTP/1.1 200 OK') {
    $feeds_config['source'] = $path;

    $config = array(
        'process_in_background' => TRUE,
    );

    $feeds_source->setConfigFor($feeds_source->importer->fetcher, $feeds_config);
    $feeds_source->importer->addConfig($config);
    $feeds_source->save();
    $feeds_source->startImport();

    while (FEEDS_BATCH_COMPLETE != $feeds_source->import());
  }

function MYMODULE_feeds_processor_targets_alter(array &$targets, $entity_type, $bundle) {
  // Set a custom value setter callback for the my field on my node type.
  if ($entity_type == 'node' && $bundle == 'my_bundle') {
    if (isset($targets['my_field'])) {
      $targets['my_field']['callback'] = 'MYMODULE_set_custom_field_value';
    }
  }
}

function MYMODULE_set_custom_field_value(FeedsSource $source, $entity, $target, array $values, array $mapping) {
  $xml = simplexml_load_file($url . $VALUETOPASS . '/api/xml');
  $multijob_array = json_decode(json_encode((array)$xml), TRUE);

  if (isset($multijob_array['action'][2]['cause']['upstreamBuild'])) {
    $multijob_build = $multijob_array['action'][2]['cause']['upstreamBuild'];
  } else {
    $multijob_build = '';
  }

  $entity->{$target}[$entity->language][0]['value'] = $value;
}


texts: How to make Panel Page variant selection rules detect URL parameter?

texts:
On D7 I have set up a new panel page variant and want to use it with a certain selection rule:

 String: URL path   Current path is "*/cars/*?buy"

Eg I want this panel variant to be used if the URL is new/cars/honda?buy.

However the above doesn't work. Adding ?buy to the url doesnt trigger it to be used.

Would anyone know a way to set selection rule so that I can use this page variant with a give parameter in the URL?


texts: How can I inject a taxonomy menu as the sub-menu of a standard menu item?

texts:
I have a main menu, with a top-level structure similar to the following:

Home - Categories - Something Else - ... - Contact

Each of those top-level links goes to an appropriate node page.

I have a vocabulary for Categories (multi-level), and I need to get those taxonomy terms in a sub-menu under the "Categories" item. I'd like to avoid hard-coding the items into the main menu, as the sub-menu should grow/shrink as the vocabulary does.

In the past I've written over-elaborate code to accomplish this, which hooks into taxonomy operations and manages a particular menu's sub-items based on that (very similar to what Taxonomy Menu does, but without having to have a different menu for each vocabulary).

While that method works, it's not ideal and certainly not generic. I can't just lift that code from the old project into the new one, it would require a reasonable amount of customisation.

I can't help feeling there must be a 'standard', module-based solution to this.

I've seen some suggestions out there to use a bunch of different modules in combination (even some suggesting to use Views-based modules, weirdly enough). I'm open to any suggestion, but if it involves installing more than 1 or 2 modules, and a load of hard-coded, context-specific configuration, it's probably not going to help too much in this case.


texts:
I want to create a field with hook_update in my module.  I have the following code that creates the configuration for a field_link field:

$module_path = drupal_get_path('module', 'my_module');
$configs['field.field.paragraph.image.field_link'] = $module_path . '/config/install/field.field.paragraph.image.field_link.yml';
$configs['field.storage.paragraph.field_link'] = $module_path . '/config/install/field.storage.paragraph.field_link.yml';

foreach ($configs as $name => $config_path) {
  $data = Yaml::parse($config_path);
  $config = \Drupal::configFactory()->getEditable($name);
  $config->setData($data)->save(TRUE);
}

As far as configuration it seems to be working correctly. When I try to create a node it all displays as it should. But if you save, you get an error that the table doesn't exist. Perhaps I have to use the ConfigInstaller class.  Anyone know how to have the table get created?


texts: How to restrict content for Anonymous users after they viewed more than two articles?

texts:
After an anonymous user viewed more than two or three articles, I want to redirect such user to the login/register page.

Any suggestions about how to make this work somehow?


texts: How to redirect the checkout complete page?

texts:
In my Drupal Commerce site, I redirect to a local payment API with a custom module after the user selected the local payment gateway in the review order page. The users enter username and password in the local payment website; if the user is authenticated successfully, the payment gateway server redirects back to my localhost at http://localhost/commerce/sites/all/modules/paymentgateway/CheckoutComplete.php.

In that page, the pay button exists; the user has to click the pay button to finish the payment transaction. After finishing payment, I want the server to redirect to Drupal Commerce's checkout complete page, e.g. http://localhost/commerce/checkout/93/complete.

How do I redirect to this link? Do I have to implement a hook?


texts:
I have used db_query to retrieve table rows from database. Recently I noticed, some people use @db_query instead of db_query.

I dont see any difference with the two. Is it doing any special functionality that normal db_query doesn't?


texts:
Currently I'm manually putting my local environment proxy settings in my settings.php file like so:

 $conf['proxy_server'] = '192....';
 $conf['proxy_port'] = ####;
 $conf['proxy_username'] = 'myusername';
 $conf['proxy_password'] = 'mypassword';
 $conf['proxy_user_agent'] = '';
 $conf['proxy_exceptions'] = array('127.0.0.1', 'localhost');

This works, but I work with a team, and the others on my team can see my login info when they enter the settings.php file. Plus when I change my password, I need to remember to change it here.

We're using Windows 7 machines. How could I make it so that Drupal automatically uses the logged-in user's credentials (like the way browsers seem to do) instead of hard-coding them into the settings.php file?


texts: How can i prove that the activation link sent to subscriber (anonymous user) has actually been activated?

texts: Where can i find a log entry or related information documenting that the activation link in the confirmation mail sent to simplenews-subscribers has been activated?


texts: How can I find user role based on user id?

texts:
There are many user list.
My need is to find out user role based on their user id.


texts: image_style_url() function not giving proper image in drupal 7

texts:
I am using image_style_url() function in drupal 7 with custom style. In my custom style I have taken a height:200 and width:200. But its cropping my image with these style not re-sizing it.

$query_bigimg = db_query(" select * from  {node} WHERE  type =  'cont' ORDER BY nid ASC LIMIT 0 , 1 ");
foreach($query_bigimg as $data) {
  $data_nid = $data->nid;
  $_Data = node_load($data_nid);
  $_bigImg = $_Data->field_ua_news_photo['und'][0]['uri'];
  $_styles = 'big';

<img src="<?php print image_style_url($_styles,$_bigImg); ?>" class="big-img img-hover">


texts: Is there any security consideration with webform and Salesforce API?

texts:
We are implementing the Salesforce webform module for our client and they are asking us if there are any security issues to consider by having SOAP installed on their server.

(The Salesforce API requires SOAP to be installed for drupal to communicate with it.)


texts: Review the css and theme also like we do for code using code review module

texts: To check my code in custom module we use Code Review module.   Is there a similar module for themes and CSS?


texts: Saving node with a text format another user doesn't have permission for renders it inaccessible

texts:
I have an editor role which has access to an editor Text format.
I have an admin role which uses the Full HTML format.

When the admin edits a node and saves the body (or any other full text field) with their default text format, Full HTML, then the editor gets:

"This field has been disabled because you do not have sufficient permissions to edit it."

How can I allow the editors to simply have permission to edit this locked field with their own editor text format?


texts: Ubercart - hook for modifying the order review page

texts:
What's the ubercart hook for modifying the table when visiting: /?q=user/%/order/%

I'm looking to remove columns in the orders node.


texts:
I'm looking to start using simpletest (or possibly go to pressflow) to test some Drupal modules I am working on.

I would like to get some information about the code that is covered by these tests. I have seen that it is possible to get this information from xdebug.

I have also seen these code coverage reports, but have no idea how they were generated.

Are there instructions on how to set this up anywhere? (Ideally for D6)


texts: What is the meaning of $form['cid']['#value']?

texts:
/**
     * @Implement of hook_form_alter()
     */
    function mycaptcha_form_alter(&$form, &$form_state, $form_id) {
     if ($form_id == 'comment_form' && !$form['cid']['#value']) {
。。。。。

Someone has written the above code, but I don't know what $form['cid']['#value'] is for, and what I should use in Drupal 7.


texts: Change content in page.tpl.php depending on the page

texts:
I am creating a custom Drupal 7 theme and I have an image slider within page.tpl.php, I want to be able to change the images that it is cycling through depending on what page it is on.

I'm using the Views module with Views Slideshow.

If anyone can point me in the correct direction I will be very thankful.

Cheers,

Luke


texts: How to change url webform entry textfiled to link in views?

texts:
I have url data (for example http://testtt.infoo) submitted from webform (component textfield).

When I display by using Views, this looks like text. I hope I can click it and open the url site.

What should I do to make that url data displayed as clickable link.


texts: How to debug queries and exports sent to Salesforce?

texts:
I'm using Salesforce Suite module.

My initial investigation says that the connection is encrypted via HTTPS.

Is there any easy way of debugging what is exactly sent to Salesforce?

I ended up by tracing the code via XDebug, but it's useless on environment which doesn't have it.

The module uses SalesforceSoapClient.


texts: Theming two instances of an input field in one form

texts:
I have two instances of the Search form in one page. The search field needs to have different CSS classes in each instance.

Instance 1:

<input type="text" class="form-control input-foo" placeholder="Search">

Instance 2:

<input type="text" class="form-control input-bar" placeholder="Search">

All the relevant theme templates and preprocess functions that I can find to edit the classes output on the field, apply to both instances. E.g. input--search.html.twig.

For the time being I have instead applied a class on the block that each of these forms is contained in, but I'd like to know if there's another solution.


texts: Drush makefile downloading 7.x Dev instead of stable

texts:
I have drush makefile that I use to kick off new Drupal installs:

my_profile.build

core = "7.x"
api = "2"

projects[drupal][version] = "7.x"
; ... grab install profile

When I run drush make my_profile.build it downloads the 7.x-dev version of core instead of stable. I knew that I code force the download of dev versions with projects[drupal][version] = "7.x-dev" but how do I make sure that it only downloads the stable version of a project? My drush version is 5.7.


texts:
I have a content type which is being managed by Workbench Moderation. This content type has entity reference field. The full page override has been Panelized and has a view pane which displays fields from the referenced entity.

When viewing the published content this all works fine, however, when viewing the 'draft' version of the content using Workbench Moderation the View Pane is obviously only using references from the published revision with the consequence that editors cannot see the affects of their changes, ie adding additional references.

How can I configure the View pane so that it will always list the the referenced entities from the currently viewed revision?


texts: htaccess 301 redirect everything except /admin

texts:
I have been scratching my head for almost half an hour already because of this. I don't know what I am doing wrong, might just be under my nose, but i just cant see it. Here's what I have on my .htaccess

  RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

  RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  RewriteCond %{REQUEST_URI} !^/admin [NC]
  RewriteRule ^(.*)$ http://newsite.com/$1 [R=301,L]

When I access example.com/admin, i am still redirected to newsite.com/admin.Can anyone please advise? Thanks!


texts: Specify on which subdomain to show node (Multisite with shared Database)

texts:
I'm using multisite with shared database. Is there any way I can specify on which subdomain I want the content to be displayed (on node creation)?

So If I create a node, I would like to have checkboxes that say (subdomain1, subdomain2, subdomain3).

Thanks in advance


texts: How can I create search with views to serch between 2 fields

texts:
I create a plain field for body and a plain field for description.

now create view to search between title, body and description.

I use "Combine fields filter" but in "Choose fields to combine for filtering" box just show "Content: title".

I add body and description fields in fields section, but not change.

Who can help me ?

Drupal 8


texts:
I can generate urls to forum topics fine, but pathauto appears to be stubbornly refusing to generate urls for Forums and containers no matter what patterns I try to use.

I even tried to alias them in core alias - as suggested for Drupal 7 here -  but aside from the fact that the pages then returned 404 results I will probably have users adding forums in the future so really need to be in a position to generate them.

I want my forum urls to be of the form /private/discussion/forum-name and I would like to be able to have my container point to /private/discussion and see a list of the available forums there. Or at least alias the main forum output page.


texts: Programmatically Change Pager "Items to Display" value?

texts: I would like to create a custom form to allow a website admin to quickly change the number of "Items to Display" for a particular block display for a particular view, but I don't have a clue how to change this value programmatically on my own, besides the views ui?


texts:
I'm trying to get a menu working in Bootstrap that has the following functionality.

In the example image, the menu structure is:

Self Knowledge(parent)
 - Assetments & Quizzes(child)
   -- Quizzes & Tools(child2)
 - Workshops(child)
   -- Education(child2)
etc..

When the mouse hovers over "Self Knowledge" everything is activated.
I've got the hover part kind of working as the menu activates on mouse over but only shows the first set of child items, but not the second set.

Any direction or pointers would be greatly appreciated.

Update:

I've installed TB Mega Menu and it's gotten me very close.

I've searched everything but I think I'm using the wrong search strings.  Is there a way to get the menu to slide right when the primary links hovered over?  I have the mega menu in the primary block on the left.


texts:
Kindly assist me in solving this error. It appears once I try to run update.php

  Fatal error: Class CToolsCssCache contains 1 abstract method and must therefore be declared abstract or implement the remaining methods

This is how my css-cache.inc file looks like;

<?php

/**
 * @file
 * Custom cache implementation for the CTools CSS cache.
 */

class CToolsCssCache implements DrupalCacheInterface {

  /**
   * {@inheritdoc}
   */

  public function clear($cid = NULL, $wildcard = FALSE) {
    // Only clear the caches if the wildcard is set, this ensures that the cache
    // is only cleared when the full caches are cleared manually (eg by invoking
    // drupal_flush_all_caches()), and not on a cron run.
    // @see drupal_flush_all_caches()
    // @see system_cron()
    if ($wildcard) {
      ctools_include('css');
      ctools_css_flush_caches();
    }
  }

  /**
   * {@inheritdoc}
   */
  public function get($cid) {
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function getMultiple(&$cids) {
    return array();
  }

  /**
   * {@inheritdoc}
   */
  public function isEmpty() {
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function set($cid, $data, $expire = CACHE_PERMANENT) {
  }

}

I think it is affecting the site such that any updates done cannot display on the live site. I will really appreciate your help.


texts:
I'm creating a view, and I've pulled in the sticky to top of lists field, as well as a view conditional field. I want to determine if "sticky" is true, and set a value (so I can add it to a custom field as a css class, for styling purposes) i.e., "stickyitem" if true, nothing/null if false.

I can't seem to get that in the conditional field. I've tried:

Not empty, which makes it show everywhere
Equal to 1, which seems like the correct choice, but it doesn't work
Equal to true
Equal to yes

What else could it possibly be? Maybe using equal to is the wrong choice.


texts: Views - how to filter a result set based on a URL filter that affects an API call?

texts:
I have a View with a Rest Export display returning entities. I have a custom Normalizer class for it that crafts the object the way I want it in the response.

The node entity in the response has some custom data attached to it coming from an API (think operating hours). I am being asked that if someone clicks on 'Open Now' in the filtering form (not yet created), then anything not open should not be shown in the list.

Is there some way I can add a custom filter or hook into Views and look for this URL parameter and exclude a result from the list if it is not open? hook_views_pre_render and hook_views_post_render don't seem to fire, I assume this is because I am using Serializer format.


texts: Views: apply filter only if a condition matches

texts:
I've searched a lot the Views issue queue, searched for other modules, searched on stackexchange, but it seems that no one needs this functionality (or that there's another way to achieve it).

Use case:
I have two content types: lecture and substitute teaching. A teacher uses the lecture content type when he has a normal lecture in a class where he has a chair. A teacher uses the substitute teaching when another teacher isn't at school (ill or in an excursion) and he has to replace the colleague.

In the lecture content type I have put an entity reference field named "chair", which filters the chairs so only the tearcher's ones are shown. For doing this I use the entity selection section of the field, and pass via token the teacher's uid to the view. But in the substitute teaching content type, I don't want to filter the chairs. Since a teacher could replace anyone, I need an unfiltered list of chairs.

Since the entity selection part of the field is applied everywhere this field is used, I had to create another entity reference field in the substitute teaching which references the chair content type, but without filtering. Having the same content type pointed, but using two different fields, is leading to maintenance nightmares (put both the content types and filter them based on chair field is nearly impossible), so I'm seeking for a different approach.

I think that a good one would be to pass to the view the uid and the content type. If the content type is "lecture", then apply filtering, otherwise don't. In this way I could use the same field in both the content types and everythig would work smothly. Well, it seems impossible to do such a simple thing.

The only solution that got me near the desired result was using conditional fields, but when filtering I got a bunch of empty option values where the view result was hidden, but it was selectable.

Any help or hint would be appreciated. Thanks!


texts:
I am using a Webform module to create a form to which I would like to add recaptcha. I've gone through the readme files for both captcha and recaptcha modules and all the configuration settings look fine.

The only thing I am unsure about is on admin/config/people/captcha general settings page.... I am trying to add a new form id to reflect my webform (webform-client-form-25) but it won't accept it. It says "Illegal form_id".

I've got the public and private keys set.

Skip CAPTCHA is NOT selected for any role.

From the view source:

How do I get the recaptcha working for my webform?


texts:
Inside the template.php I have this function:

function bootstrap_theme(&$existing, $type, $theme, $path) {
    bootstrap_include($theme, 'theme/registry.inc');

    return _bootstrap_theme($existing, $type, $theme, $path);
}

I'm doing a migration from an old Drupal which has $hooks inside, and I need to move these hooks to my bootstrap_theme, the $hooks are these ones:

    $hooks['user_login_block'] = array(
     'template' => 'templates/user-login-block',
     'render element' => 'form',
    );
    $hooks['block__system__user_menu'] = array(
     'template' => 'templates/user-menu-block',

    );
    $hooks['user_register'] = array(
      'render element' => 'form',
      'template' => 'templates/user-register',
    );

     $hooks['user_pass'] = array(
      'render element' => 'form',
      'template' => 'templates/user-pass',
    );
return $hooks;

How can I mix them without using a sub_theme boostrap


texts: Is it possible to define default config entities in a single yml file?

texts:
Following drupal handbook I've created configuration entity type. All works fine except that I have to create ~100 default entities. It would be significantly easier to maintain these default entities if I could define them in a single YML file but that does not work as expected.

If I create files like this:

config/install/example.entity.id1.yml
config/install/example.entity.id2.yml
config/install/example.entity.id3.yml

The config entities are created correctly. However if I create one file config/install/example.entity.yml:

id1:
  field1: val1
  field2: val2

id2:
  field1: val1
  field2: val3

id3:
  field1: val4
  field2: val12

Drupal creates simple config with key example.entity. I'd expected it to create config entities as defined in schema file.

It would be real pain to manage those default config entities with 100 separate files instead of having everything in one yml file. Is this expected behaviour?


texts:
I have two node types (one is galleries, one is images). The node types are referenced to eachother via entity reference (which is providing a field on the image node which references a gallery).

I want a user to be able to flag one image in a gallery which will become the 'cover' of the gallery. I am attempting to do this from a combination of rules + flags; I have a flag set up which can flag images.

The tricky part here is referencing the image to the gallery entity, and only allowing each gallery to have one flagged image. (i.e. galleries can't have two covers).

The rules part is tricky, and it would be awesome if I could get some assistance.

I am aware that the first step is the 'event'. Once an image is flagged, it should unflag other images that reference that gallery (via trim a flag). Haven't been able to get it set up. Anyone have experience with this? Thanks!


texts: How to display the form fields of content type in a table using custom template file?

texts:
I have created a content type Article including the fields Field 1, Field 2, Field 3 ......

All these fields have multiple values. I also created the custom template for this content type.

Now I want to display all fields of the form in a table and use only one button Add another item to add a line for all the fields.


texts: How do I alter summary attributes from long-text-with-summary, like help text, number of form rows, and label?

texts:
How can I change* the number of rows "Summary" gets displayed with on forms (from Long Text with Summary data type), or alter its label or help text? These are settable for the "Long Text" part, but not for its corresponding summary, if you choose to enable it.

*Properly, not with js ;)


texts:
What is the easiest way to select a template based on path alias. For example, if I have the following URLs:

http://www.example.com/mydirectory/page1
http://www.example.com/mydirectory/page2
http://www.example.com/mydirectory/page3

How would I go about creating a template for all of the pages in mydirectory? I should also add that using content type to theme these pages is not an option.


texts: Can't connect to a remote MySQL during installation, drupal uses unix_socket instead of host?

texts:
I'm installing a drupal site on a cloud, which has a remote database cloud service.

But I found that drupal seems ignore the host I give and use unix_socket to connect the remote database.

Here is the Set up database screen during installation. I'm sure database name, username and password are correct. I have try ip address and domain name in the host field. The socket field leaves empty.

And I got:

  Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2002] Invalid argument.

I'm not familiar with PHP and mysql, I don't know a better way to find out what Invalid argument is. I So I do some grep and add some print_r() in [drupaldir]/includes/database/database.inc:

$driver_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
print_r($dsn);print_r($username);print_r($password);print_r($driver_options);
// Call PDO::__construct and PDO::setAttribute.
parent::__construct($dsn, $username, $password, $driver_options);

This is what I got (add a few line break, and replace the real name and password):

mysql:unix_socket=;dbname=demo_db
demo_username
demo_password
Array ( [1000] => 1 [20] => 1 [3] => 2 )

Is this mean, Drupal installation ignores the host what ever I give and just use unix_socket even it's empty?


texts:
Maybe I'm not getting this but for Page manager (Panels) there is two options to create a page either Custom Page or use the System (Node Template).

I need to create a Panel for the news page (/news). I could either create a Custom one and set the path to "/news" OR use the System node_view page and create a Variant where if the Selection rule = This panel will be selected if Current path is "news".

Which way is better? Should I overload the System with many variants where one of them checks if the Current path is "news" or create my own Custom Page for the news page?


texts: How to I add translations for Month and Day in a date field?

texts:
I am working on a Drupal 7 site that will be in English and Inuktitut.
I have the i18n internationalization module installed. It does provide Inuktitut as a language option, but there are no available translations for Inuktitut.

I can see the options to localize the date format, but I need to be able to translate the months and days. How do I do this?

I'm looking for

Monday = naggajjau

Tuesday = aippiq

...

January = jaannuari

February = viivvuari

and so on.

Thank you


texts:
I have three things:

A user (User entity)
A league (Node)
A league entry (Node, with a numerical field for time and a noderef field to a league)

A user can create a league entry node, and set a time value and a node reference to a league node.

I want to produce a view that takes the league node id as an argument, and produces a table row for each user that has submitted a league entry node. The columns will be the user name, a user field that states the user's team, and finally, for every league entry node raised by them as author, that contains a node reference to the current league nid, a sum of the matching league entries numerical fields.

Now as you can imagine, doing this in views is very problematic because of aggregation issues on a single field; so a simpler alternative is to simple create a new DB table that stores the data I want to display in distinct fields.

So if I have a DB table like:

username, league, total of league entry nodes time value so far

How can I get this info into views so I can take advantage of table display, column sorting, and all that good stuff?


texts: How do I let users view, edit or delete their own contents?

texts:
I am working on a website where there will be users publishing contents.

How can I restrict users from accessing other users' contents and only able to view, edit or delete their own contents?


texts:
I have a custom module with a menu entry that has a page callback and a access callback. However, every time I visit any page, the access callback is evaluated. Could somebody enlighten me?

function foo_menu() {
  $items = array();

  $items['foo'] = array(
    'page callback' => 'foo',
    'access callback' => 'foo_access_callback',
  );

  return $items;
}

function foo() {
  //...
}

function foo_access_callback() {
  error_log('This gets evaluated on every page.');
  return TRUE;
}


texts:
I have a type of recipe content and I would like google to display additional information in its results.

There is a built-in module to Drupal 8 "RDF" but I can not find anything to configure it on my fields.

How does it work ?


texts: Gmap cluster different marker types seperatly

texts:
I created a Gmap with the Gmap module and views. There are two different marker types, based on different Gmap marker fields in the used node types.

The markers are clustered with GMaps Utility Library MarkerClusterer. And I added a MarkerClusterer styles in JSON. This results in clustering all markers regardless the marker type.

How to get each marker type cluster separately?

Is this something for OpenLayers?


texts: drush user-block feature and 'You do not have permission to block'

texts:
I'm trying to use drush's user-block feature and I'm getting following error:

# drush -r . -l fqdn ublk 'user.email@host.tld.dev'
You do not have permission to block user.email@host.tld.dev.           [error]
#

I'm doing it from shell and I am root, so I'm not sure which permissions is it talking about.


texts: build custom field in comments in drupal 6

texts:
i uses drupal 6 and i created new module.
i want to add a custom filed in comments form programmatically.
but i can not save my data in database .please help me

function mymodule_form_comment_form_alter(&$form, $form_state) {
$options = array(
    '1' => t('Yes'),
    '0' => t('No'),
    '2' => t('Empty')
);
$form['answer'] = array(
    '#title' => t('Your Answer'),
    '#type' => 'radios',
    '#required' => true,
    '#options' => $options,
    '#weight' => -1,
    '#default_value' => 'Empty'
);


texts: How does Drupal ensures that the one time unique URL used to reset user password does not get transferred away inside the http_referer header?

texts: For example in case the site relies on and loads some external JS (such as jQuery via CDN). Quite technical but any insights are highly appreciated. Thanks.


texts: How can I tell boost cron run to delete a file

texts: If I have a custom module that maybe adds some fields, or reorders some data which is to be shown in the frontend: How do I tell boost, that the cached files should be deleted on the next cron run after I've made some changes?


texts: How do I remove frontpage content block?

texts: I am trying to remove the main page content page. I made a views slider (block) which I then displayed on the frontpage. However, I am finding it difficult to remove the mainpage content block. I am using drupal 7 and the zen subtheme.


texts: Show all child nodes of a taxonomy term D7

texts:
Ok, so I've been ripping my hair off for the past 2 days now.
I'm developing a web-site with a car catalog which contains the following hierarchy (taxonomy hierarchy):

-brand1
--model1
--model2
--model3
-brand2
--model1
--model2
--model3

...and so on.

What I'm trying to achieve is when a user selects a parent term (brand), they'll see all the nodes from all the children terms. Currently a parent term doesn't display anything.

I already Googled my problem but none of the solutions seem to work for me (or it's possible I'm doing something wrong).

My configuration is as follows:
Drupal 7.2x
Views 3.7
Taxonomy Menu 1.4 module - used for generating menu trees from vocabularies.
Pathauto 1.2

I use views to display the whole vocabulary - and it works as intended.

Can some one please give me a step-by-step guide on how to achieve this? Especially if it involves Views, as I'm still a noob with Views.

Is it possible the Taxonomy Menu module is causing trouble?


texts: How do I change the HTML structure of the primary links in Drupal 7?

texts:
I read what reported in How do I change html structure of menu (primary links for example) to my own? but the accepted answer for that question is for Drupal 6.

How do I create a function that adds a CSS class or ID to a single "li" and "sub li"?


texts: How to uninstall a text format created by a D8 module?

texts:
My module creates its own text format upon installation by having a file named config/install/filter.format.{format}.yml.

However, I can't uninstall and reinstall the module, because the format persists and will then cause a conflict. ("... already exists in active configuration.")

This looks like a bug in the filter API, but maybe there is some explicit way to delete the format when the module is removed? It's really annoying to have to manually delete the config key every time.


texts: Checking if user logged-in by external script, fails

texts:
With a script on an external webpage (same domain), I need to detect whether the user that's visiting the page is or not logged in.

[EDIT]
This occurs when the script is into a subfolder.
If it's put into the root folder, it works fine.
[/EDIT]

<?php
define('DRUPAL_ROOT',$_SERVER['DOCUMENT_ROOT']);
require_once DRUPAL_ROOT.'includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
global $user;

if(user_is_logged_in()){
    echo "logged";
} else {
    echo "not logged";
}
?>

despite the fact I'm logged-in, it returns always I'm logged out.
Var_Damping $users, I get this

object(stdClass)#17 (4) {
  ["uid"]=>
  int(0)
  ["hostname"]=>
  string(12) "XXX.XXX.XX.X"
  ["roles"]=>
  array(1) {
    [1]=>
    string(14) "anonymous user"
  }
  ["cache"]=>
  int(0)
}

where XXX.XXX.XX.X is the IP of the server
and I should be logged in as Administrator (user 1 )


texts: how to use URL_ALIAS for search result of apachesolr module?

texts:
I am using apachesolr in drupal 6.22 module to search. the links of the results look like http://mywebsite.com/node/NID , how can i manage it to show the url alias instead of displaying node/NID representation.
Thanks for your help


texts:
I have created twig template to override SELECT element for SELECT-element in user exposed filters.

However I can't figure out how to make it only work within a specific view "testing" ?


texts: How do I implement Ctools plugins from other modules?

texts:
I have a module which defines a plugin. Using this code, I can easily load the plugin:

ctools_include('plugins');
ctools_get_plugins('mymodule','myplugin');

That works great, but I would like my module to use plugins from other modules of type 'myplugin'.

I can only seem to get it to load plugins defined by the module provided in the first argument whereas I want to get all modules that provide plugin "myplugin", is there any way to do this?


texts:
Is there a way to get the unpublished date of a node? I want the date of unpublishing of nodes to be displayed in the view in a grid.

I need it non-programmatically (ie, tweaking the UI), but if it is only available programmatically, then how do I display it in the grid view?

A total Drupal noob here. I am using D7 btw.


texts: What is the replacement pattern in rewrite ouput for current user id?

texts:
I have a custom content entity listed with Views.
I want to conditionally display some information depending on the fact that the row is related to the current user.
I tried {{ user:uid }} with no success.
Any idea?

With help from @4k4, I could use 'Custom text' to add on each row of my Views output two 'buttons' (Edit, Delete) depending on the current user:

{% if user_id_1=="[current-user:uid]"  %}

{% endif %}

As you can see, there is also a button in the header (Add).
I'd like to have this button displayed only if the user is not anonymous.
I tried (in either Text area or Unfiltered text):

{% if "0"=="[current-user:uid]"  %}
Ajouter
{% endif %}

but it doesn't work:

Any idea why?


texts:
I have been reading Form API Quickstart Guide. I understand how it all works, but I don't understand how to save the data entered into the forms into my own database Drupal style.  Or am I supposed to use good old standard PHP to connect to the database to insert the data as required?

Is there a similar page to the form API quickstart page showing how to integrate a module with a database?


texts: What are common methods of intrusion into a Drupal website?

texts:
I am running Drupal 6.28 that was recently hacked and there were scripts being executed out of the /tmp directory, apparently running a bitcoin mining server and other brute force scripts.

I would get random processes sometimes 2-4 at a time that would each consume over 100% cpu(core) for an indefinite period of time. Which would make sense if they were running some type of bitcoin mining operation or brute force attack.

To the best of my knowledge the attacker uploaded a file named 32.tar.gz to the site. Drupal moved this file to the /tmp directory, then attacker extracted into the same /tmp directory, which has 777 permissions.

I would gladly change the permissions on this folder to something more sane like 755, but in doing so, Drupal stops functioning properly.

All files/folders in my drupal install directory are owned like: myUser:www-data, where www-data is the user that PHP/Apache is running as.

The /tmp folder is owned by the same user and group, so I would think that it would be writable at 755, but that just isn't the case for some reason. Is there a way to harden the security of the site that would prevent this from happening?


texts: Are there any naming conventions for helper functions in modules?

texts:
I'm writing a module and I need to create an auxiliary (helper) function, but I don't know which is the best name to my function.

Should I name my function like:

function _MODULE_my_function

or:

function MODULE_my_function()

I usually use _MODULE_my_function() but there is a standard for this?

There is not reference about this in the Drupal Coding Standards or in the Naming your modules, functions, and variables article.


texts: Facing Repetition in records when I use multiple relations in Views

texts:
I am trying to use views fetch the News and Articles for display on my custom content type "Industries". On Industries content type I have node reference fields to the News and Articles content types.

I've added two relationships in 'advanced' section and in Contextual filter selected Content: NID. I also enabled Distinct > pure distinct settings in the query settings section.
View's Snap are Here : http://prntscr.com/b8mrmp

But still the records are repeating. If 6 news and 10 Articles, then each article is listed for each news node.
Result : http://prntscr.com/b8mscg


texts: Are updates applied across multiple sites?

texts: When running updates for core and modules in a multisite configuration where modules are shared (sites/all/modules), are database updates applied across the multiple site's databases or do you need to run updatedb for each?


texts: How to do swatches for drupal commerce product variations

texts:
I am trying to add swatches to the product variations for drupal commerce. Ideally it would be a single image that changes based on the selection of something in a dropdown. If not that then maybe the image next to the title in the drop down. I looked into commerce fancy attributes module and it turns the drop down into a list of swatches which isn't exactly what I'm going for.

This sounds like something that could be done with ajax but I'm not sure how to do it.

If anyone knows how to do this some guidance would be much appreciated.


texts: List of User's Comments - show one latest comment on node only

texts:
I have a views block that lists a user's comments on the site.

For example user JohnA has posted 5 comments total on the site like so:

Node 1: 2 comments
Node 2: 1 comment
Node 3: 2 comments

In my view, I want to create a list of nodes that JohnA has commented on with the following Format:

Node Title

By Node Author

You commented on this 2 months ago

However, when a create a view and add the field Comment: Post Date, Node 1 and Node 3, which JohnA has commented on twice, show up twice (because JohnA has two values for that field in this context).

The view works fine until adding any comment specific field, such as comment post date, comment body, etc...

I'm thinking about using the Views View Field module as a potential solution. I feel like there is a simple solution that I am missing.

Any help would be greatly appreciated.


texts: How to deny access to invalid $_GET parameters

texts: For example, there is a pager with 10 pages. How to deny access if $_GET['page'] is bigger than 9 or is not numeric?


texts: How do I create a custom administration sub-theme without the tools block name collision?

texts:
A subtheme was created using the drupal console in order to customise the mediteran administration theme.
vendor/drupal/console/bin/drupal generate:theme --base-theme mediteran

When I try to install the theme I get
Drupal\Core\Entity\EntityStorageException: 'block' entity with ID 'mediteran_interlated_tools' already exists. in Drupal\Core\Entity\EntityStorageBase->doPreSave() (line 490 of
core/lib/Drupal/Core/Entity/EntityStorageBase.php).
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 263)
Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object) (Line: 395)

The tools menu is then lost. How do I create a subtheme with the tools menu?


texts: Not able to connect to remote database after migration

texts:
I am moving a running site from staging to production. The production environment has 2 servers, one for frontend and the other for the database.

The issue is when I try to browse the website, I get this error

  PDOException SQLSTATE[HY000] [2002] Permission denied in [ROOT]/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php on line 79

The real problem is I am sure that the database connection is set right. Permissions and ports are set right.

I tried the same database connection info from an external PHP file on the same server and I got successfully connected.

Also, I tried drush st and it told me that database status is Connected, and Drupal bootstrap status is Success.

Even tried drush sqlc and I got connected to the remote database. I can list tables, execute queries, etc.

Any ideas what might be the problem?


texts: How do I send a customized email to subscribed users?

texts:
I have a post job content type. When an employer posts a job, all the registered users, basing on the job category (taxonomy), should receive an email about the posted job.

How should I implement this?


texts: Granting access based on an entity reference field using rules

texts:
I have two content type one called audit and one called non-conformance, a non conformance is raised after an audit has been complete.

An audit contains an entity reference field called auditee which references a user, I would like to give edit access to the non conformance based on the the content of the auditee field in on the content type audit.

Thanks


texts:
I am using the BigBlueButton module for conference in Drupal 6. I also installed the server.

The demo code (http://demo.bigbluebutton.org/demo/demo10.jsp) is properly executed. I passed record=true in my API.

How do I enable recording option in the BigBlueButton module?


texts:
I'm starting a new Drupal 8 project. As first steps I need to choose a theme. So far, I have only experience with Bario, chosen initially for using Bootstrap 4. I'm now looking for a theme that's not using Bootstrap.

I'm considering extending Bartik. Is this correct, or should I extend a different theme?


texts: How to change the "Add new comment" message for custom comment form?

texts:
I have custom content type called books that represents a book that can be reviewed by using a custom comment type called reviews.

My problem is the comment form title above the comment form shows as "Add New comment", which I need to change as "review the book".

How can I change this to read as "review the book"?


texts:
I'm currently porting a Drupal module from 6.x -> 8.x. One of the lines in that module:

  cache_clear_all('##NAME_OF_THE_BLOCK##', 'cache_block', TRUE);

The cache_clear_all method does no longer exist in Drupal 8.x. I cannot find now where the 'cache_block' is situated. I'm looking for a way to flush this cache - and I don't want to flush 'all' cache ...

Any idea's what the D8 equivalent of this line is?


texts:
Somehow while converting my D8 site to a composer based site, I ended up with the modules in the sites/modules folder as well as in the sites/modules/contrib folder. When I delete the module folders from sites/modules I get the WSOD. Composer says there is nothing to update, so the modules within the contrib folder are OK.

How do I get the system to recognize the modules in the contrib folder over the modules folder, so they can be deleted?


texts: Create view gallery, with page for every image

texts:
I have a node "Event Gallery" that has a multiple unlimited image field that I load up to 50 images into for each event.

In manage display, I set the image field as hidden, and instead, I use a views block with a content by ID filter, and the block visibility set to all node type > Event Gallery.

In the past I have used something like colorbox to let users scroll through the gallery, which looks nice, but does not function well when you want visitors to be able to "share" or "like" an individual photo, and for that individual photo to have its own url.

In the image field settings, you can make each image in the gallery link to its file, but I want the file to be shown in the theme, and have its own url.

How do I attach a page to my block view, to show every image of the gallery on its own page, with previous & next links (pager), and for every image to have its own url?


texts:
Just that, Is there a Drush command to check the distribution version?

Let's say I have installed the commerce_kickstart distributionn, how do I check the version of this distribution with Drush?

this one doesn't work:

  drush pmi commerce_kickstart


texts: How to modify attributes of fieldset-wrapper?

texts:
It's similar and connected to How to modify attributes of  in form definition function? - This time I want to ask how to modify attributes of a
. HTML structure of a fieldset is:

<fieldset id="some-id" class="well-small form-wrapper vertical-tabs-pane">
  <legend>

      Lorem Ipsum

  </legend>

</fieldset>

I need class well-small directly on a fieldset-wrapper div. But if I apply it to a fieldset itself, it appears when you see it in sample above. When I move it one level down, well, there are only fields there, so it's one level too far instead of one level too close to the document root. Is there a way to conditionally add classes and other attributes directly from form building functions?

CSS and JS workarounds are out of the scope for me. I know how to work around it. Now I'm asking to know how to do it directly in PHP.


texts: How do I relate two similar text fields between users and content with user as argument?

texts:
Getting a bit mixed up and need help with this. My restrictions are that I cannot use entity reference fields (or any reference type field); this is because Salesforce Suite isn't able to translate single strings to the array object normal reference fields use upon import and object creation.
I have two entity types, User and Content, which are dynamically created via the Salesforce Pull module. Both entities share a plain text field (SFID), which is the user's main ID.
The Content nodes' SFID field value can match any user's SFID field value, and I want to create a view that lists nodes on the user's page related in this way.
For example, I have the following users and nodes.

User 5
SFID 120

Node A
SFID 120

Node B
SFID 130

Node C
SFID 120

On /user/5/mynodes, I need a list of the nodes whose SFID matches the user's SFID. In this case above, the page would list the following nodes:

Node A
Node C


texts: How to convert Drupal Field Collection to Node?

texts:
I am using Drupal 7 and have a Field Collection that I would like to convert to a custom content type (Node) with the exact same fields. What is the best way to do this? The field collection has the following field types: Postal address, Geolocation, Term reference, Text, Office hours, List (text), Integer.

Unfortunately I am running into too many issues with some of my fields and the Field Collection module. For example, I cannot create a View and use "Has taxonomy terms (with depth)" on a term reference inside a Field Collection. If I switch to two separate fields for the taxonomy term (e.g. State and City) and try using the Reference field option limit module, the fields do not update inside a Field Collection.

I created a custom content type and have successfully been able to create and access the data as needed using Inline Entity Form. Can I modify the database directly? I noticed the Field Collection items do no exist in the Node table. I can create entries in the Node table but I'm wondering if I'll be missing something.


texts: Exporting block settings in a Feature (Drupal 7)

texts:
I am trying to learn about creating a reasonable workflow between a development site and a production site and I have decided to use the Features module to help accomplish this task.

On my front page I have a couple blocks that display newly added and top rated content.  I have used features to export these views but I do not see anyway inside of the Features module to export my block settings.  I set the new projects and highest rated blocks to show up in the content section of a page. I filter it to only show up on the front-page inside the view.

How to export these block settings inside my feature so I do not need to reconfigure them on each site?


texts: How do I place connect a template to a certain content type

texts:
As the questions says, how do I perform this and how do I render certain fields at certain spots placed in the template file?

I already got it so that everything is placed by using

  {{ page.content }}

But how do I do something like:

  {{ field_textblock }}

In where the given input in that field would be display on the site.


texts: Taxonomy menu with a large list of terms

texts:
I want to display a list of terms and child terms using Taxonomy menu,my list is very large ( more than 2000 terms), and Im getting this error:

Additional uncaught exception thrown while handling exception.
Original

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT * FROM {system} WHERE type = &#039;theme&#039; OR (type = &#039;module&#039; AND status = 1) ORDER BY weight ASC, name ASC; Array ( ) in system_list() (line 165 of C:\wamp\www\Books\includes\module.inc).
Additional

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] =&gt; theme_registry:runtime:adaptivetheme_admin:cache ) in lock_may_be_available() (line 167 of C:\wamp\www\Books\includes\lock.inc).
Uncaught exception thrown in session handler.

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in _drupal_session_write() (line 206 of C:\wamp\www\Books\includes\session.inc).
Uncaught exception thrown in shutdown function.

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] =&gt; 14337154844f4e188d884c54.86419408 ) in lock_release_all() (line 269 of C:\wamp\www\Books\includes\lock.inc).

Is this because Taxonomy menu can not handle a large amount of terms?


texts: When a node has multiple locations (using location cck), is it possible to filter location results in views based on only one field?

texts:
I have a content type with multiple location types attached:

loc_past (Places I've been)
loc_now (Where I am now)
loc_future (Places I'm going)

When I create a view that shows nodes of the content type, the node is shown once for each location in each field.  However, I would like to limit the results to one field (for example, show results only for where users are now).

Is there a way to configure Views/Location to do this?


texts: adding panel to select field in content type

texts:
I created a content type for a new block. One of the fields in this needs to pull in category information from a magento site. I have code to get all of the categories and display them in a drop-down working in a panel template.
The only step I am missing is know how to access this as a field in my new content type. I have read some articles about using something called hooks for this process but I'm not fully sure about how they work.
Is a hook the best method and if so what exactly does it involve programmatically?


texts:
I have created a custom form for login page. When a user logs in, I want to redirect the user to some other page, different from user/<user_name>.

How can I perform such redirect?


texts: How to pass same taxonomy from one view to another view

texts:
I am using nodegallery, node gallery jcarousel modules to create an image gallery.

I added taxonomy to gallery, when i click the image in gallery it will display the image with jcarousel, but taxonomy is not enabled to jcarousel, it showing all the images of the gallery.

please advice me to enable the same taxonomy to jcarousel also.

thnx.


texts: How do I customize hierarchical breadcrumbs?

texts:
The breadcrumbs I get are like the following ones.

Home / services
Home / service 1
Home / service 2

I want to change them to the following ones.

Home / services
Homes / services / service 1
Homes / services / service 2

How can I change the breadcrumbs to be the way I want them?


texts: How to use field.tpl for rendered node in views3

texts:
i have set up a view (drupal 7) with a field that rendered the full node (node referenced field), and i want to get rid off the extra classes and tags wrapped around the fields.

i have copied field.tpl to my templates dir, and no matter what i name it it doesn't effect anything. I have selected that in the field settings in views. and yes, cleared the cache always.

would i name it after the content type. or the view.  i even left it at just field.tpl and still nothing.


texts: How to create additional drupal sites with a drush script

texts:
I'm using drush site-install for my initial site, and everything works great, but when I go to try create another site (using table prefixes so I can use the same database), drush attempts to drop and recreate the database, so I loose all the table from my first site. I know how to target drush to a particular subsite, but I'm not sure how to tell the drush site-install command not to drop the database tables.

Is there a better way to do this if I want to setup a initial site with 2 additional sites?


texts: Need help on adding options to $form via select field

texts:
I altered the username field in login block into a select field and now I'm trying to filter the usernames by their user roles via another Select Field.

function design_form_alter(&$form, $form_state, $form_id){

    $users = entity_load('user');
    $user_names = array();
    $acc = array("PH","SL");
    $rolePH = array();
    $roleSL = array();
    foreach ($users as $user_id => $user) {
    $user_names[] = $user->name;
      if (in_array('PH', array_values($user->roles))) {
        $rolePH[] = $user->name;
      }
      elseif (in_array('SL', array_values($user->roles))) {
        $roleSL = $user->name;
      }
    }
    $user_arr = array_combine($user_names, $user_names);
    if($form_id=="user_login"){
    $form['roles']['#type'] = "select";
    $form['roles']['#weight'] = -0;
    $form['roles']['#size'] = 'auto';
    $form['roles']['#options'] = $acc;
    $form['roles']['#title'] = t('Role');
    $form['name']['#type'] = "select";
    $form['name']['#options'] = $user_arr;
    $form['name']['#required'] = true;
    $form['name']['#size']= 'auto';
    $form['name']['#title']= t('Organization');

    }
}

I'm a bit stuck, as you can see, I already separated users depending on their roles. My problem is how do I set the $form['name'] options when a role is selected. Right now I'm just showing all users in the DB.


texts: For performance, one multi-value field or four individual fields?

texts:
I have a node content type that needs to store four different int values:

Score A
Score B
Score C
Score D

Each node of the content type always has all four int values.
I could store this one of two ways:

Store all four scores in a single Integer field that is limited to four values. (Set Score A to the 0 position, Score B to the 1 position, and so on.) (One field in total)
Store each of the four scores as its own Integer field. (Four fields in total)

From a usability perspective, it's easier to have four fields because it's more obvious where each score is, and configuring views is easier.
However, from the perspective of performance, which is better?


texts: Get cart items and check for product of type X

texts:
How do I?:

Get the current cart in commerce
For each item in the cart, check its product type?

I want to do the following:

foreach($cart_items as $item){
  if($item[product_type]=='X'){
    //perform a task
  }
}

I want to use this in the module code for a custom checkout pane.


texts: How can I write a unit test for a custom field formatter?

texts:
I'm working on a project where we need to have code coverage using phpunit.
I have a public method that includes this code:
  /**
   * {@inheritdoc}
   */
  public function viewElements(FieldItemListInterface $items, $langcode) {
    $elements = [];

    foreach ($items as $delta => $item) {
      $elements[$delta] = $this->viewValue($item);
    }

    return $elements;
  }

and dependent private method:
  /**
   * Generate the output appropriate for one field item.
   *
   * @param \Drupal\Core\Field\FieldItemInterface $item
   *   One field item.
   *
   * @return string
   *   The textual output generated.
   */
  protected function viewValue(FieldItemInterface $item) {
    $frequency = $item->getValue();
    return [
      '#theme' => 'frequency',
      '#frequency' => $this->switchWeights($frequency['value']),
      '#limit' => 5,
    ];
  }

I am trying to cover with unit test the parent method to make sure that it works as suspected. Here my code with no items provided to field to be formatted just covered with abstract class mock:
/**
 * Simple test to cover FrequencyFieldFormatter class.
 *
 * @group my_custom_module_name
 */
class FrequencyFieldFormatterTest extends UnitTestCase {

  /**
   * Test viewElements function.
   */
  public function testviewElements() {

    /** @var \Drupal\Core\Field\FieldItemList|\PHPUnit\Framework\MockObject\MockObject $field_list */
    $field_list = $this
      ->getMockBuilder(FieldItemListInterface::class)
      ->getMockForAbstractClass();

    $resultElements = FrequencyFieldFormatter::viewElements($field_list, 'und');
    $this->assertEmpty($resultElements);
  }

}

When i trying to change assertion to make sure that items field_items processed to be rendered with custom theme but i am facing difficulty when instead providing a mock for abstract class which is specified as interface i providing a mock for real class \Drupal\Core\Field\FieldItemList:
$field_list = $this
      ->getMockBuilder(\Drupal\Core\Field\FieldItemList::class)
      ->getMock();

I know that the error i am getting in this case is related to not initialized container for this stack:
There was 1 error:

1) Drupal\Test\my_custom_module_name\Unit\FrequencyFieldFormatterTest::testviewElements
ArgumentCountError: Too few arguments to function Drupal\Core\TypedData\TypedData::__construct(), 0 passed in /Users/username/Sites/drupal-site-09/code/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php on line 607 and at least 1 expected

Then i tried to initialize container to make it works but i do not know how to do it properly.
May somebody help me?


texts: Do fields that are not displayed affect rendering performance?

texts:
This is a general question about how Drupal renders content.  Say I have a content type with 20 fields, including some entity references, text fields, integers, and so on.
When I have a lot of fields on a content type, I know that each field slows down operations like saving the content type because each field has to be processed.
However, what about when Drupal renders the content type to display it?  If I hide 19 of the 20 fields on "Manage Display" for the content type, will Drupal avoid processing all those fields and have the same performance as rendering a content type that only has 1 field?


texts: Possible to use EntityStorageBase::loadByProperties() to specify that field is or is not empty?

texts:
Is there a way to use EntityStorageBase::loadByProperties() to specify that a field is either empty or not empty? I just want to check whether or not a field_date_completedhas a value set one it.

Looking to do something like $this->myEntityStorage->loadByProperties(['field_date_completed'=> notEmpty]) or $this->myEntityStorage->loadByProperties(['field_date_completed'=> isEmpty])

EDIT:
Sorted out a solution using the accepted answer. Per How get empty record on date field with entityQuery?, we can do something like

$query = $this->myEntityStorage
  ->getQuery()
  ->notExists('field_data_completed');

$entity_ids = $query->execute();


texts:
Our image styles are not getting created on one of the Drupal 7 sites in a multi-site installation. They are created for at least one of the other sites that uses the same Drupal 7 core.

Symptoms: Upon uploading an image to a node, the image preview does not get displayed (depending on the browser, a broken image placeholder may display). The image is not created in the file system either. I have verified file system ACLs. Both sites use the same .htaccess.


texts:
Assuming I have the following PHP. I want to add different effects to each of the ajax commands

function my_ajax_callback($form, $form_state) {
  $result = array(
    '#type' => 'ajax',
    '#commands' => array(
      ajax_command_replace($selector1, $html1),
      ajax_command_replace($selector2, $html2),
    ),
  );
  return $result;
}

I understand the default is something along the lines of:

ajax_command_replace($selector, $html, $settings = NULL)

However I do not know what to do with the $settings = NULL for a fade or slide to work. I've tried all combinations, but to no avail.

e.g.

ajax_command_replace($selector, $html, array('effect' => 'slide'),
ajax_command_replace($selector, $html, array('#effect' => 'slide'),
ajax_command_replace($selector, $html, 'slide')


texts: I'm trying to make a subscription product with "Commerce subscription products" module, so I've stuck here, on how to edit rule for subscription to last for 30 days, that is the first, part, second is, is there some good tutorial on rules, in drupal 7 ?


texts: Having a hard time finding documentation explaining in any depth how date caching works in Drupal 7. Adding a date field to a content type allows a checkbox option that says "Cache dates: Date objects can be created and cached as date fields are loaded, rather than when they are displayed, to improve performance." In what scenarios is it a good idea to select this option? How does it improve performance?


texts:
I would like to add a Facebook style or StackExchange style top navbar to my site. It should show the username, mini profile pix, userpoints, search box and a few other links.

Is there a module for that?


texts: How to include CSS from a vendor directory?

texts:
Is it possible to include CSS from a vendor directory? I need to include a CSS artifact from a Pattern Lab dependency.

Is it best to copy the artifact into the Drupal theme and just reference it that way?


texts:
For an intranet solution I would like to add a bunch of rather static links in Drupal to network files which change from time to time and are maintained by people not using Drupal.

To achieve this I used the link functionality of CKeditor:
Protocol
URL      file:///s:\Gloss.xls
target   popup window

When I throw file:///s:\Gloss.xls into any browsers address field it works perfectly (tried in IE, chrome and firefox) but from a Drupal node clicking on the link explained above, the browsers inspection reveals Not allowed to load local resource: file:///s:\Gloss.xls in chrome and firefox, only in IE it works.

What do I need to do to get it working in chrome or, at least in firefox?


texts: One exposed filter for many views/views blocks

texts:
I want to have one exposed filter and 2 blocks displaying different content types. They both have 'date' field and I want to show same-day content with one date exposed filter.

Anyone knows how to achieve this? Do I have to create one or two different views? How to share exposed filter (ie. field_content_type_1_date) with another content type (which has field_content_type_2_date field)?


texts:
I want to create a form for the backend in Drupal 7, something like the following:

label 1   text box
label 2   text box
label 3   text box
label4    image
image

I then invoke the form output in the front page and other pages.


texts:
I want to create a filter where companies are able to find users within eg. 10 kilometers using users added long/lat and the company's long/lat they have added.

I am using geolocation but how am I going to go about this?


texts:
Using webform 3 module, how to add logic to my multi-step form so that I can choose what to display on second step based on the choice from step1?

I have been successful doing this using Forms API, but then I loose the ability to do webform reporting(analytics). Is it possible to combine form (design, analytics and  validation) using "webform module" with logic using Forms API? or is there a better solution?


texts: How to dynamically change the CSS style of a node-type?

texts:
I want to modify dynamically the style of a page in base of your content type:
I tried with a preprocess function insert this code:

if(isset($variables['node'])){
  if($variables['node']->type=='article'){
    drupal_add_css(drupal_get_path('theme','my_theme').'/css/style_node_article.css');
  }
  if($variables['node']->type=='page'){
    drupal_add_css(drupal_get_path('theme','my_theme').'/css/style_node_page.css');
  }
}

This doesn't set the right CSS if I change page from article to page...
Thanks


texts: In Open Atrium is there a way to assign a user to a case that user is not in?

texts: I would like to be able to have an admin be assigned to a case that is in a group that user is not a part of. In Open Atrium. Is this possible?


texts: Changing the label of Change Password Form

texts:
How to change the form label from Password to New Password and Confirm password to New Confirm password on THEME_form_user_form_alter(without changing any twig files)? I had tried kint($form['account']['pass']) to see any possible way, no clue...

Current Change Password Form

Current password

|||||||||||||||||

Password (to New Password)

|||||||||||||||||

Confirm password (to New Confirm password)

|||||||||||||||||

function THEME_form_user_form_alter(&$form, $form_state) {
  kint($form['account']);
}

There are no #title element on pass field.


texts: how to add data to custom content type using node with codeing

texts:
i have drupal site with custom content type called donation and i have 4 step registration form which contains the data for the custom content type,i want to add forms data in to custom content type node how can i do that i try way like this

$nid = 1;
$node = node_load($nid);
$node->donationname = '.$data1.';
$node->donationitem = '.$data2.';
node_save($node);


texts: New e-commerce site: stuck with D6 Ubercart for now?

texts:
Client needs a shopping cart in a hurry. The spec is fairly straightforward, but will need weight categories for shipping and payments through Worldpay.

I'd love to do this with D7 and excited about Drupal Commerce, but I don't think it's there yet. I spent today playing with D7 Ubercart, and while it felt quite stable I don't think many contrib modules have been upgraded and I'm going to struggle.

So my instinct says build the thing in D6 Ubercart for now, then look to upgrade to Drupal Commerce further down the line. Sound like a plan?


texts: How to find content that uses a File (File Entity)?

texts:
Want to be able to see what content has file field(s) that refer to a specific file.

Is this do-able using a View (with Relationships)? (had a go already, unsuccessful so far).
Alternatively I'd query database tables (via the proper API) and relate that way, but just thought I'd ask if there is a generic solution before potentially re-inventing the wheel.

Searched a lot butn get a lot of unrelated search results. Search engine cannot seem to be told that I want my terms ordered in a certain way.

Ultimately I'd like to have a View that shows the Files and the content that uses each file. I would then be able to see the impact of deleting a file for example.


texts: The requested page "/user/password" could not be found. need to reset my password

texts:
I'm using Drupal 7.

For some reason my admin password on mysite wont work, when I click forgot pass word I a presented with The requested page "/user/password" could not be found.

I don't know what is causing the reset password page not to show, I thought it may be tabtamer but I disabled that by setting status to 0 in my database.

It might be a Facebook connect module as I only allow users except admin to login via Facebook but as I can't log in to my site I can't check.

How can I reset or log into my site if I do not know the password and the page to request a new one isn't working?


texts:
I am using Drupal 7. I would like to display images with reflection effect.

For Drupal 6 there is module "Imagecache Effects" that offers this option.

For Drupal 7 there is "ImageCache Actions" module, but it does not offer reflection effect, but it provides Custom action effect for php code.

Can I add reflection with some custom php code?


texts: importing XML file to create/update nodes, relation nodes/users, and taxonomy terms (to several vocabularies)

texts:
Thanks for take time to read this question.

I want to import a XML file. XML content will create/update: nodes, relations nodes/users, and taxonomy terms (to several vocabularies) and his relation with nodes. I want to know, if is possible, your experiences and suggestions about this kind of requirements, or modules to resolve this, or if is best a custom code.

thanks in advance.


texts: why user redirection is working fine on internet explorer but not on other browser

texts:
i have drupal framework with authorized users (saml module). when user try to sign in by putting their credentials it takes them to dashboard page rather than the required page.
here weired thing is its happening on all the browser except internet explorer.
i have checked every settings regarding user, and cleared cache on all other browser but still the problem is same.
Can anyone is familiar this kin of issue.
i wonder why everything is working fine in internet explorer but not on other browser.

i appreciate if anyone can reply with suggestion.


texts: How do I create a cache context in Drupal 8 that varies on user/node field data?

texts:
Let's say I have a complex render array that has two variations that depend on a simple if: whether the logged in user can edit a node inside it. There are two scenarios I look for:

The node was created by the logged in user, or:
The node's field_group (entity reference) matches the logged in user's field_group.

These two conditions are independent of roles/permissions so I can't fall back on those contexts. Originally, I simply used the "user" context but this would create far too much variation and potentially lead to a very large database table (not to mention it was inefficient to have to cache this again for every user).

I imagine I would need to create a context like: "caneditnode:nid" and somehow pass nid to a handler that would load the Node to check its fields and owner and compare to the data in Drupal::currentUser(). Is that possible? How would I go about doing this? Thanks!


texts: How can I install the Currency module on shared host?

texts:
I want to install the Currency module on Drupal 8, but it doesn't install.

  Currency requires Composer dependencies. Read the documentation on how to install them.

I am using a shared host, and I can't use Composer. How can I do it?


texts:
I created a view block that displays in table where there is an exposed filter called category:

Category | Data
A           1
A           2
B           3
C           4

now I want to create multiple html links where their url points to
a page where this view block is displaying.

However in this page I only want to display the data view where certain filter is activated

example:

Link 1 > url points to page x with view only showing items with category A
Link 2 > url points to page x with view only showing items with category B

How do I create a url for views that displays values using exposed filter?


texts: How do I get the fields of form attached with a content type as token?

texts: I do not know is it possible or not. I have a content type for creating tickets. I have a form attached to content type which contains ticket state and ticket assignee fields as drop down. Now I want to create a Rule when state of ticket updated then send an email to ticket creater. The problem is that I could not find the state field values as token.


texts: How to filter a view by "Group administrators" ?

texts:
In OG 7.x-2.x you can assign roles to group members and you can override roles for a specific group.
I am trying to create a view of all admin members. I am filtering the view with PHP.

Option #1: Use $roles = og_get_user_roles('node', $row->gid, $row->uid); and then check for role '3' (normally the admin role in OG).
-> the obvious problem is that if a group has overridden the default roles, its "admin" role has an other (undefined) id

Option #2: Check with the 'Administer group' permission: $administrator = og_user_access('node', $row->gid, 'Administer group ', $account);
-> However I will get all the site administrators that can administer all the group, while I am looking in this context only those explicitly accounted as group admin (that in some cases could be site admin too).

Any hint on how to filter for an user that has explicitly be granted administer group permission ?


texts:
I'm using Omega's sub-theme 'creativpink' and ajax_register module.

When user enters wrong user name or wrong password I want show *'The password entered is wrong. Please retry.' instead of Drupal's default error 'Sorry, unrecognized username or password. Have you forgotten your password?'.

I've tried with following code in my sub-theme's template.php file :

function _custom_validation(&$form, &$form_state){
  $query = db_select('users', 'u');
  $query->fields('u', array('name'));
  $query->condition('u.name', $form_state['values']['name'], '=');
  $result = $query->execute();
  $name = $result->fetchField();
  if(empty($name)){
    form_set_error('user_name', t('The password entered is wrong. Please retry.'));
  }
}

After saving file I entered wrong user name and password. The error message showed both default text and my custom text.

Sorry, unrecognized username or password. Have you forgotten your password?
The password entered is wrong. Please retry.

But I want to show only my custom error message. How to do this?


texts: Store anonymous user selection temporarily until registration

texts:
I want to let my first time visitors to first select a city, which will control what they see in my site, so it should be stored where I can see it everywhere (views, search and when posting content) until the user registers which then I store it in the user profile for later use.

Is that possible without development?
if development is mandatory, what are the right steps to do so?


texts: How do I get the timezone with "User's timezone" setting?

texts:
In Drupal 7 if you set a date field's time zone handling option to "Date's time zone", you get a Timezone selection when entering a date but the date is always displayed in that timezone. If you set the timezone handling option to "User's time zone", you don't get to pick the timezone but the date is displayed according to the user's time zone.

I want to do both. I want content creators to be able to pick a time zone when entering a date and I want that date to be displayed in the user's timezone.

Is that possible with normal configuration options? If not, what hooks should I use?


texts: Can someone explain clearly the difference between hook_load and hook_node_load? hook_load says it is a "node-type-specific hook". What does that mean? hook_node_load actually has a types parameter.


texts:
I have a simple RSS feed I am importing via core Aggregator module in Drupal 8.5.  One specific field in the Item can't be accessed by Views, and it's critical for display.  I'm relying on hacky approach right now, but would love to do it right.

What's the process in getting a specific ATOM Rss field registered so that it appears in Views UI?  Can't find any info on building custom Aggregator plugins for fetcher/parser/processors.

Anyone have other thoughts on how to approach?

Thanks in advance for all insight.

PTG


texts:
I need to request a new password via services.

I used the URL:  <endpoint>/user/password?args['name']=test2

but it returns Access denied for user anonymous

It's supposed to be used by non authenticated users so why does it return this error?.
What am I doing wrong here? What is the URL should I use?


texts: For the creation of a prepopulate link, how can i strip out slashes if they occur in the title?

texts:
if(isset($node->field_eventform['und'][0]['nid'])) {
          echo '

';
          echo 'field_eventform['und'][0]['nid'].'/'.$node->title.'/'.$node->nid.'">'.$node->field_eventform['und'][0]['node']->title.'';
        echo '

';
   }

?>

With this snippet we prepopulate a webform for events. But when a site editor uses a "/" in the title the link doesn't work anymore. How can I strip out slashes if they occur in the title?


texts: Is it possible to add folders in config/install?

texts:
I am working on a Drupal 8 module that has a fairly large number of configs (a few content types and fields, with 20-25 config files per content type), and one thought I had for organization was to put the configs for each CT into a subfolder under config/install. However, I see that the configs are not read in this case.

Which is the better way to proceed?

1) Just place everything in config/install, with 100-150 config files.

2) Create sub-modules for each content type, which would require a bit more overhead but could be done given the module's use case.

3) Is there a way to add subdirectories in config/install?

For some background, I wrote a Python daemon that does server monitoring, and  the module handles communication between the monitors and a central reporting server. Each content type corresponds to a plugin for the monitor, so someone could turn on only the plugins that they want. However, in the current iteration I would prefer to have a core set of content types that are managed by one module.


texts:
How is it possible to make the Search module multilingual?

Now all my result on mysite/search/node are not filtered (ENG + FR are mixed).


texts: $user->uid is always 1 when running automated tests

texts:
In my automated tests, I create some users.

  debug('moderator_user: '.$this->moderator_user->uid);
  debug('editor_user: '.$this->editor_user->uid);

outputs

'moderator_user: 2'
'editor_user: 4'

So I would think that

global $user;
$this->drupalLogin($this->editor_user);
debug('currently logged in as '.$user->uid);

would output

'currently logged in as: 4'

but instead it shows,

'currently logged in as: 1'

It seems to be correctly logging user 4 because

$this->drupalLogin($this->editor_user);
$edit = array(
  'title' => $this->randomName(),
);
$this->drupalPost("node/add/{$this->content_type}", $edit, t('Save'));
$node = $this->drupalGetNodeByTitle($edit['title']);

debug('Draft was created by user with uid '.$node->workbench_moderation['current']->uid);

yields

'Draft was created by user with uid 4'

So what's going on?


texts:
Is there a restriction for template folders?
Like for name or structure ?


texts: Which image editor can be used within Drupal for creating flowcharts?

texts:
I am looking for an image editor within Drupal. Particularly, I need something that will help me create flowcharts and save them directly.

The idea is to avoid using an offline image editor, to make the site more user-friendly.

Any pointers?


texts: i am trying to create a most viewed posts page using views. I know how to create a page with most commented post but I can't seem to find the view count option. Any suggestions. Do i need to add a relationship?


texts:
i need to implement my own search method in order to find nodes with some keywords in their title or body and with a specific type but i don't know how to do this.

I tried with do_search and node_search methods but i don't get results.

Anyone can help me?

Thanks