texts: How to display taxonomy terms parents along with child terms in views block?

texts:
I have taxonomy terms structure something like below:

 - Parent 1
    - Child 1
    - Child 2
    - Child 3

 - Parent 2

 - Parent 3
    - Child 4
    - Child 5

I want to display same structure in a views block. I already reviewed in this link . They have not used blocks. They used pages and depend upon url argument they did something. But I need this to be display in a block. I searched some of the suggestions by using contextual filters and relations but not able to get this structure. Please give some other suggestion which you have used in your case. thanks in advance.


texts:
I set up a working Drupal 7 installation on somebody else's server and the image generation only worked if all folders leading to the thumbnail folder were given 777 permission.

This must be a an Apache configuration issue - has anybody else come across this?


texts: Exposed filter render as autocomplete but I need a select field

texts:
I have a moderation queue that uses these filters:

published: no
content type: xxxx
author uid: EXPOSED

Drupal renders the exposed filters as auto-complete, but I need to use a select field. Is it possible?


texts: Validate function not working in ajax form

texts:
I used Ajax in a form so that submission of form does not lead to reload of the page.It is working . But the problem is 'The Validation code is not working'. This is the code I have used in the form.

This is the code for submit button.

$form['submit'] = array(
  '#type' => 'submit',
  '#ajax' => array(
    'callback' => 'submit_driven_callback',
    'wrapper' => 'myform',
    'method' => 'replace',
    'effect' => 'fade',
  ),
  '#value' => t('Submit'),
);

I have put the validation part in the following function.

function formname_validate($form, &$form_state) {
  // Validation code
}

Am I doing it the wrong way? Should I put the validation part somewhere else?


texts:
I am trying to migrate a website from d6 to d7, while doing so I made a copy of the site and pointed a domain that I have to that site, its all working great, except when I try to login it posts the form and redirects to the original domain. Its the first time I am working on D6, so I am not sure how to fix this. I would love to clear caches, but I am unable to install the module to do it, so I cleared all tables in the DB that has cache_ prefix and cache table, with no success. Its still redirecting to the original domain the site was copied from. FYI I also made a copy of the db to another name and connected that to the copy site. Hope it makes sense.

Thanks in advance.


texts: Problem configuring the MailChimp module

texts:
I am having an issue installing the MailChimp module.  I have installed the module and the extra library under /sites/all/libraries/mailchimp/MCAPI.class.php.  I have copy and pasted my API key into the form on admin/config/services/mailchimp.  There are no errors coming up in the apache log.  The module is not functional and my lists are not syncing!

In the MCAPI.class.php Readme file says this:

  2) Try running mcapi_lists.php from the command line. Something like
  this:

`# php -f mcapi_lists.php`

But that command is not recognized.


texts: Is there any module that can automatically convert a module to be used on a different version of Drupal?

texts: I don't find many of the Drupal 6 module yet on Drupal 7 and there are many Drupal 7 module that are not available in Drupal 6. I work in High level synthesis and am sure these can be done using high level compilation techniques, but wondering if there has been already any work in this direction. My question is, is there any module /framework already developed that can automatically convert a Drupal 6 module to Drupal 7 and vice versa?


texts: How to bulk edit user fields with different values?

texts:
I'm trying to mass edit users and user field values. And I'm struggling.

I have a custom view with custom fields and filters that lists me users I wish to edit. Now I tried the Views Bulk Operations module but this only allows to start a bulk operation on a field setting all users field values to the same value.

Now what I need is a way to edit the same field across all users but with induvidual values on a per-user basis. I dont want to open 1000+ profiles and find the field in each profile edit form to modify and save it but to mass edit this field for all users at once.

I have views inline editing in my mind, or a view which works like an excel sheet. But most solutions (Editable Views, Editable Fields, Views Megarow, ...) are not working at all or are very limited to special fields or views or content types or whatever.

Example:

Imagine a simple example view which lists users and some of their fields.

[ ] Uid   Name   Gender   Age   Relation
------------------------------------------------
[ ] 0     Root                  Admin      Edit
[x] 1     Lea    f        27    Friend     Edit
[x] 2     Dad    m        26    Family     Edit
[ ] ...

Now I selected two users because I want to change their taxonomy reference 'Relation'. And want to get another view which looks like that, listing only the users I selected and the fields I whish to edit:

User   Select Relation
------------------------------
Lea    [Friend][^]
Dad    [Family][^]
                       [Save]

Scope:

Did anyone ever had such a usecase and know of any solution? As I mentioned, VBO gets close to this behaviour but does not

work with taxonomy term references,
allow unique values on a per-user base.


texts:
I've several content types configured to add links in several menus other than the main one and navigation, and I'd like Drupal to show in a left sidebar the corresponding menu it belongs and its siblings and children.

How could I achieve that?


texts: Add class to first field in fields views

texts:
How to add class to first fields in views?

I think that I need to add one if but I dont know what argument to put in if...

So how to add class just for first field in views-view-fields template.

{% for field in fields -%}
{%
        set colors = [
        'color-'~cycle(["red","yellow"],loop.index),
        loop.first ? 'first',
        loop.index== "1"?'color-first',
        ]
%}
        <b {{ field.element_attributes.addClass(colors) }}> {{ field.content }}</b>
{%- endfor %}

This code do this :


texts: Pulling Possible Select Values From A Field (Drupal 7)

texts:
I have been looking if there is a function that return all the possible values for a field. I have a select field that is a Node Ref. So, function list_allowed_values() is out of the question. Because, list_allowed_values() is not compatible with Node Ref. Does anyone know a function to get all the possible Node Ref for a field?

Or do have to code my own function?
Thanks,
Nate


texts: TinyMCE input format is set to "Full HTML" but code is still being stripped

texts:
I am trying to enter some HTML into TinyMCE. I know that some input formats can strip code depending on your settings, but I have "Full HTML" selected, yet my code is still being stripped.

What else might be causing this to happen?


texts: How to get the template file using hook block view?

texts:
function tgs_user_block_info() {
  $blocks = array();

  $blocks['user-list'] = array(
    'info' => t('List of Users'),
  );

  return $blocks;
}

/**
 * Implements hook_block_view().
 */
function tgs_user_block_view($delta = '') {
  $block = array();

$variables['logo'] = theme_get_setting('logo');
$variables['module_path'] = drupal_get_path('module', 'tgs_user');
$variables['current_path'] = '/' . current_path() . '/';

switch($delta) {

  case 'user-list':
    $block['content'] = theme('user_list', $variables);
    break;
  }

  return $block;
}

/**
 * Implements hook_theme().
 */
function tgs_user_theme() {
  $theme = array();

  $theme['user_list'] = array(
    'template' => 'templates/users',
  );

  return $theme;
}

This is my code in module. It doesn't call in template that I have been created on my hook_theme.


texts: How do you keep production site in synch with development site?

texts:
I've got a Drupal development site where I test everything (modules, configurations etc.) before implementing on the production site. As it is right now, I need to write everything I do on paper and carry out the same steps on the production site.

How do you keep production sites in synch with development sites? Is there any handy modules out there for this purpose? To what extent can Drush help me out on this?


texts: Programming a custom redirect in a Drupal Site

texts:
I would like to know what is the best option to setup a Drupal redirect process that will look at the current time of day and then redirect the user to a page based on this information?

Since I have not had to do this before in Drupal, I'm looking for one or two suggestions on how to do this with the user starting the action from a menu item.

One thought I had is that I could create a page that is PHP content and determine the redirect there, but I'm unsure of how to code that in that location.

Also, I'm not sure if I've overlooked a module that could help with a conditional redirect or if all the references to form redirects might be applicable to what I'm trying to do.


texts: The Link Field module is not creating outbound links

texts:
The Link module is not creating external links. I put 'myurl.com' into the node field  and the rendered a href is mysite/myurl.com. The title is being rendered correctly, but the links are relative.

The project page for the Link module says that I should be getting these results of which I was hoping for the second one.

http://drupal.org => http://drupal.org
drupal.org => http://drupal.org
<front> => http://drupal.org
node/74971 => http://drupal.org/project/link

Did I miss something in the configuration?


texts: The link of "Pdf version" on node page does not appear in chrome

texts:
I have installed the the print module on my drupal 7 site. I configured the the print module pdf settings.

Now the link "pdf version" is displaying with each node on the content area at bottom. When I click on the link, it save the node in pdf format.

But this only works in firefox. In chrome the "pdf version" link in not displaying.

What is the problem?


texts: How to auto submit only after typing at least three character in view exposed filter

texts:
I have a view with exposed filters using AJAX and auto-submit feature.

The problem is it reacts to every char I type but what I want is that when a user type at least three character in the text field then it should auto submit and display search result. But Cant figure out how to implement this. Please help


texts: User roles and permission for 1 can publish and 1 can't

texts:
I have 2 user roles which I created

1] Article Creator  -> Can Create/Update/Delete
2] Article Publisher -> Can Create/Update/Delete/Publish

Article Creator can create content, but can't publish. While Article publisher can do that.

Can we manage it without any module or any custom coding?

Can manage from default Drupal Admin?


texts: Allowing node creation/editing inside other node creation form

texts:
I have a custom content type congress, and inside the congress creation form, I want to allow the user to create and edit as many nodes as he wants of the custom type event.

How can I accomplish that? I've seen it's possible to create a field for selecting an existing node with node reference and node connect modules, but those do not allow me to create or edit nodes.


texts: Views different image styles depending on URL

texts:
I want get very close Views results, but image style should differ.
It should be done by using different URLs or Views arguments.
How I can reach that?

UPD: final solution:

/**
 * Return actual image_style of image depending on URL params.
 */
function _MYMODULE_image_style() {
  $allowed_image_styles = array('image_style_1', 'image_style_2');
  $params = drupal_get_query_parameters();
  if (isset($params['image_style']) && in_array($params['image_style'], $allowed_image_styles)) {
    $image_style = $params['image_style'];
  }
  return isset($image_style) ? $image_style : NULL;
}

/**
 * Implementation of hook_views_pre_execute().
 */
function MYMODULE_views_pre_execute(&$view) {
  if ($view->name == 'view_1' && $view->current_display == 'services_1') {
    $image_style = _mymodule_image_style();
    if ($image_style) {
      $field_name = 'field_vendor_logo';
      $view->display_handler->handlers['field'][$field_name]->options['settings']['image_style'] = $image_style; // <<< THIS IS the main part of solution
    }
  }
}


texts: How can I display the field in the tab that was active on save?

texts:
I'm using Drupal 8 paragraphs. I have a banner_header paragraph that contains three fields,

field_active_callout_tab (boolean)

field_banner_header_single (entity reference revision: paragraph)

field_banner_header_multi (entity reference revision: paragraph)

two of which are displayed in tabs like so:

Here is how the banner_header paragraph shows up on the content type edit form:

When I save the content, I want the page to render with the paragraph from the tab that was active on save.

What I've done so far:

I added classes to the tabs which you can see in the image of the form display: .single-link and .multi-link.  I was told that I also needed to create a boolean field to manage the display behavior, which I did with field_active_callout_tab. The way that was suggested this to work is, the bool will change depending on which tab is selected, and then I can use the bool value to determine which field is to be displayed in the twig template. The default class for this boolean seems to be '.option'.

I created a custom js file to check the status of the tab:

(function($, Drupal) {

/* Add span to wysiwyg button classes for alignment
------------------------------------ */
Drupal.behaviors.calloutControl = {
      attach: function (context, settings) {
            $('.single-link').click(function () {
                  $('.option').prop('checked', true);
            });
            $('.multi-link').click(function () {
                  $('.option').prop('checked', false);
            });
      }
};

})(jQuery, Drupal);

And here is the banner_header template:

<div class="callout-options">
     {% if content.option == true %}
          {{ content.field_banner_header_single }}
     {% else %}
          {{ content.field_banner_header_multi }}
     {% endif %}
</div>

The bool does not change depending on the tab selection. It appears to not be impacted at all. The page will only render with the multi link paragraph, despite single link setting tab being open on save.

Is the bool necessary? If so, what am I missing?
If the bool is not necessary, what should I do next?

How can I get the paragraph field in the tab that was active on save, to render on the page?


texts:
I want to use Views Datasource module to output JSON, i then want to construct the JSON output using REACT JS or alike. I am currently stuck on how to output the Flag Link, it just comes back with an OPS field. Ideally i want this as a plain link so I can trigger it through jquery/ajax.

UPDATE: as requested using the php field i managed to get the output i was after which is something like:


texts: How to automatically load block--[blockname].tpl.php to region--[regionname].tpl.php

texts:
I have multiple customized blocks with different content (eg. Advertisements, Quotes, Youtube videos, etc..)

block--apple.tpl.php
block--pineapple.tpl.php
block--orange.tpl.php

Question: How can I automatically assign these blocks from different regions for example:

block--apple to sidebar_first region
block--pineapple to sidebar_right region
block--orange to region--myCustomRegion

Is there a theme function that automatically fills my target REGIONs with these BLOCKs without using the dashboard. I just want all blocks is ready when my theme is installed.
Thank you very much in advance.


texts: Hierarchy of content types with taxonomy as parent

texts:
What would be the best way to implement a hierarchical structure like this:

(A) Taxonomy term from single vocabulary

(B) Some content type with parent of type A

(C) Some content type with parent of type B

There are reference fields from (B) to (A) and from (C) to (B) but not from (C) to (A).
Basically i need to implement something like this:
Topic (taxonomy term)
|___ Subtopic (custom content type)
         |___ Page (custom content type)
         |___ Page (custom content type)
         |___ + N
|___ Subtopic (custom content type)
         |___ Page (custom content type)
         |___ Page (custom content type)
         |___ + N

I tried using entity reference in all flavours but with not much success. I don't know how to:

Implement path aliasing when i add content of type (C) so i have hostname/(A)/(B)/(C) so i
don't have to enter the url manually (tried with url patterns but couldn't do it)
Create a view that displays content belonging to (C) with Context Filters on hostname/(A)/(B)/(C) url

Any help is much appreciated!


texts:
I have a problem with Drush to enable or disable module. But downloading modules works perfect! However I want to use Drush in its full range.

Yesterday, I saw my Drush would not succeed in connecting to the database. I already tried to update the path in .bash_profile to the AMPPS path. But after that, my bash cannot find the database any more. I already deleted the line but bash don't find mysql.

Anybody has an idea about what to do to resolve this?

Below are the various messages I received:

  Sams-MacBook-Pro:demo Sam$ drush en views -d

  Starting Drush preflight. [0.01 sec, 1.82 MB]                        [preflight]

  Cache HIT cid:                                                         [debug]

  7.0-dev-commandfiles-0-9942ce60ec4ba1e3ca6f94d08d021773 [0.01 sec,
  1.88 MB] Bootstrap to phase 0. [0.09 sec, 5.75 MB]                   [bootstrap]

  Bootstrap to phase 6. [0.09 sec, 5.76 MB]                            [bootstrap]

  Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.09 sec,    [bootstrap]
  5.76 MB]

  Initialized Drupal 7.34 root directory at                              [notice]

  /Applications/AMPPS/www/demo [0.1 sec, 6.09 MB]

  Cache HIT cid:                                                         [debug]
  7.0-dev-commandfiles-1-68c4337f6c538cdf6d3ca715c4afb7a3 [0.1 sec,
  4.17 MB]

  Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.1 sec, 4.18[bootstrap] MB]

  Initialized Drupal site default at sites/default [0.1 sec, 4.18 MB]    [notice]

  Cache HIT cid:                                                         [debug]
  7.0-dev-commandfiles-2-9518eda12b48158193bd617384d95a7d [0.11 sec,
  4.18 MB]

  Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.11[bootstrap] sec, 4.18 MB]

  sql-query: SELECT 1; [0.11 sec, 4.3 MB]                              [status]

  Executing: mysql --defaults-extra-file=/private/tmp/drush_9NOj8N
  --database=demoDB --host=127.0.0.1 --silent  < /private/tmp/drush_gIJn4w

  sh: mysql: command not found

  Bootstrap to phase 5. [0.12 sec, 4.3 MB]                             [bootstrap]

  Command pm-enable needs a higher bootstrap level to run - you will   [error]

  need to invoke drush from a more functional Drupal environment to run
  this command. [0.12 sec, 4.3 MB]

  The drush command 'en views' could not be executed. [0.12 sec, 4.3   [error] MB]

  Drush was not able to start (bootstrap) the Drupal database.         [error]

  Hint: This may occur when Drush is trying to:

  bootstrap a site that
  has not been installed or does not have a configured database. In this
  case you can select another site with a working database setup by
  specifying the URI to use with the --uri parameter on the command
  line. See drush topic docs-aliases for details.
  connect the
  database through a socket. The socket file may be wrong or the php-cli
  may have no access to it in a jailed shell. See
  http://drupal.org/node/1428638 for details.

Drush was attempting to connect to:

  Drupal version         :  7.34
  Site URI               :  http://default
  Database driver        :  mysql
  Database hostname      :  127.0.0.1
  Database port          :
  Database username      :  demoDB
  Database name          :  demoDB
  PHP executable         :  /usr/bin/php
  PHP configuration      :
  PHP OS                 :  Darwin
  Drush version          :  7.0-dev
  Drush temp directory   :  /tmp
  Drush configuration    :
  Drush alias files      :
  Drupal root            :  /Applications/AMPPS/www/demo
  Site path              :  sites/default

  [0.17 sec, 6.42 MB]   Sams-MacBook-Pro:demo Sam$


texts: Removing dozens of Routes from a collection

texts:
I am using a contrib module that is adding a local task to all entities, where I only want it to be added for Nodes.

So far, I have this written to handle the problem in the short term:

/**
 * Implements hook_local_tasks_alter().
 */
function mymodule_local_tasks_alter(&$local_tasks) {
  foreach ($local_tasks as $key => $task) {
    if (preg_match('/access_by_entity/', $key) && $key != 'access_by_entity.entities:node.access_tab') {
      unset($local_tasks[$key]);
    }
  }
}

Is there a better way to do this? Is this performant? I would rather just not have the routes exist at all, except for this one instance.


texts: hook_form_alter #attributes and #disabled

texts:
I'm using Drupal 7 and Advanced forum.

The users when will create a new topic will be able to select the forum container and forums, but if they select a container, an error will be showed. I want to avoid this by altering that taxonomy options with adding an #attribute or #disabled to specific forum container.

As I inspect the elements, this is the option that I want to change:

$form['taxonomy_forums']['und']['#options'][334];

First of all I've tried to test by adding a class for that option like this:

$form['taxonomy_forums']['und']['#options'][334]['#attributes'] = array('class' => array('test-class'));

but that didn't worked, it simply erases the title of that option.

With #disabled it didn't work too.

From https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#attributes

I can see a good example, but also a note:

  Note: If you are altering an existing form via hook_form_alter() or a
  similar means, be careful with this property! You will probably want
  to add to the existing array rather than writing over it, so don't
  follow this usage example exactly.

It's kind a confusing, so how can I add an #attribute or #disabled to option with hook_form_alter?

EDIT: This is a part from my code:

<?php
function custom_alter_form_alter (&$form, &$form_state, $form_id) {
   switch ($form_id) {

        case 'forum_node_form';

        $form['taxonomy_forums']['und']['#process'][] = 'custom_alter_process_checkboxes';
        krumo ($form);
        break;
    }

}

function custom_alter_process_checkboxes($element) {
  $element[334]['#attributes']['class'][] = 'test-class';
  $element[334]['#disabled'] = TRUE;
  return $element;
  krumo ($element);
}


texts: How to delete duplicate comments using sql?

texts: In order to clean up an old large site from spam, I'd like to delete all duplicate comments from mysql. By duplicate I mean, the comments which are posted by the same user across all nodes of a certain type where content of the comments are exactly the same.


texts: How to alter price in checkout page and when submit order

texts:
I have a discount price for product. I want alter price of product  using discount price if user has voucher.
How to alter price of page cart, cart/checkout and when user submit order.
Please help me!


texts: Undo/redo drupal console generate:plugin:block?

texts:
I ran drupal console generate:plugin:block and made a mistake.  I'd like to run it again, but I get this error:

 'block' entity with ID 'my_block' already exists.

I've removed the source file that the command created, but this error still persists.  I'm guessing the block was added to the site's actual configuration.  How can I undo/overwrite it?


texts: How do I include a JavaScript library without using a module?

texts:
Note: I'm very new at using Drupal, so I may be missing something.

I've searched high and low, but I can't seem to find an answer to this.

I've got a custom Drupal theme based on Zen, and I want to include a jQuery plugin (specifically, Lightbox) into a page that needs it (I'm using Panels and Views to create custom landing pages). Frankly, I'd be happy even if I had to include it on the entire site.

I looked at JavaScript Libraries Manager, jQuery Plugins Module, but these didn't seem to be able to include CSS or images, which Lightbox requires.

I tried placed the script and CSS/image files in my theme's folder, and then using the following in mytheme_preprocess_page() in my theme's template.php:

$options = array('group' => JS_THEME);
drupal_add_js(drupal_get_path('theme', 'mytheme') . "/js/jquery.lightbox.js', $options);

This loads the JavaScript file OK, but it doesn't function correctly because it's looking for the images at the web root / (and I didn't include the CSS file, anyway).

I saw an example of using hook_library(), and this looks promising as it allows specification of CSS files as well, but I'm not sure where/how to include this setup code.

Also, I realize that there is a Lightbox module, but because the way that my content types and views are done, I can't add rel="lightbox" to the anchors...


texts: Do I need to use a block or form to implement login box, or can I just post to a 'login' url the user details?

texts:
I have static HTML for a login box which contains a form with username and password inputs and is part of the site header, which will be on every page ie. this is not a login 'page'.

To integrate this with the Drupal login system, can I point the form action at a certain url to post the login details and perform the login? Thereby, not requiring any Drupal backend form/block/theme coding?

Or do I need to implement my own form, or customise an existing form to achieve this? If so, why is that? What do I need from the Drupal back end to successfully login ie. hidden form fields that need to be passed with the login details etc?

I am trying to implement the site in the cleanest way possible, using my own HTML 5/ CSS 3 markup, so overriding most html so that the tonne of classes Drupal adds, and the extra unnecessary markup are scraped. So, ideally I would like to avoid having to make a login form/block as part of the back end.


texts: Outputting multiple content fields all wrapped in a div

texts:
I'm trying to wrap multiple field items in an HTML container.

So let's say I have "Blog" content type. I have field1, field2, field3, field4 and field5 for this content type.

I want to output field2, field3 and field4 wrapped together in a DIV.

I've been Googling and tinkering for the past 3 hours and I haven't gotten anywhere.

Any help out there?

Drupal 7, Zen subtheme.

I read this and didn't have any luck here either:
Wrapping multiple cck fields into a single div tag for theming?


texts: In a view how to replace the date of creation of the comment by the date of the flag?

texts:
I created a "like" flag on the nodes.

I created a view that displays the comments.

I want my view to show only comments posted since the flag date.

The solution will be to create a filter criteria with the filter "Comment: Publication date" (Is greater than or equal to) and replace the value with the date of the flag.

The problem is that there are no tokens for the filter criteria.

There is a tutorial here :

https://www.webomelette.com/creating-custom-views-filter-drupal-8

But I failed to create the criteria filter. This is the first time I've created code for a view.

Can you explain to me in an answer how to do this step by step ?

thank you in advance

I created a folder :

notify_node_new_comment

And a file notify_node_new_comment.yml that I placed inside :

name: Notify node new comment
description: Notification of new comments.
type: module
core: 8.x

I created an empty file notify_node_new_comment.views.ink in my folder (I do not know what to put as code).

I also added the following folders :

/scr/Plugin/views


texts: How to Add more option for type radios use Ajax in Drupal 8

texts:
Hi I build Add more for radios  when click button load ajax. This ajax only add more options for radios . But not working , how to build used ajax add more options for type radios form ? Thanks

This code example my demo:

use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;

class DemoForm extends FormBase{

    public function getFormId()
    {
        return 'DemoForm';
    }
    public function buildForm(array $form, FormStateInterface $form_state,$param = array())
    {
        $form['wrapper_data'] = array(
            '#type' => 'container',
            '#attributes' => array('id' => 'wrapper_data'),
        );
        $form['wrapper_data']['data_media'] = array(
            '#type' => 'select',
            '#title' => 'List Media',
            '#options' => array('aaa','bbb','cccc'),

        );
        $form['wrapper_data']['load_more_data'] = array(
            '#type' => 'button',
            '#value' => 'Load More',
            '#ajax' => array(
                'callback' => '::AjaxLoadMore',
                'wrapper' => 'wrapper_data',
            ),
        );

        return $form;
    }

    public function AjaxLoadMore(array &$form,FormStateInterface $formState){

        $form['data_media']['#options'] += array('bbbb'); // Want Add more options for radios

        return $form['wrapper_data'];
    }
}


texts: Is there a way to disallow spaces in the user name registration form in drupal 7?

texts: I hate spaces in usernames, a user can easily add two or more spaces without realizing it. I need to have more control over the username format than Drupal allows by default.


texts: Bootstrap simple carousel: how to display it on front-end?

texts:
I've installed Bootstrap simple carousel module and I know how to add/edit slides. But I didn't find anywhere instructions on how to display them on the front-end. Module didn't create any new block, view or something?!?

How to display slide show on the front-end?


texts: How do I identify what type of data or object I have? It's a referenced entity

texts:
I am new to Drupal but an experienced developer. I'm creating a DS field in which I will display a custom block chosen by the content editor. I have successfully gotten a referenced entity (two references deep) based on this answer How to get instance of referenced entity?.

Is there some data that will tell me what type of thing it is? Should I find out by looking in the UI at the block layout menu?

It would be simple to answer the question 'How do I get the block ID?' (answer: $bid = $campaignFundraisingBlock->id(); and I will fix that shortly) but the question I really want answered is 'How can I find out what type of data I have?'

The top answer (here) How can I programmatically display a block? made it clear that the type of block makes a difference in how you render it, so it seems important to be able to find out what type of data I have.

With the code (below) I am currently getting this error: Error: Cannot use object of type Drupal\block_content\Entity\BlockContent as array in Drupal\shpf_campaign\Plugin\DsField\ParentCampaignFundraisingBlock->build(), (which I will fix shortly).

Here's my code:

class ParentCampaignFundraisingBlock extends DsFieldBase {

  public function build() {
    $campaignStory = $this->entity();
    $fieldCampaignFundraiserOptIn = $campaignStory->get('field_campaign_fundraiser_opt_in')->getValue();
    $showFundraiserCta = FALSE;
    if (!empty($fieldCampaignFundraiserOptIn)) {
      $showFundraiserCta = $fieldCampaignFundraiserOptIn[0]['value'];
    }

    if ($showFundraiserCta) {
      $campaign = $campaignStory
        ->get('field_campaign_node_type')
        ->first()
        ->get('entity')
        ->getTarget()
        ->getValue();
      $campaignFundraisingBlock = $campaign
        ->get('field_campaign_fundraising_block')
        ->first()
        ->get('entity')
        ->getTarget()
        ->getValue();

  /* question: Do I have a renderable block in $campaignFundraisingBlock, or a type? How can I tell? */

      $bid = $campaignFundraisingBlock['values']->id;

  /* This next code assumes that the data I have is a block created in the interface (content block), but that seems like a big assumption that is not necessarily true. */

      $block = \Drupal\block_content\Entity\BlockContent::load($bid);
      $render = \Drupal::entityTypeManager()
        ->getViewBuilder('block_content')
        ->view($block);
      return $render;
    }
  }
}

Some background information: The block type is set to 'Featured CTA' and there are a bunch of blocks of that type available for content editors to choose from. The content editor chooses the block in the 'campaign' content type (it is an entity reference). The end user can fill out a form in which they tell a 'campaign story'. The end user can choose to include the campaign fundraiser or not. The campaign story has an entity reference to the campaign it is part of.

So, how do I find out what type of data I have?


texts: Date iCal Date & Time Not Passed on Correctly

texts:
I'm having an issue with the Date iCal module where the specific time is incorrect. The date is correct, the title and body are correct, but the time itself is incorrect.

It just defaults at noon and no matter what I seem to do, the time will not change.

At the moment you can find the calendar link here: http://www.egyptianstudysociety.com/events

And you can find the iCal feed link here:
webcal://www.egyptianstudysociety.com/events.ics

I'd appreciate any help with this, because I'm absolutely lost.

Thanks! Matt

UPDATE------------------------

The current formatting is as follows: 02/14/2017 11:14:01:pm

And it does have an end date.

And here is the output for the .ics view:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Date iCal//NONSGML kigkonsult.se iCalcreator 2.20.2//
METHOD:PUBLISH
X-WR-CALNAME;VALUE=TEXT:Egyptian Study Society
BEGIN:VEVENT
UID:calendar.110.field_date_time.0@www.egyptianstudysociety.com
DTSTAMP:20170214T180111Z
CREATED:20170123T175211Z
DESCRIPTION:Edouard Naville and Francis Llewellyn Griffith are often referr
 ed to as the first archaeologists to see the importance and grandeur of th
 e Great Temple at Bubastis and it is their descriptions and findings which
  continue to draw modern day archaeologists to the site of the once magnif
 icent temple and city.
DTSTART:20170222T190000Z
DTEND:20170222T200000Z
LAST-MODIFIED:20170214T174303Z
SUMMARY:Naville\, Griffith & the Legacy of the Great Temple at Bubastis
URL;TYPE=URI:http://www.egyptianstudysociety.com/event/naville-griffith-leg
 acy-great-temple-bubastis
END:VEVENT
END:VCALENDAR

-----UPDATE

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Date iCal//NONSGML kigkonsult.se iCalcreator 2.20.2//
METHOD:PUBLISH
X-WR-CALNAME;VALUE=TEXT:Egyptian Study Society
BEGIN:VTIMEZONE
TZID:America/Denver
BEGIN:STANDARD
DTSTART:20161106T020000
TZOFFSETFROM:-0600
TZOFFSETTO:-0700
TZNAME:MST
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20170312T020000
TZOFFSETFROM:-0700
TZOFFSETTO:-0600
TZNAME:MDT
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
UID:calendar.110.field_date_time.0@www.egyptianstudysociety.com
DTSTAMP:20170214T182618Z
CREATED:20170123T175211Z
DESCRIPTION:Edouard Naville and Francis Llewellyn Griffith are often referr
 ed to as the first archaeologists to see the importance and grandeur of th
 e Great Temple at Bubastis and it is their descriptions and findings which
  continue to draw modern day archaeologists to the site of the once magnif
 icent temple and city.
DTSTART;TZID=America/Denver:20170222T120000
DTEND;TZID=America/Denver:20170222T130000
LAST-MODIFIED:20170214T174303Z
SUMMARY:Naville\, Griffith & the Legacy of the Great Temple at Bubastis
URL;TYPE=URI:http://www.egyptianstudysociety.com/event/naville-griffith-leg
 acy-great-temple-bubastis
END:VEVENT
END:VCALENDAR


texts:
How do you query custom fields on the user table? If edit a user in the Admin panel, and hit the DEVEL tab, I see the field I added, 'field_display_name'.

In a node template php file, I want to replace the 'name' field with 'field_display_name'.

When I query, either using:

$result = db_select('users', 'u')
  ->fields('u')
  ->condition('name', 'bubba', '=')
  ->execute()
  ->fetchAssoc();

or

$rst = db_query("select * from {users} where name = :name", array(':name' => 'bubba',));

neither one of these return my custom field on the user table. (DPM does not show field_display_name)

So obviously, i'm missing something fundamental in my understanding of the data structure.

How do i return this added field by querying with uid or name to return and print the 'field_display_name' ?


texts:
I started to use GraphQL for my drupal8 application to expose some data.  Now I want to use it to return a webform that I created.

I installed an add-on for webform graphl https://github.com/duartegarin/graphql_webform but am not sure how to use it.  I thought it will add a new query type called WebformQueryById but it is not showing up when I navigated to the GraphQL explorer.

I have been stuck for days on this.  Is there some configuration / setting steps I might be missing?  Thanks


texts: Ajax request return field without name attribute

texts:
Instead of getting multiselect on making ajax request while I select content type, I got single select and this select hasn't any name (select tag hasn't attribute name). So here's problem and I don't know how to fix it. Can anybody help?

$form['export_what'] = array(
    '#type'  => 'select',
    '#multiple' => FALSE,
    '#title' => t('Select content type'),
    '#required' => TRUE,
    '#options' => $form['export_what1_options']['#value'],
    '#ajax'    => array(
        'callback' => 'insttance_ajax_fill_content',
        'wrapper' => 'replace_model_div',
        'effect' => 'fade',
        'event'  => 'change',
    ),
);

$form['export_data'] = array(
    '#type' => 'select',
    '#multiple' => TRUE,
    '#required' => TRUE,
    '#default_value' => '',
    '#prefix' => '
',
    '#suffix' => '
',
    '#options' => $content,
);

function insttance_ajax_fill_content($form, $form_state)
{
    $i = $form['count_field']['#value'];
    $content = getAllContentByType($form_state['values']['export_what']);

    $form['export_data'] = array(
        '#type' => 'select',
        '#multiple' => TRUE,
        '#required' => TRUE,
        '#default_value' => '',
        '#prefix' => '
',
        '#suffix' => '
',
        '#options' => $content,
    );

    return $form['export_data'];
}


texts:
In this manager:

admin/structure/taxonomy

admin/structure/taxonomy/manage/[fruit]/overview

There is a way to add a search a term?

So, if you have 100 terms it will easier to find a term.

This one is not ported at all https://www.drupal.org/project/term_search

This module is not full ported to D8
https://www.drupal.org/project/taxonomy_manager

I also find this interested article to alter a task in a specific vocabulary. https://www.computerminds.co.uk/drupal-code/replacing-vocabulary-listing I created the view, but I still find out how to add a tab for that view in the overview taxonomy.

There other way to add an option to search a term in manager?


texts: Workaround for missing migrate-deregister command in Drush 10.3.1?

texts:
I'm trying to migrate and upgrade a site from Drupal 7 to Drupal 8 (version 8.9.1). The migration cannot be accomplished with the UI, since I need to make some changes to the content types and taxonomies during the process. I followed the advice at https://www.drupal.org/docs/upgrading-drupal/upgrade-using-drush and generated individual migrations using drush migrate-upgrade --configure-only so that I could use the YAML files it generates as the basis for a custom migration module.
After I built my module, I ran drush migrate-status (alias drush ms). I can see that my migrations are registered, but the ones generated earlier by drush migrate-upgrade are also there. In the past, removing them would be a simple matter of using drush migrate-deregister (alias drush mdreg), but that command, strangely, is no longer available in the current version of Drush (10.3.1).
How do I deregister the migrations that were generated by drush migrate-upgrade --configure-only? I am assuming that if I don't deregister them, my content will be migrated twice, and I don't want that to happen.


texts: Link in main menu does not point to specified path

texts:
I'm trying to add a link to my site's about page to the main menu as an "About" link. I have configured it in the following manner:

Menu link title: About
Path: node/2
Description: (none)
Enabled: selected
Show as expanded: deselected
Parent link: Main menu
Weight: 1

I do get an "About" link created in the main menu, but this points to http://about/
and not to http://{sitename}/node/2. I know that I can add the full URL and adding the full URL does work, however, I'm interested to this with relative paths.


texts: Views fields configuration is not working

texts:
I set a few fields as FIELDS section of a view. the problem is when I click on the fields the Style settings ,No results behavior , Rewrite results and More links are not collapsible . this is the screenshot

what it is like that?


texts: How to manage reservations with Drupal for something that is not something like a room?

texts:
I am looking for a reservation module for either Drupal 6 or 7. I know there is a really good looking module for room reservations for Drupal 7 but my use case is different. I am looking for a reservation/booking module that could be used for booking photographers or DJs. I have searched around but haven't really found anything suitable yet.

The Room Reservations module that is being created for Drupal 7 looks great, but it needs to be generalized so that the administrator could define what it is that needs to be booked. Right now it is hard coded for rooms only.

Does anyone know of such a module and more importantly worked with it?


texts:
I have two type of content lets say News and Article.
Now, I want search over these two content types(option is given to user). I am using default search module of drupal.
I am able to search both by www.example.com/search/node/ but unable to filter out because I don't know how to provide content type here.

My question is :

How to provide search parameters (like content type) to URL so that my search works correctly according to content type?

I try to provide www.example.com/search/node/[content type]/[search pattern] then         "[content type]/[search pattern]" become actual search pattern.
   What are the options I have.

If URL change is not the solution what are the options I have to resolve the issue.

Regards,
Yatendra.


texts: How to create a user listing page with a tpl.php

texts:
I would like to create a listing page of users of a particular role.

Inside this view, there should be another view which shows the related content for each user.

When I try to create a view the system gives me the option to use just fields, but I need to be created like a node so I can use a tpl.php file.

How can I get a tpl.php file for this?

If I create a view for the users and one with the contents(contextual filter uid), can I embed  the second view inside the view-unformatted.tpl.php?


texts:
I'm attempting to sort the results of a View by matching one of the Entity IDs in the result set to the referring URL Entity ID. I'm trying to do this in a custom Views Sort plugin. I did some research on Custom Views Sort plugins and came across this link:

https://medium.com/oleksandr-trotsenko/drupal-8-views-tutorial-for-developers-part-iii-sorts-filters-49baa40418de

Following the tutorial, I arrived at the simplest hook_views_data() entry:

$data['node_field_data']['nid'] = array(
    'title' => t('Custom trials sort'),
    'group' => t('Content'),
    'help' => t('Sort events by by referral source.'),
    'sort' => array(
      'id' => 'trials_sort'
    ),
  );

I added this sort to the View in question. In the class with the id trials_sort I've added this method:

public function query() {
  $this->ensureMyTable();
  $has_custom_sort_id = $this->detectCustomSorting();
  if($has_custom_sort_id !== FALSE){
    $id_to_top = $has_custom_sort_id;

    $sql_snippet = <<<EOF
CASE $this->tableAlias.nid
  WHEN nid = $id_to_top THEN 1 ELSE 2
END
EOF;
    $this->query->addOrderBy(NULL, $sql_snippet, $this->options['order']);
    dd($this->query);
  }

}

The goal was to get an ORDER BY like:

ORDER BY (CASE WHEN nid = $id_to_top THEN 1 ELSE 2 END);

All of this is executing on the appropriate view. However, Drupal is adding the SQL in an odd way. In the above code, my ORDER BY looks close to right:

But my fields array looks very wonky:

I'm clearly missing something that tells Drupal to interpret this additional orderBy as a formula. How do i do that?


texts:
I am using Drupal 7 and creating a webservice.
and using http://delta.indivar.info/tanenttest/drupalgap/node this webservice. i am trying to create a node using poster plugin of Firefox
and i am passing parameters as

type='page'

it shows  ["Access denied for user anonymous"]

i can't give permission for Anonymous user. is there is any way so that only authenaticate user can create node.


texts: How can I exclude the shown node without reducing the row count?

texts:
I have a view block for related content in which I've configured a contextual filter ("Content ID from URL") such that, when displaying the block on a node, that node node is excluded from the view. However, in cases where the current node is captured in the view, the total row count is reduced (in my case, from 3 rows to 2 rows) per the exclusion. In other words, the filter doesn't simply filter out node when making the query, it removes the node from the query result (so far as I understand the process).
Is there a way to configure the view so that excluding the current node does not reduce the overall row count? I tried ordering the the contextual filters so that that the node exclusion occurs first, but this doesn't have any effect on the result.


texts: Need clarification for "use this hook and some code" type of answers

texts:
Whenever the answer to a Drupal question, either here or on blogs and other articles, is to use a hook and then some example code is provided, what are the assumed steps from beginning to end for implementing this answer? These are likely left out to avoid redundancy but it's difficult to piece together the underlying, assumed foundation and skills.

Where does the given example code from many such answers to questions go? Is this essentially what building a module is? The concept of a hook is easy to understand and explained well here but how to use a specific hook to alter some piece of core to achieve something isn't clear.

For example, if the question is, "how do I change the text of such and such button" and the answer is "use hook hook_such_and_such_blahdy_blah" what does this actually mean?

Real world example: This blog about how to theme the comment block is great. But what is the author really saying to do when he says to just override the hook by copying the code from the API page and then alter the hook.

Resources I've checked out but don't mean anything without the missing foundation:

https://api.drupal.org/api/drupal
https://www.drupal.org/docs/7/creating-custom-modules/understanding-the-hook-system-for-drupal-modules


texts: How can I set a View contextual filter fallback?

texts:
Ok I have 2 content-types:

Page
Video

I have a block in the sidebar that shows videos embed by youtube.

In the Video content-type, I have a Node References field that can reference any Page-type node.

I would like to set up the sidebar block View so that it can output a random video-type tagged with the current page-type node, however if there are no video-type nodes referencing the current page, or if the current page is not a page-type node, then it would select ONLY  video-type nodes that are either (depending on what is simpler to implement):

Have another field on the video-type which can tag the node as "global" (this would be preferable)
OR Not referencing any page-type nodes

I was hoping to try and make use of the Context module, but I'm wondering whether the module is quite so granular or conditional?

Thanks!


texts: VBO action 'Modify OG user roles' does not show custom OG roles on the 'Add roles' list

texts:
I have added new OG roles like 'tutor' or 'contributor'. I am using the view og_members_admin that comes with drupal commons, which uses view bulk operations 'Modify OG user roles' to give an admin the ability to add or remove certain roles. However, the only role selectable that I can add or remove is the default 'administrator member', despite the fact that I am user 1. Is there any further configuration that needs to be done to expose those custom added roles to that list?

Edit: when I try to add a user (through group/node/%/admin/people/add-user) the only role shown in there is also 'administer member', so this must be some site-wide configuration that is missing?


texts:
Since I changed my drupal to my backup that it's giving me some errors, but overall it stills working, but today I was about to add a new content and when I try to upload new images it shows me this error

  "The file could not be uploaded."

And in log messages I've this message errors:

  Location: http://localhost/node/add/imovel?_wrapper_format=drupal_ajax&ajax_form=1&element_parents=field_image%2Fwidget

  Message: The upload directory public://2017-02 for the file field field_image
  could not be created or is not accessible. A newly uploaded file could
  not be saved in this directory as a consequence, and the upload was
  cancelled.

In the same location this 2 other errors:

  Recoverable fatal error: Argument 1 passed to Drupal\Core\Form\FormState::setError() must be of the type array, null given

  Notice: Undefined index: value in Drupal\Core\Field\Plugin\Field\FieldWidget\NumberWidget->errorElement()

Now I can't upload images and that don't allow me to add new content.
I already try to create a new field but that didn't work.

PS: I think the error has to do something about Image Crop because before this error happen a box to crop my image would appear after I upload and know I upload and no box to crop the image.. And when I press save and publish content the error pops

  The specified file temporary://filekrGdEp could not be moved/copied because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions.


texts: Show contextual link for each node on node listing page

texts:
I want to show contextual links having Edit and delete links for each node on hover on main listing page of my application. I have searched and found the following code

function MyModule_node_view_alter(&$build) {
  if(isset($build['#node'])) {
        $node = $build['#node'];
        if(!empty($node->nid)) {
            $build['#contextual_links']['node'] = array('node', array($node->nid));
        }
    }
}

But this code displays contextual link on node detail page. For example when individual node is visited like http://www.example.com/node/21. But I want to show these contextual link on listing page where all nodes are displayed. When I hover the node, this should be shown.

This is how my view settings looks like

Any help?


texts:
I am using the beta release of the OpenID Connect module, and I encounter a feature issue in the code.

My goal is to display a simple login label of the block rather than using the default provided by the module. To explain, in line #92 of the file src/Form/LoginForm.php, #value is defined as

'#value' => t('Log in with @client_title', [
  '@client_title' => $client['label'],
]),

but I want to make it simplier, just #value' => t('Log in),

Is there any way to create and apply patch for beta release or other workaround how this can be handled? (Not hardcoding in the file itself)

The actual block displays the following.

What I want to show is the following.

How do I change the submission button text?


texts:
drupal 7 workbench: Can I limit different users/roles within a particular section via taxonomy?
If I setup 2 roles Author and Editor and I assign different users with the same role (i.e. Author) but assign them to a different section via taxonomy (i.e. Northeast region or Southwest region).  Once this is done will users with Northeast region taxonomy and Editor role only see "Needs Review" documents within the Workbench section created by Author user that have the matching Northeast region taxonomy?


texts:
I have a content type in which I have following fields

Title, year, and report type. I create a block using BEF for exposed report type. which is working fine

Now I want to show results as

- 2014
    --Title1
    -- Title2
+ 2013
     --Title 2013
     --- Title 2013 1

and so on

When i click on + icon result will expand.

Can we do this using views or I have to right custom code for this?


texts: Importing Joomla 1.5.23 to Drupal 7 by using Feeds

texts:
I'm trying to migrate Joomla 1.5 to Drupal 7 by using Feeds Module. I have tried the "Joomla to Drupal" with no luck. And the "Migrate" module requires some PHP coding, which I'm not an expert on this.

Question 1 - So, my question is which phpMyAdmin database for "Node Import" when I import CSV to Drupal? I know "jos_users" is for the "User import". What about the rest of them?

Question 2 - How to import Joomla user password by using Feeds? The password format seems different.

Question 3 - How and where can I import the url formatting?

For details, please see below of my Joomla phpMyAdmin database list.

Thanks!

jos_banner
jos_bannerclient
jos_bannertrack
jos_categories
jos_components
jos_com_file_index
jos_com_file_index_errors
jos_contact_details
jos_content
jos_content_frontpage
jos_content_rating
jos_core_acl_aro
jos_core_acl_aro_backup
jos_core_acl_aro_groups
jos_core_acl_aro_map
jos_core_acl_aro_sections
jos_core_acl_aro_wtf
jos_core_acl_groups_aro_map
jos_core_acl_groups_aro_map_wtf
jos_core_log_items
jos_core_log_searches
jos_funrecaptcha
jos_groups
jos_jce_groups
jos_jce_plugins
jos_jcomments
jos_jcomments_custom_bbcodes
jos_jcomments_reports
jos_jcomments_settings
jos_jcomments_subscriptions
jos_jcomments_version
jos_jcomments_votes
jos_jobline_jobs
jos_jobline_jobs_types
jos_jobline_types
jos_jxcomments_comments
jos_jxcomments_ratings
jos_jxcomments_ratings_members
jos_jxcomments_threads
jos_jxtended
jos_menu
jos_menu_types
jos_messages
jos_messages_cfg
jos_migration_backlinks
jos_modules
jos_modules_menu
jos_newsfeeds
jos_plugins
jos_polls
jos_poll_data
jos_poll_date
jos_poll_menu
jos_redirects
jos_sbxss_categories
jos_sbxss_slides
jos_sections
jos_session
jos_stats_agents
jos_taxonomy
jos_taxonomy_config
jos_taxonomy_elements
jos_taxonomy_filters
jos_taxonomy_map
jos_templates_menu
jos_users
jos_weblinks
jos_xmap
jos_xmap_ext
jos_xmap_sitemap


texts: Using form api to store google map location

texts:
Is it possible to use form api (write codes) to display and store google map Latitude and Longitude? Most of the modules available is to add new google map field to drupal content type.
I don't want to use drupal content type to store as a node. i wish to store the location using db_insert.
Thanks


texts: How to replace 'reply' link with button?

texts:
I want to replace the 'reply' link with button. As an intermediate solution I styled the link as a button with CSS, but I want it to be a real html 'button' element. The reason is, I do not want the reply links being visible to search engines, instead of it, I want to handle clicks on buttons with javascript.

I only found this 10 year old discussion on drupal site:  https://www.drupal.org/node/33170.

I created a custom comment.tpl.php and tried to modify the $links['comment']['#links']['comment-reply'] array, but without success.


texts: display a taxonomy terms as autocomplete using form API

texts:
I am writing my own module. I want to display a taxonomy terms as a autocomplete field in my form using form API. How can I do that?

I am using Drupal7.


texts: How To Create 'Node 1 vs Node 2' 'Node 1 vs Node 3' nodes etc as quickly as possible to compare their fields?

texts:
I want to create a node for each comparison of 2 nodes, so you end up with site.com/node-1-vs-node-2 and then on that page it shows both the node 1 and node 2 fields side by side in a table to compare them.

What am i looking at to get this done as quickly as possible? I have 50 nodes in total and want to do node 1 vs node 2, node 1 vs node 3, node 1 vs node 4, etc all the way through.

Would it be views, or entity reference which shows a table format for each output?

I'm using Drupal 8


texts:
I have setup a view with contextual filters; it works great.

Now I just need to setup a few drop downs to allow users to filter on criteria. Does the Views module support this in Drupal 7?

Should I just build a quick module using the form API, set the module to block level, and show the block above the listings?

What's the best practice here?


texts: Is there a way to tell what pages within the site link back to a particular page within the site?


texts: Is it possible to add CSS to the user edit page?

texts:
EDIT:I'm using a custom theme and attempting to edit the style on a specific field on the user edit page.

Dooug is correct. My question was answered here How to Override CSS for a core module?

I want to perform some styling and add CSS to the user edit page. Is this possible?


texts:
I have set the address of the server email address inside the Drupal Site Information, but it is not sending email to any users, when I start to request a new password for any users.

I feel I have missed something! maybe server email password!? how can I fix this issue?


texts: Rules, User registration, loop through other users with condition, set field value to 0

texts:
My configuration is the following :

Using D7

I have a node type called Items.

User with a node id entity reference field to this node can be affiliated to one of these nodes, four of them..

(So there is (x) Users who are affiliated to Node A, (x) Users to Node B.. C and so on..)

When registering new user has a "field_current_owner" (on/off), set by defaut
And choose his affiliation to one of these four nodes.

I want to make a rule that cycle through  other users affiliated to the same "node id reference" to have their "field_current_owner" switch off.

I am a bit confused with rules components.. someone could shade some light on my problem ?

Should i made a component which turn any user with id different (negate) than registered user with condition regisetred has same node id reference
trigger event get field i/o to "off" ?

I am a bit confused, then when i make a rule with my component fields previously inputed, how can I make it cycle through my user list ?

I am a bit in the mist with this module, can someone please give me hand ? Even a hint ?

Thanks by advance


texts: Using symlinks / multisite to display one drupal site at two domains

texts:
Does it create any problems for me to use symlinks to display the same drupal site at more than one domain? It appears to work, but I'm not sure if bugs might appear in the future due to scripts being misinterpreted as XSS attacks or something.
Example
I own two domains, sweet-bro.com and hellajeff.net . They're hosted on the same account, such that people who go to sweet-bro.com see the files in ~/sweet-bro/html and people who go to hellajeff.net see the files in ~/hellajeff/html
There's a drupal 7 site at http://sweet-bro.com/drupal and I want visitors to see the same site if they go to http://hellajeff.net/ruse . So, first I make a symlink in the html directory:
ln -s ~/sweet-bro/html/drupal  ~/hellajeff/html/ruse

Then I make a symlink in the sites directory:
ln -s ~/sweet-bro/html/drupal/sites/default  ~/sweet-bro/html/drupal/sites/hellajeff.net.ruse

This is what I've done and it seems to be working. Is there any reason not to do it this way?


texts: How can a node appear in different places?

texts:
This is the kind of planning-stage question that I tie myself up in knots with...

A film site has main nav headings for Comedy, Fantasy, Kids etc. Each menu item displays a listing View of content type 'Film' tagged with the relevant taxonomy terms.

For example, 'Harry Potter' film is tagged as Fantasy and Kids, and appears on both listing pages.

If the user goes to the Fantasy section and clicks on 'Harry Potter' to view the full node, it needs to appear within the Fantasy section.

To achieve this, I am thinking of using another View to display the node content in the correct section (so the user never gets to the actual node). Or maybe I can do something with Panels. Or perhaps some kind of dynamic menu management?

I just have that familiar feeling that there has to be a cleaner way with Drupal?


texts: How do I add a menu subtitle to field sets displayed as vertical tabs?

texts:
I have formatted my field sets in a form builder function to display as vertical tabs. Here's a snippet of my code. It works fine:

$form['vertical_tabs'] = array(
    '#type' => 'vertical_tabs',
);

// * Form elements: fieldset tree.
$form['episode'] = array(
    '#title' => t('Episode details'),
    '#type' => 'fieldset',
    '#tree' => TRUE,
    '#collapsible' => TRUE,
    '#group' => 'vertical_tabs',
);

I see a lot of vertical tabs with, let's call it, a menu subtitle just below the menu title. It's the grey text under the blue anchor text in this pic from the vertical_tabs module page - the top one reads 'Create new revision':

I guessed, wrongly, that adding a #description attribute with my menu subtitle would add it in, but is just appears at the top the field sets' tab contents. Does anyone know how this is done?

Thanks

SOLUTION

Some may consider this not to be the 'correct' Drupal way, but this is simple, requires hardly any code, resides in the Sites folder (so it won't be over written on update), and does not require editing any core files. Just a bit of CSS. This is what I did:

.vertical-tabs ul.vertical-tabs-list li:nth-child(1) .summary:after {
  content: 'Menu subtitle 1';
}
.vertical-tabs ul.vertical-tabs-list li:nth-child(2) .summary:after {
  content: 'Menu subtitle 2';
}

Clive's answer (see below) may be a better option if you're handy with JavaScipt.

ANOTHER SOLUTION

Here, is a jQuery solution I've developed:

Add this jQuery file to your module directory, call it jquery.YOURFILE.js:

/**
 * Vertical tabs summary setters.
 */
(function( $ ) {
  $(function() {
    $( ".summary:gt(0)" ).html( "Foo" );
    $( ".summary:gt(2)" ).html( "Bar" );
  });
})( jQuery );

Here I used the .gt method, but you could target tabs individually with the .eq method. In your form element definition, where you define your fieldsets, add:

'#attached' => array(
  'js' => array(drupal_get_path('module', 'YOURMODULE') . '/jquery.YOURFILE.js'),
),

MORE SOURCES OF INFORMATION

See the vertical_tabs examples module for another way to do this.

Look in content_types.inc and content_types.js in the node module too.

This is an update of the jQuery file above. It uses Drupal.behaviors and the eq method. Probably more 'correct' than the one above.

(function ($) {

Drupal.behaviors.yourModule = {
  attach: function (context) {
    $( ".summary:eq(0)" ).html( "Foo" );
    $( ".summary:eq(1)" ).html( "Bar" );
    $( ".summary:eq(2)" ).html( "Baz" );
  }
};

})(jQuery);


texts:
I've a content type with a workflow.
I have to notify users when the published version of the node is update.

Have I to check which transition is used? How?

I'm using an hook_node_presave.

[EDIT]
It seems that check if it's the default revision could be right:

 $entity->isDefaultRevision();

From draft to draft is false.
From draft to published is true.
From published to published is true.

Could be the right way?


texts: How to get a list of all displays of every view?

texts:
I'm doing some test and I'm trying to get a list of all the displays of every view to do the test things in every display of every view, but I don't have any idea how to do it.
When using views_get_all_views() I only get the first display of every view, but what I want is every view and everything inside that view.


texts: I have basic listing in a View. I can give styles, or unformatted text, provide a link, etc. However, I would need the listing to be a list of linked items, with the destination URL changing depending on context: language, type of user, etc. So I just retrieve the listing with a view, and in the template, I use views_get_view_result to print the fields I need and warp them with the necessary parameters (the dynamic URL, etc.). Is that a good approach or could this be achieve through the config of the View or with aid of another module (Context, Context Views, whatever...). Thanks!


texts: Drupal 7 Views Table Blocks Common Fields Sorting not working in single page

texts:
My site having dashboard page where I am displaying multiple Views blocks (2-3) with Table format. Each block have few common fields to display with different filters. These blocks have exposed form as well.
The issue I am facing with SORTING on common fields. The fields which are not common, sorting on those are working as expected. Filter and Paging are also working fine on each block as I have set different page id for those.

Do you have any idea how to make those sorting possible ?
Note: Ajax is ON in each block and machine id is also set different.


texts: Image styles to make all user inserted images appear as circles

texts:
Users can insert images on my site...i want that all of them are displayed in a similar fashion. So i created a new style under Image Styles. However, how can i make sure that all images appear as circled. Even if a user inserts a square image, the final display should appear in a circle. I do not find any option to do so. Any help or advice.

Thanks


texts:
Below is a hook from the LinkedIn Integration module.

Then I have a hook form alter in my module and it's all setup and ready to go to call a submit handler.

When the user goes to authorize LinkedIn, and come back, I want to fire some my code.

The question is I don't know what states or values are after it comes back. I tried this

function my_module_form_link($form,$form_state, $uid)
{
  dpm($form_state['values']);
}

but it did not return anything

function linkedin_user_enable_form($form, $form_state, $uid) {
  $form = array();
  $form['#user'] = $uid;
  $form['#action'] = url('linkedin/token/' . $uid);
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Go to LinkedIn'),
    '#suffix' => '
' . t('You will be taken to the LinkedIn website in order to complete the process.') . '
',
  );
  return $form;
}


texts: What's the default expiration time for block caches?

texts:
This article explains the cache setting in Drupal 7.

I'm using Blockcache_alter to cache some blocks. It's not clear to me how long those blocks are cached.


texts: How to hide language selector dropdown on node add page for a role?

texts:
I would like to hide the language selector dropdown on node add pages of multilanguage enabled content types.

What would be the best way? A jquery selector perhaps?


texts:
In Drupal 7 I had this code to query node fields and its respective title:
$query = db_select('node', 'n');
$query->join('field_data_field_internal_institute_paper_i', 'iipi', 'n.nid = iipi.entity_id');
$query->fields('n', array('nid'));
// some other conditions
$query->fields('n', array('title')); // <- working fine for D7
$result = $query->execute()->fetchall();

which was working fine. I know imported to D9 and I need to rewrite this accordingly:
$db = \Drupal::database();
$query = $db->select('node', 'n');
$query->join('node_revision__field_internal_institute_paper_i', 'iipi', 'n.nid = iipi.entity_id');
$query->fields('n', array('nid'));
// some other conditions
$query->fields('n', array('title')); //<- not working for D9
$result = $query->execute()->fetchall();

for some reason array('title') isn't a field anymore as seen above. How can I get the title here?


texts: After add node redirect to previous page

texts: How I can do this.. After Add/Edit node for specific Content type redirect to previous page..


texts: Broken/missing handler error for my custom views filter?

texts:
I am trying to write a custom filter for views. The goal is to filter by alias, but that's not important now. It seems like I am missing a step to get view to recognize my filter hander after adding my filter in hook_views_data_alter as in the following:

/**
 * Implements hook_views_data_alter().
 */
function alias_views_filter_views_data_alter(array &$data) {
  $data['node']['alias'] = [
    'title' => t('alias filter'),
    'filter' => [
      'title' => t('alias filter'),
      'help' => t('Provides a custom filter nodes by their alias.'),
      'field' => 'nid',
      'id' => 'entity_alias',
    ],
  ];
}

I am able to get the filter to show in a view filter list.
Now, my filter handler defined in /docroot/modules/custom/alias_views_filter/Plugin/views/filter/Alias.php but it does not seem to be picked up by views and I always get Broken/missing handler whenever I try to add the filter. Here is my handler definition:

<?php

namespace Drupal\alias_views_filter\Plugin\views\filter;

use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\filter\StringFilter;
use Drupal\views\ViewExecutable;
use Drupal\Core\Form\FormStateInterface;

/**
 * Filters by alias.
 *
 * @ingroup views_filter_handlers
 *
 * @ViewsFilter("entity_alias")
 */
class Alias extends StringFilter {

  /**
   * The current display.
   *
   * @var string
   *   The current display of the view.
   */
  protected $currentDisplay;

  /**
   * @var views_plugin_query_default
   */
  public $query;

  /**
   * Constructs a new StringFilter object.
   *
   * @param array $configuration
   *   A configuration array containing information about the plugin instance.
   * @param string $plugin_id
   *   The plugin_id for the plugin instance.
   * @param mixed $plugin_definition
   *   The plugin implementation definition.
   * @param \Drupal\Core\Database\Connection $connection
   *   The database connection.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, Connection $connection) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    // this does seem to get evaluated at all ?
    die('Death in handler');
  }

  protected function defineOptions() {
    $options = parent::defineOptions();
    $options['fields'] = ['default' => []];

    return $options;
  }

  /**
   * {@inheritdoc}
   */
  public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
    parent::init($view, $display, $options);
    $this->valueTitle = t('Filter by alias');
  }

  public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);
    $this->view->initStyle();
  }

  function query() {
    $this->ensureMyTable();
    $field = $this->tableAlias."nid"; //table_alias.".nid";
    $nids = $this->getNidsByAliasString($this->value);
    if (!empty($nids)) {
      $this->query->addWhere('AND', $this->options['group'], $field, $nids, 'IN');
    }
  }

  function getNidsByAliasString($aliasString) {
    $query = db_select('url_alias');
    $query->condition('alias', '%'.$aliasString.'%', 'LIKE');
    $result = $query
      ->fields('url_alias')
      ->execute();

    $nids = array();
    foreach ($result as $data) {
      array_push($nids, end(explode("/",$data->source)));
    }
    return $nids;
  }

}

Am missing a step or naming the filter incorrectly?

Checking the logs,  I am getting these errors:

Notice: Undefined index: field in Drupal\views\Plugin\ViewsHandlerManager->getHandler()
Notice: Undefined index: table in Drupal\views\Plugin\ViewsHandlerManager->getHandler()
Notice: Undefined index: id in Drupal\views\Plugin\ViewsHandlerManager->getHandler()


texts:
I have a content type "Project" and a content type "Document". Using the "references" module, the "Document" content type relates to the "Project" content type.

I have a simple view that shows a list of all projects like so:

Project A
Project B
Project C

However, I want the related documents to show up in the list (the relation occurs from the document to the project, not the other way around):

Project A

Document J
Document K

Project B

Document L

Project C

Document M
Document N
Document O

I've looked at the eva module (seems to be the wrong tool for the job, but that may just be my inexperience with it.) I've tried using the built in "relationships" with views, but can't find if it's possible that way.


texts: Populate a multivalue image field when importing xml data with Feeds

texts:
I created an importer to fetch data from an http xml file. To create the importer I'm using Feeds and Feeds XPath Parser

So far so good. Thing is that the xml file has several images to import in a single multivalue image field of my nodes.

Then I guess I have to concatenate these images into one value and then after populate my field. To do this I'm using Feeds Tamper. This one allowed me to REWRITE the multivalue image field using tokens where I set one token for each image.
It seems simple but it doesn't work. What am I missing here?

Is there any other way to do this?

Image capture of the xml: https://drive.google.com/file/d/0B71-gfIvQWAUU3ZpWVpVZzJjTFk/view


texts: created block for image is not displaying

texts:
I created the block for a image where in I want to display in all pages, but after creating the blocks once I see the page the created block is not displaying.

Following method  followed to create a block.

1] Structure->Blocks->Add Block

2]specified the name and browsed the picture( i have installed IMCE)

3] and chosen to display in bottom fist and also in all pages then save the
block.

But couldn't see the block in all pages, if any one know please help me.


texts:
Is it possible to add a condition - user flag count? Meaning to count every flag that user gave.
I could find only - user is flagged and user has flagging count.


texts: how do I change the url based on a theme?

texts:
On some occasions, I've seen Drupal able to detect things like language and rewrite the url accordingly, so your actual displayed url reflects the detected value (like from http://www.mysite.com/foo/bar to http://www.mysite.com/en/foo/bar)

I want to do that based on the $theme_key. I want all the data, when displayed in the 'fancytheme' theme, rewritten from  http://www.mysite.com/foo/bar to http://fancytheme.mysite.com/foo/bar

is that possible ?
how would i go about ?
is there a module out there that already does that ?


texts:
I am trying to validate a key, which I am passing as url argument using service. But service function is not calling.

It's giving "Access denied" error. Am I missing something?

My sample code is:

cunn.routing.yml

cunnotification.saverecord:
  path: '/cunnotification/saverecord/{key}'
  defaults:
    _controller: '\Drupal\cunnotification\Controller\SaveRecordToDBController::SaveRecord'
  options:
    no_cache: TRUE
  requirements:
    _access_cunn_saverecord: 'TRUE'

cunn.services.yml

services:
  cunn.saverecord:
    class: Drupal\cunnotification\Access\CUNAccessCheck
    tags:
      - { name: cunn_access_check, applies_to: _access_cunn_saverecord }

CUNAccessCheck.php

namespace Drupal\cunn\Access;

use Drupal\Core\Routing\Access\AccessInterface;
use Drupal\Core\Access\AccessResult;

/**
 * Access check for conn routes.
 */
class CUNAccessCheck implements AccessInterface {

  /**
   * Checks access.
   *
   * @param string $key
   *   The conn key.
   *
   * @return \Drupal\Core\Access\AccessResultInterface
   *   The access result.
   */
  public function access($key) {
   // Logic here
   return TRUE; // based on logic
  }
}


texts: how throw a custom exception in JSONAPI?

texts:
In D8 i'm trying to throw custom exceptions for extra validations that i need to do before the content is saved in my custom entity, but when i do the validations in the presave method and throw a normal Exception:
public function preSave(EntityStorageInterface $storage) {
  throw new \Exception("The content is duplicated", 409);
}

The response of JSONAPI is code 500 Internal Server Error and the response:
{
"jsonapi": {
    "version": "1.0",
    "meta": {
        "links": {
            "self": {
                "href": "http://jsonapi.org/format/1.0/"
            }
        }
    }
},
"errors": [
    {
        "title": "Internal Server Error",
        "status": "500",
        "detail": "The content is duplicated",
        "links": {
            "via": {
                "href": "http://site.docksal/jsonapi/content_entity/content_entity"
            },
            "info": {
                "href": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1"
            }
        }
    }
]

}
how can i control de error Code, title, status and detail.


texts: Newly (created by Drupal) dir not writable after first upload?

texts:
I'm working on Mac (Mojave) and using Vagrant for local dev. server. "nfs" is set to true if that maters. On Vagrant box I run Ubuntu 18.04. Drupal version is 8.7.2.

I add some new image field to some existing content type. For that field I set directory name, where files should be stored, i.e. "people" so dir is created in sites/default/file.

Then when I edit some node in that type and upload image for the first time it works fine.
But when I edit another one I can not upload image - this directory becomes write protected?! And then when I manually allow writing (change dir permissions) I can upload image again and it works well after that for all other nodes.

So it's like after first upload Drupal makes directory write protected for some reason?! Or is that done by virtual box?

Any idea why is that happening?


texts: Preventing FlexiSlider (Adaptive) to resize beyond a certain minimum height

texts:
I am using Flexi-Slider and AIS to create a responsive (full-width in this case) Images Slider for a front page on a Drupal 7 install.

I got it working perfectly but I would like to restrict the resizing function when the images reach a certain size. Meaning for example, if the height = 500px, even if the device screen size or resolution is smaller than that, or the user resizes the browser window, I don't want the image to get smaller than that.

Is that at all possible? Anyone has done it or could guide me into it? Thank you everyone for your time.


texts:
the module doubles every link in the map which leads to a node by it's alias.
the map shows nodes (instead of alias links only).

A link to the map.

How could i solve it? thanks.


texts:
So I'm almost embarrassed to ask this, but it's been so long since I've touched Drupal 6. We've been asked for something which requires another Field Formatter for a File field.

Form the code below, I'm able to select File download formatter in Content Type Display. However, when looking at the rendered page, I see no output for this field.

During drush cc all I see the reponse "TEST ONE" print in the console denoteing that MODULE_theme() is running. But there is not a connection to  theme_MODULE_viewer.

Once I get this wired up, I'm sure I can finish this in a hour, but what am I missing?

<?php
**
* Implementation of hook_field_formatter_info().
*/
function MODULE_field_formatter_info() {
  return array(
    'socf' => array(
      'label' => t('File download formatter'),
      'field types' => array('filefield'),
      'description' => t('TO DO: add description'),
    ),
  );
}

/**
* Implements hook_theme().
*/
function MODULE_theme() {

  print "TEST ONE";

  return array(
    'MODULE_viewer' => array(
      'arguments' => array('element' => NULL),
    ),
  );
}

function theme_MODULE_viewer($element) {

  print "TEST TWO";
  return 'Future response here. ';
}

From my understanding hook_theme creates an awareness of theme_MODULE_viewer in the array key MODULE-viewer.

In the Devel Tab, I see that the field contains data in both Load and Render panels.


texts:
I would like to edit the standard setup when installing the Taxonomy Access-module.
I would like it to be enabled by default and also I want to configure some rules for specific roles. But I need to do this while installing my D7 website. Which is the best way how to do this?


texts: How to display featured or new products on main Ubercart catalog page?

texts:
I'm having a little difficulty setting up Ubercart that may be related to the particular way I am wanting to use it. I'm sure I've just missed a setting somewhere or something.

I have the front page of my website at mysite.com, and the store located at mysite.com/store. I have added categories to the catalog taxonomy (mysite.com/store/category1). So the store is secondary to the front page.

When I go to mysite.com/store Ubercart only displays a list of the categories, and not any products (as expected, they are all within their categories). My issue though, is I would like to display some "new" or "featured" products on the mysite.com/store page instead of just the list of categories. If my store was located at mysite.com I could just use the "promoted to front page" option, but it is not.

How can I display products on mysite.com/store?
Thanks


texts:
I installed Drush using the PEAR option mentioned on the Drush project page, but I can't find the location of where it was installed.

Does anybody know the default installation location?

Specifically, I can't find the location of the drush.rc.php file to edit and add multiple sites to.


texts: Create my own slideshow like views_slideshow and views_galleria?

texts:
I want to create my own slideshow module using view.
I want to use jquery/javascript provided by client and create slider using views.
In short i want to make my own module/slider like views nivo slider


texts:
I'm running D8.
I need to have a field to embed a bandcamp player in. I'm using media module but there doesn't seem to be a way to embed platforms not officially supported by fx media video, media audio etc.
I'm not a php-coder, just html / css.

Any ideas?


texts: Getting Error 324 (net::ERR_EMPTY_RESPONSE) when saving changes to content/views/modules

texts:
For a few weeks now, I've been getting an error when saving certain changes. This error, in Chrome, is

  Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

After I click the save button, the page seems to load for a while (10 seconds or more), then directs to that Chrome error page. But, if I reload the page manually, the changes I've added have actually been saved. I've noticed this happening when: adding a new content type, adding a new field, saving changes to a view, disabling or enabling a module, and even clearing the cache.

After some digging, I found out that this error gets posted to Apache's error log every time this happens:

  [Fri Mar 30 09:27:11 2012] [error] [client 74.142.25.146] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 12893929 bytes) in /var/www/drupal/includes/database.mysqli.inc on line 329, referer: http://mysite.com/admin/content/node-type/typename/fields/field_looptest/remove
  [Fri Mar 30 09:27:12 2012] [notice] child pid 17934 exit signal Segmentation fault (11)

I have two sites I work on, one of which is simply a week-old backup version of the other. Interestingly, the error printed to the log for the up-to-date site is slightly different: The file that seems to be generating the error is includes/database.inc, line 225 instead of includes/database.mysqli.inc. In both cases, the line mentioned is simply an escape string function. mysqli_real_escape_string() and db_escape_string() specifically.

I'm at a loss. The fact that it's a Drupal core file generating the error is bothersome. Does anyone have any idea why this is happening?


texts: Are there hook_functions to handle submissions from the webforms module in Drupal 6?

texts: I'm asking this question as a possible way to handle another issue I possted about ("Moving webform uploads to a non-public folderspace"). Is there a hook_function that I can use to handle the submission of a webform in Drupal 6. That is, can I use a hook to relocate a file uploaded through a webform and update the database entry to mark that upload files new place?


texts: Limit entity reference widget to unique references

texts:
I have a entity-reference field that enables multiple-references (cardinality is set to -1). The problem is that it allows multiple 'same' references => it is possible to save two references to one specific node.

I know I can limit that using my own validation function but I have this feeling that there has to be easier way (e.g. some settings that I don't know about).

If there's none then sorry for useless question.


texts: View Taxonomy Term List with Exposed Has taxonomy terms (with depth) filter

texts:
I have view list of terms of a vocabulary. The terms of it have an entity reference field of another vocabulary (with hierarchically organized terms).
I would like to filter the terms by that entity reference like I am used to do with nodes with a "Has taxonomy terms (with depth)" filter.
Does a depth filter really only work with nodes?
Kind regards and thank you for your support.


texts: Drupal Add Javascript type=text/javascript

texts:
I am trying to add javascript to my page and use type="text/javascript" however when I include the following it just encloses it in script tags. How can I fix this? Also, how can I add the type="text/javascript to external files (see the second example)

drupal_add_js("$(document).ready(function() {
    // Infinite Ajax Scroll configuration
    jQuery.ias({
        container : '#itemcontainer',
        item: '.dealstable',
        pagination: '.nav',
        next: '.nav a',
    });
    });",'inline');

Here is the second example:

drupal_add_js('http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js','external');

UPDATE:
As suggested by the comments I tried the following:

$js = "(function($) {
    jQuery.ias({
        container : '#itemcontainer',
        item: '.dealstable',
        pagination: '.nav',
        next: '.nav a',
    });
    };
})
(jQuery)";
drupal_add_js($js, array('type' => 'inline','scope'=>'footer'));

But that resulted in the following HTML:

<script>(function($) {
    jQuery.ias({
        container : '#itemcontainer',
        item: '.dealstable',
        pagination: '.nav',
        next: '.nav a',
    });
    };
})
(jQuery)</script>


texts: Video module javascript stripping out other source tags

texts:
I'm using the Video module and Zencoder to transcode my uploaded videos into 5 different formats. The HTML generated is great:

<video id="video-3144-video" data-setup="{}" class="video-js vjs-default-skin" width="502" height="282" controls="controls" preload="auto" poster="http://blah.rackcdn.com/videos/thumbnails/3144/10bii Test Image.png">
  <source src="http://blah.rackcdn.com/m3u8/663b02ec652f3053bff1d133d85f228f.m3u8" type="application/vnd.apple.mpegurl" />
  <source src="http://blah.rackcdn.com/myvideo_webm_1357326043.webm" type="video/webm" />
  <source src="http://blah.rackcdn.com/myvideo_flv_1357326044.flv" type="video/flv" />
  <source src="http://blah.rackcdn.com/myvideo_mp4_1357326045.mp4" type="video/mp4" />
  <source src="http://blah.rackcdn.com/myvideo_ogv_1357326045.ogv" type="video/ogg" />
</video>

However, something on the Javascript side is altering the video tag, stripping out all of the source tags and converting it to this:

<video id="video-3144-video_html5_api" data-setup="{}" class="vjs-tech" preload="auto" src="http://blah.rackcdn.com/myvideo_webm_1357326043.webm"></video>

However, I would like the DOM to keep all of those <source> tags because I'd like to have some of my own Javascript use the URLs.

Is there some configuration change I can make or some code change I can make that will let the Video.js do its work but still leave the source tags intact?


texts: How can I configure the search engine to search by dates? Drupal 7

texts:
I am new using drupal and I am creating a website for renting various items. I need the searcher to give me as a result the available articles between 2 dates, that is, the user searches for items that are available between 2 dates, for example, I am looking for an amplifier that is available between September 11th and Augus 2th.

Please help me. Thanks.


texts: Why a successful migration is showing (0 created, 0 updated, 0 failed, 0 ignored)?

texts:
I have written a custom Migration tp import redirects (D7 -> D7).

Everything is working fine. Imports were successful, rollbacks are working fine etc.

However, I am getting Processed XXXX (0 created, 0 updated, 0 failed, 0 ignored) in XX seconds (XXXXX/min) message after import.

Why is not showing the number of items created?

Is there a method in destination plugin or migration where I need to return this count or return TRUE/FALSE for each row processed or something like that?


texts:
I have two content types called School and College.

Any user can create a new School Node or College Node.
Suppose there are 4 users in a website. User A, User B, User C and User D. In these website User B and User C are Friends via User Relationship Module in Drupal 7.

User A create a node of School Content Type called School X.

Now User B will view School X and there should be a link called "Share Content" which will allow the User B to share School X with their friends(User C in this case, not User D).

Please let me know how to achieve this. I tried "Share content" in User Relationship Module but that feature only able to share content when user will create or edit the nodes which is not my use case.


texts:
I am styling a page in a Drupal 7 site that has the title "Weddings & Private Events" and a URL alias of /weddings-private-events but the body class name is weddings-&-private-events which is invalid in CSS
 See screenshot below:

Is this a bug in D7? I'm using 7.26. Is there a way for me to fix this? I want to style a page specific element without using the node id which may change on export.


texts: Options set in dynamic multiple select field with ajax are not preserved

texts:
I am working on a dynamic set of three multiple select list which will function as one field which can be placed inside a form.  The options in the second and third select lists will be set based upon the selection in the first and second selects.

Here is how I create the widget:

function multiselect_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
    $options_first = multiselect_first_dropdown_options();
    $value_dropdown_first = isset($form_state['values']['dropdown_first']) ? $form_state['values']['dropdown_first'] : key($options_first);

    $form['dropdown_first'] = array(
        '#type' => 'select',
        '#multiple' => TRUE,
        '#title' => 'First Dropdown',
        '#options' => $options_first,
        '#default_value' => $value_dropdown_first,
        '#ajax' => array(
            'event' => 'change',
            'callback' => 'multiselect_school_ajax_callback',
            'wrapper' => 'dropdown_second_replace',
        ),
    );
    $form['dropdown_second'] = array(
        '#type' => 'select',
        '#multiple' => TRUE,
        '#title' => 'Second Dropdown',
        '#prefix' => '
',
        '#suffix' => '
',
        '#options' => multiselect_second_dropdown_options($value_dropdown_first),
        '#default_value' => isset($form_state['values']['dropdown_second']) ? $form_state['values']['dropdown_second'] : '',

        '#ajax' => array(
            'event' => 'change',
            'callback' => 'multiselect_class_ajax_callback',
            'wrapper' => 'dropdown_assignment_replace',
        ),
      );
      $form['dropdown_assignment'] = array(
        '#type' => 'select',
        '#multiple' => TRUE,
        '#title' => 'Second Dropdown',
        '#prefix' => '
',
        '#suffix' => '
',
        '#options' => multiselect_second_dropdown_options($value_dropdown_first),
        '#default_value' => isset($form_state['values']['dropdown_second']) ? $form_state['values']['dropdown_second'] : '',
      );

  return $form;
}

And here is an example of one of my ajax callbacks:

function multiselect_school_ajax_callback($form, $form_state) {
      global $classes;
      $index = array_shift(array_values($form_state['values']['dropdown_first']));
      $selected_school = $form['dropdown_first']['#options'][$index];
      $class_array = multiselct_get_subgroups($selected_school, 'organization_group');
      $form['dropdown_second']['#options'] = $class_array;
      $classes = $class_array;
      return $form['dropdown_second'];
    }

When I set the options of the dropdown_second in my ajax callback, it causes the widget to be re-rendered with the correct contents but when I examine the value stored in $form['dropdown_second']['#options'] from any other hook the values I set are not preserved.  If I set $form['dropdown_second']['#options'] from hook_form_alter() the values are preserved but hook_form_alter is not called after my ajax call.  Is there some way to make these changes stick around from my ajax callback or force a hook_form_alter?


texts: How can I make kint() load faster when debugging twig templates?

texts:
I've seen quite a bit of discussion about how kint() from the Devel module is difficult to work with because it maxes out PHP memory limits and makes the browser drag. I've heard some thoughts on improving its speed by limiting the number of levels. For example, in settings.php, you can do the following:

require_once DRUPAL_ROOT . '/modules/contrib/devel/kint/kint/Kint.class.php';
Kint::$maxLevels = 3;

Any other ways to improve the speed of kint()?


texts: Views: Showing related nodes from the tagged taxonomy term using views

texts:
I have two content types, Article and FAQ. They both have a Term reference field for tagging from the same taxonomy vocabulary called subject.

So on Article node view page, I want to display the three latest FAQ nodes that are tagged the same taxonomy term as to the currently displayed Article node, using views.

Please give me some idea. Thanks


texts: How can we autocreate an organic group during registration

texts:
How can I do this using the rules module?:
User registers (as profile type a) -> create organic group using field value from registration and make the user the manager/admin of the group

I have also the modules Profile 2 and Profile2 Registration Path.


texts:
I installed the Features extra module to export custom made blocks in my Drupal 7 environment. But for some reason, it doesn't work...

What I do is the following:

I create a custom block
I give it a machine name, description, title and body, just like it's required.
I go to Structure - features - Create feature
I create my feature by clicking the custom block under FE Block
The fe_block dependencies fills in automatically.
I download the feature and place it in /sites/all/modules/features
In my install profile I add this line: dependencies[] = custom_blocks
I try to reinstall the website and... nothing!

The blocks aren't showing up in my Block-page, but the feature is... What am I doing wrong in this process? Do I need to enable something or install an extra module in order to get my custom blocks exported?


texts: "This is a debugging block" on Permissions page

texts:
On my dev site, everything is working fine EXCEPT the permissions pages.  This includes /admin/people/permissions and the permissions pages for individual modules (example: /admin/people/permissions#module-advanced_forum).

I have the Faster Permissions module installed, and this module gives a list of all the modules installed with links directly to their individual permissions. This page is working fine.

All of these pages are working fine in my production site, so there is something about my dev site that is causing this error. Has this happened to anyone before? What could be the problem?

FYI, debugging blocks have been turned off in settings.


texts: Contact email flood limit is per whole system(application) or user/ip based?

texts: I have a question with contact emails flood limit which is present in contact.settings.yml, the limit is going to for whole system(application-wide) or is it going to limit the number of emails per individual user or IP?


texts: Cache tag problem causing block to disappear

texts:
We have a Drupal 8 site with a few thousand pages which are all in a huge hierarchical menu. Many pages display this menu as a navigation sidebar and each page can be customized so the root of this menu can be the page itself, its parent or its grandparent and set to how many levels of the menu should be displayed.  Did it make sense to put everything in one giant menu? Probably not, but that's what I'm working with.

The problem is they, being in the same menu, all get the cache tag: config:system.menu.[menu_name] which means that every node save purges basically the whole site.  The sidebar menu was rendered using a view which only matched the node itself then a node_view hook to build the appropriate menu.  This added the node_list tag also causing site-wide purges on node saves.

To solve this I moved the code into a block in a custom module which got rid of the node_list tag. (btw I have no idea why a view was being used, seems totally unnecessary).  For the menu tags I removed the config:system.menu.[menu_name] and add node:[node_id] for each menu item so that any given page is only purged if one of the nodes it's specific menu is changes.  For new nodes I have it purge a sibling (which purges all pages in the menu) so that any page that shares the same menu will be purged and the new page appears in their menu too.

finally, I added url.path to the cache context so pages wouldn't get a cached menu from the wrong page.

And it worked!

... but only on the local environment and the staging environment on an Acquia server.  When we deployed to production it appeared okay at first until we got reports that some pages were missing the side menu altogether!

Production goes through a CDN and Varnish on Acquia before it hits Drupal but I don't see how the CDN or Varnish could affect it since Drupal builds the page.  No errors in the log. Could I be missing a cache context or something? I'm stumped on this because I can't reproduce the error locally.  Any suggestions would be great.  Thanks!