texts: How can I add some style to title of side bar block?

texts: I want to add some style to my drupal 8 Sidebar menu, I want to create something like below image with Font awesome and css:


texts: How to stop users from flagging other users if they have a custom taxonomy term?

texts: I'm working on a project where users vote other users using the Flag module. Each user has a department term reference field. I would like to stop a user from flagging another user if they have the same department. Is it possible? Please help! Thanks in advanced!


texts:
I have created a D8 module for creating a custom field. I have done it following the given links.

https://www.drupal.org/node/2052601
https://www.drupal.org/node/2620968
https://www.drupal.org/node/2620966

I have created an module.info.yml file . Then created a three folders inside

/src/Plugin/Field , namely,

FieldFormatter
FieldType
FieldWidget

I have coded in each of the folders as per the links.
I could see my custom field in the field list. But my problem is that it is categorized under disabled. Please help me to figure out the problem.


texts: How do you use Drush to import a bunch of users via a csv file from the command line terminal?

texts:
I have a csv file of users and I would like to use the "drush user-create" command to create an account with these users and have them blocked by default with no password.

I noticed that there is a --pipe option, but I'm unsure how to use this with drush user-create to consume a csv file.

My csv file is just an email and the state:

peter@yahoo.com,ny
sally@gmail.com,nj
howard@bl.com,oh
billy@yes.com,wy


texts:
I would like to prevent my users to login except for those who login through my REST Service.

Is that possible?


texts: Adding markup inside first list item of main-menu

texts:
I need to add some custom markup inside the first list-item of the main-menu as you can see here:

Item 1

                        …
                        …

Item 2

Item 2

With the following code, I can insert the markup:

function mytheme_preprocess_menu_link(&$variables) {
  $variables['element']['#below']['#markup'] = '
...
';
}

But this code adds the markup to every list-item, not just the first one. Do I use the appropriate function and how can I add the markup only at the first item of main menu?


texts:
Not serious but interesting. I entered into the themes page and besides themes I also found there modules.

Any suggestion what can cause this behavior?


texts: \Drupal::currentUser() returns information about the anonymous user, even though I am logged in

texts:
I'am trying to check whether a user is logged-in or not; with \Drupal::currentUser()->id() I am getting the user ID for the anonymous user (i.e. 0), even though I'm logged in.

How can I resolve this?

I'm just calling this function in the .module file, and it is not run from cron. I am using the following code.

use Drupal\Core\Session\UserSession;
use Drupal\Core\Session\AccountInterface;

$user = \Drupal::currentUser();
if ($user->isAuthenticated()) {
  echo 'logged-in';
}
else {
  echo 'guest';
}


texts: Theme taxonomy term page with template override

texts:
I know this is far from duplicate but im a bit stupid.
I am trying to theme the terms page for each term for a specific vocabulary i created.
I 've used path auto when i was creating the terms so i have a specific path for each vocabulary term.

My website is using a subtheme that i created by copying and pasting the main theme which is ninesixty. So i have tried creating a new template for taxonomy terms like taxonomy-term--12.tpl.php added my html code and unfortunately the template wasnt overridden.
I have also tried to override the template using the template.php file with no luck.
 I dont want to use any module so any clear answer will be helpful.


texts: change description under email field on user registration form

texts:
I have created sub-domain for English and Spanish, that is why I used Multilingual module in Spanish to use Spanish language in my website. There is description under email address field does not change. I also add my Spanish description in drupal-7.32.es.po file but does not have effect.

 msgid "A valid e-mail address is required. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you want to receive a new password or wish to receive certain news or notifications by e-mail."
 msgstr "Se requiere una dirección válida de correo electrónico. Todos los correos del sistema serán enviados a esta dirección. La dirección de correo electronico no se hará pública y solo sera utilizada si usted solicita una nueva contraseña o desea recibir ciertas notificias y notificaciones por esta vía."

This msgid description is same as in user.module, I also enable field translation but nothing happend. How i can do this changes in my spanish site.


texts:
I have created an override template for the poll content type called "page--type--poll.tpl.php" using a preprocess hook, but now I need to create extra effect on this template so that when people click on the title from the front page the node will show in a lightbox.
I got the lightbox effect to work, but it still shows the whole node, How I can tell drupal that this content type has two templates and that the difference is which link they clicked from the view.


texts: how to custom position drupal login field

texts: How do I custom position default login form that (in my case with BLUEMASTERS theme) pops up down below the title of the content page like: ABOUTUS. I want to position it in the sidebar.


texts: How to upgrade to Drupal 8 from 7 with clean install?

texts:
I currently have a Drupal 7 site that I want to install Drupal 8, but do a clean install. This means wiping away everything and starting with a new Drupal 8 instance. I have seen many articles on how to upgrade where the content types, fields, code, and other parts are migrated. However, I just want to upgrade to Drupal 8 without any migration of the content type, files, databases, and remove old directories that are not needed for Drupal 8.

How can I upgrade to Drupal 8 without any migration for a clean instance?


texts: How can I show the flagging field edit form on a node?

texts:
On a flagged node, instead of showing the flag/unflag link, I want to show the flag edit form.
Here's my setup.
Basic page content type can be flagged with the flag Bookmark.  Bookmark is a per-user flag that has an int list field Rating, which has values from 1 to 5.  On the flag admin page (/admin/structure/flags/manage/bookmark), Link type is set to Field Entry Form.
What happens now:

Go to a basic page that has been flagged.
Click the "Unflag" link for bookmark.
The Field Entry Form pops up and lets me edit the value of Rating or delete the flag.

What I want to happen:

Go to a basic page that has been flagged.
The Field Entry Form is embedded in the page and the user can adjust the rating as he/she likes.

I don't know how to build the form.  By digging through the flag module code, I managed to find the class that generates the form in FieldEntry.php:
/**
 * Class FieldEntry
 *
 * @ActionLinkType(
 *  id = "field_entry",
 *  label = @Translation("Field Entry Form"),
 *  description = "Redirects the user to a field entry form."
 * )
 */
class FieldEntry extends FormEntryTypeBase {

But I don't know how to embed this in a node.
I looked at Inline Entity Form but that only supports Commerce modules and Entity Reference fields out of the box.
I also tried the Twig Tweak module and tried to embed an entity edit form using a view that returns the flagging ID like this:
{{ drupal_entity_form('flagging', id__value) }}

However, this gives me an error:
Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template ("The "flagging" entity type did not specify a "" form class.") in "__string_template__87f4d3d6f14aa36d2fb8ce031f07b73d8b577189b4e5f3c535809f672ffb6af8" at line 1. in Twig\Template->displayWithErrorHandling() (line 469 of /app/vendor/twig/twig/src/Template.php).

I can embed the entity itself with Twig Tweak just fine (but that is not the goal; the goal is to embed the entity edit form):
{{ drupal_entity('flagging', id__value) }}


texts: How to calculate result from fields inserted?

texts:
I'm new to Drupal. Can anyone advice me on what's the method of collecting data information from inserted results?

For example, suppose I have book content type, when I insert data into its fields I want a page to show results of the following:

How many book has been inserted? (eg. 5 books)
How many magazine? (eg. 2 magazine)
How many references?(eg. 1 reference)
How many novels? (eg. 2 novels)
How many guide book? (eg. 0 guide)

I've been trying to figure this out through and my last option which is to code the result myself(the hard way).


texts: Is it possible to change a view from a user view to a node view?

texts: I have a view that has a couple of displays and a lot of complex field definitions. I now realize the view may have been created by cloning the wrong starter view. Something went wrong such that the view is based on user and the base_table = 'user' when it should be based on nodes. Can I change it to be based on nodes? Or is there a quick way to add my display and field definitions to a newly created node view, perhaps by exporting both and copying over bits of the code? I'm using Views 2.


texts: Drupal and mobile - integration across multiple applications

texts: I have Drupal installed to Amazon EC. I was wondering is it possible to make another database so that mobile users can upload pictures with location there and users from the Drupal website can see these pictures? What would I need to do?


texts: Rendering a region in region--footer.tpl.php

texts:
I have my social media links in my sidebar_first region. And these social icons are included in my footer. So in region--footer.tpl.php, I have rendered sidebar_first region  but it is not displaying, I know this is a wrong way to render a side bar region in footer region, does anybody have idea how can I achieve this:

<?php if ($content): ?>
<footer id="footer" class="<?php print $classes; ?>">

    <?php $foter_menu = menu_navigation_links('menu-footer-menu');
      $variables['footer_menu'] = print theme('links__menu_footer_menu', array('links' =>      $foter_menu,'attributes'=>array(''),'heading'=>t('')));
      ?>

      <?php print render($page['sidebar_first']); ?>

<?php endif; ?>

then in my page--front.tpl.php

 <?php print render($page['footer']); ?>


texts: Webform page wizard and submission data - no reference to which page the element was on

texts:
I am creating a multi-page webform questionaire using the Page wizard.

I have also created a custom handler so I can manipulate the data from the form when completed.

My issue is that when using $webform_submission->getData in the method 'submitForm' in my webform handler class to gather the data, there is no reference to which page the element is from, the array simply contains the element key and value pair.

What would be a proper way of figuring out which page each element is from?


texts: Patch a contrib module with a patch that contains new files

texts:
How do I patch the recaptcha module with the invisible recaptcha patch using drush make? I patch modules all the time in project.make.yml with yml that looks just like this:

...
# Recaptcha 8.x-2.2 - 2016-07-30
recaptcha:
  subdir: contrib
  version: '2.2'
  patch:
    # Integrate Invisible reCAPTCHA option from Google
    - 'https://www.drupal.org/files/issues/recaptcha-invisible-option-2852269-56.patch'
...

What's different with the invisible recaptcha patch is the patch contains two new files.


texts: How do I alter the order used to load JavaScript files?

texts:
I created a libraries.yml file with the following content.

highcharts:
  css:
    theme:
      highcharts/css/highcharts.css: {}
  js:
    highcharts/highcharts.js: {weight: -400}
    highcharts/modules/exporting.js: {weight: -29}
    highcharts/modules/data.js: {weight: -28}
    highcharts/modules/drilldown.js: {weight: -27}
    js/hc.js: {weight: -1}
  dependencies:
    - core/drupal
    - core/jquery

hc.js is my custom JavaScript file content. I set its weight to -1 to make it the last used file, but after clearing the cache and refreshing the page, I still JavaScript error because the order used to load the JavaScript files. (hc.js is loaded before highcharts.js).

Do I need to change the content of the libraries.yml file?


texts: Test a settings form that displays a queue

texts:
I'm trying to write a test on a settings form. The module uses a queue, and the settings form displays the items in the queue like so:

When I extend the test class from WebTestBase I get:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mskcc_local_d8.test73723996queue' doesn't exist: SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {queue} q WHERE name = :db_condition_placeholder_0) subquery; Array ( [:db_condition_placeholder_0] => google_analytics_counter_worker ) in Drupal\google_analytics_counter\GoogleAnalyticsCounterManager->getCount() (line 635 of modules/contrib/google_analytics_counter/src/GoogleAnalyticsCounterManager.php).
Drupal\Core\Database\Statement->execute(Array, Array) (Line: 625)
Drupal\Core\Database\Connection->query('SELECT COUNT(*) AS expression
FROM
(SELECT 1 AS expression
FROM
{queue} q
WHERE name = :db_condition_placeholder_0) subquery', Array, Array) (Line: 87)
Drupal\Core\Database\Driver\mysql\Connection->query('SELECT COUNT(*) AS expression
FROM
(SELECT 1 AS expression
FROM
{queue} q
WHERE name = :db_condition_placeholder_0) subquery', Array, Array) (Line: 510)
Drupal\Core\Database\Query\Select->execute() (Line: 635)
Drupal\google_analytics_counter\GoogleAnalyticsCounterManager->getCount('queue') (Line: 134)
Drupal\google_analytics_counter\Form\GoogleAnalyticsCounterSettingsForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 514)
Drupal\Core\Form\FormBuilder->retrieveForm('google_analytics_counter_admin_settings', Object) (Line: 271)
Drupal\Core\Form\FormBuilder->buildForm('google_analytics_counter_admin_settings', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 664)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

which tells me that the queue table is missing from the automated test environment.

But when I extend the test class from KernelTestBase and add

// These additional tables are necessary because $this->cron->run() calls
// system_cron().
$this->installSchema('system', ['key_value_expire']);

$this->connection = Database::getConnection();
$this->cron = \Drupal::service('cron');

to setup(), I assume my automated testing environment will contain a queue table (still to be determined). But the methods I regularly use to test a form, like $this->drupalGet and $this->assertResponse will now be not found.

How can I test a settings form that displays the contents of the queue table?

Thanks


texts: In a tableselect form element with '#js_select' => FALSE, how can I re-use the column header for a label?

texts:
I have a pretty ordinary tableselect element that looks like so

$form['registration_table'] = array(
    '#title'=>"Register",
    '#type' => 'tableselect',
    '#header' => $header,
    '#options' => $enrollment_options,
    '#js_select' => FALSE,
    '#multiple' => TRUE,
);

What I would like is to be able to use the empty space which is reserved for the "select all" checkbox for a text label. I would like to indicate by the label what action the checkboxes represent. In this case they represent selecting a course to register for so I would like to add the label "Register" there. Any advice on how to do this?


texts:
How can I relate content in Drupal 7?

I have three content types:

Product Group ( With detail page )
Product ( With detail page )
Application ( With detail page )

A product belongs to a product group.

An application belongs to a product group.

How can I do this kind of relationship?


texts: How can I enable unauthenticated user to activate himself? not to wait for administrator activation.


texts: How do I get a node based on id in custom content type?

texts: I have a custom content type A that has a field for node id which refers to a different content type B. While creating my view for content type A, I want to identify the id in the field entered by the admin and based on the id find out what node of content type B is being referred to and generate a teaser view for B in the View of A. Does anyone have any insight on how to do this? Its more like providing a list of References with links to an Article where Article and References are both different content types.


texts: Views entity reference field filtering results based on permissions but not overridable

texts:
I have created an entity reference field on a node type and it references entities of the Profile type, my Profile bundle is called 'Staff profile'.
I want to allow certain users to see staff profiles of other users in this entity reference field, but I don't want them to see ALL users staff profiles.
If a user has the permission "Staff: View any profiles" then they can see EVERY profile in this entity reference field, once I remove this they can only see their own - this is as expected and does seem to indicate my issue is with permissions.
So I am trying to allow this access to certain profiles for certain users in a 'my_module_profile_access' function. And this is working in that if I try to view a profile directly i.e. I go to /profile/123 (with a user whom I have allowed access to view the profile) it works fine, it works as expected.
However this behaviour does not repeat itself when I try to use the entity reference field, which makes me suspect there is some other permissions interfering here?
For what it is worth my hook_entity_access function looks something like this -
function my_module_profile_access(Profile $profile, $op, $account) {
  $profileOwner = $profile->getOwner();

  if ($account->id() == '2' && $profileOwner->id() == '123') {
      return AccessResult::allowed()->cachePerUser()->addCacheableDependency($profile);
  }
  // No opinion.
  return AccessResult::neutral();
}


texts: How to add radio button in drupal profile page

texts:
I want to get more info from my users when they register.
With the standard profile.module I have the following options:

single-line textfield
multi-line textfield
checkbox
list selection
freeform list
URL
date

But I want radio buttons to select 1 option from multiple options.
This can be done with list selection, but I prefer radio buttons.

Can anyone help me with this?


texts: Creating node via REST POST gives "leaked cache metadata" error

texts:
I'm trying to create new nodes by POSTing to /entity/node?_format=json.
This is the body I'm sending:

{
    "_links": {
        "type": {
            "href": "http:\/\/my.drupal.be\/rest\/type\/node\/group_of_documents"
        }
    },
    "title": [{
        "value": "Direct test - type 682"
    }],
    "body": [{
        "value": ""
    }],
    "field_owner": [{
        "value": "Symfony"
    }],
    "field_type": [{
        "target_id": "682"
    }]
}

And, in a way, this works. Because the document gets made, and everything is filled in.

But I keep getting an error:

A fatal error occurred:
The controller result claims to be providing relevant cache metadata,
but leaked metadata was detected.
Please ensure you are not rendering content too early.
Returned object class: Drupal\rest\ResourceResponse.

If I create a node without field_type, it doesn't throw an error.

field_type is the only field that has the Reference type -> Reference views -> Reference method set to Views: Filter by an entity reference view. Does that have anything to do with it?


texts: MIssing 'Drush configuration' and 'Php configuration' when running 'Drush status'

texts:
If a run the method 'drush status' in the terminal I see that the values for  'Drush configuration' and 'Php configuration' are missing.

It give me not problem at all. But is this correct?

Look the capture:

I use the free version of MAMP.


texts:
I'm using Drupal Commerce shipping. I've watched every video and I can not fathom how to effect this everyday shipping rule.

In the real world it is very common for shipping to be priced per package, on the basis of an initial price for the first few kg up to a given weight, plus an additional charge for each kg extra, up to a maximum weight per package. The charges are then recalculated for each additional package. The maximum weight is often dictated by health and safety rules for lifting heavy items.

For example, $10 up to 10 kg, then $1 for each kg extra up to a maximum of 25kg. Rinse and repeat

Assumed is the use of physical_field and please substitute kg for your preferred weight measurement.

Any ideas?


texts:
I am working on a Drupal 6 theme which uses the Zurb Foundation 4 framework. The problem I have is ideally Foundation 4 requires jQuery version 1.10.2.

Drupal 6 only supports up to jQuery version 1.3.2 using the jQuery Update module. Upgrading site to Drupal 7, unfortunately isn't an option.

I have search through forums and tried a number  of the suggested solutions but I can't seem to get both versions of jQuery to function without either breaking Core or Zurb Foundation  functionality.


texts: Is it possible to redirect a user to avoid showing an AJAX batch processing error?

texts:
I'm trying to allow users to cancel their accounts without requiring e-mail confirmation as described in this question.

Currently, when I use the following code, the user account is cancelled properly, but the AJAX display shows a nasty error.

  else {
    // Cancel the account
    user_cancel($form_state['values'], $account->uid, $form_state['values']['user_cancel_method']);

I tried adding drupal_goto('user/logout'); after user_cancel(), but this immediately logs the user out and the account is not cancelled.  What I would like to do is cancel the account, log the user out, and somehow not display this error.


texts: How to show a view with 2 columns on the front page?

texts:
I need in the front page on my website to show a view with two columns : the left column will show the two latest content from a category, and the same for the right column.

How can I achieve this?


texts:
In Drupal 6 to check if node is displayed as page we can use:

Select the condition to add - > Check a truth value

Truth value - > <?php echo $page ?>

How to do this in Rules 2.x for Drupal 7? I don't see the condition with name Check a truth value


texts:
How can I reduce div elements Drupal creates in a view block?

for exmaple I have a block created by view and I see these many divs:

aaaaaa

                    bbbbbb

Are these two many div really needed? Can I reduce them by define a theme for this block?


texts:
Hi I am developing a module in which i am sending data from javascript to drupal using jquery ajax.

but i am getting 404 error undefined.I am not able to figure out. Pls help

Here is my code

This is tbg.js an external js file

$.ajax({
        url: 'localhost/drupal/my_currenttime/10',
        type: 'GET',
        success: function(data){
            alert(data);
        },
        error: function(jqXHR, textStatus, errorThrown){
            alert(jqXHR.status+textStatus + errorThrown);
        }
    });

In my module file i am calling this js file in hook_nodeapi

function modulename_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL)
{
  switch($op)
  {
    case 'view':
    drupal_add_js(drupal_get_path('module', 'modulename').'/tbgscript.js', 'module');
    break;
  }
}

I have created a call back url for the ajax request in modulename_menu() hook

function modulename_menu()
{
  $items['my_currenttime/%'] = array(
  '#title' => 'My custom callback',
  'description' => 'Desc',
  'page callback' => 'custom_currentTime',
  'page arguments' => array(1),
  'access arguments' => array('access content'),
  'type' => MENU_CALLBACK,
  );

  return $items;
}

and my page call back method is

function custom_currentTime($args)
{
   echo "HELLO".$args;
}

i want to access the value $args in my module file.


texts:
Possible Duplicate:
  How to add JavaScript to my Drupal site?

I'm writing some javascript for my content type so that when new content is created, while inputting for one field, the other fields would automatically populate and update.

I was told to use drupal_add_js() to include the js file, but I'm still a bit new to Drupal. Can anyone walk me through the whole process?

Like where to put the js file, where to tell drupal to include the js file, how can I target the content field in js?

Thanks


texts: form_set_error not working in node form validation

texts:
I'm frustrated right now. This very reduced module code shows the problem:

<?php

function mymodule_form_alter(&$form, &$form_state, $form_id) {
  if ('pic_node_form' == $form_id && !path_is_admin(current_path()) ) {
    $form['#validate'][] = '_mymodule_pic_add_form_validate';
  }
}

function _mymodule_pic_add_form_validate($form, &$form_state) {
  form_set_error(null, t('Keep calm bro'));
  // die("foo");
}

function mymodule_node_validate($node, $form, &$form_state) {
  form_set_error(null, 'test');
  // die("bar");
}

pic_node_form is the node add form for the content type pic. That form is exposed (hence && !path_is_admin(current_path())). There is an image upload field involved.

The form_set_error doesnt do anything and nodes keep getting submitted. The die() functions actually work when I remove the //, so the functions do get invoked.

The form itself is placed via block:

function _mymodule_get_block_content($delta) {
  if ('pic_add_form' == $delta) {
    global $user;
    module_load_include('inc', 'node', 'node.pages');
    $node = (object) array(
      'uid' => $user->uid,
      'name' => (isset($user->name) ? $user->name : ''),
      'type' => 'pic',
      'language' => LANGUAGE_NONE,
    );
    $form = drupal_get_form('pic_node_form', $node);
    $form_rendered = drupal_render($form);
    $markup .= $form_rendered;

    return $markup;
  }
}

Any ideas what I am doing wrong?


texts:
On my live site I am unable to see the drag and drop functionality only on taxonomy, whereas it is successfully appearing on menus.Below is my screen shot for taxonomy.

It should be like this:

Can any one have idea about this?


texts: Drupal 8 Image Styles Not Generating - LEMP on CentOS 7

texts:
Centos 7
Nginx 1.10.2
PHP Version 7.1.5
Database 5.5.52-MariaDB
Drupal 8.3.2

I have exhausted just about every possible google result and every forum post I can feasibly find. Thank you in advance for any help you can offer me.

PROBLEM:
Images are uploading to the appropriate folders under /sites/default/files/WHATEVER-SUBDIRECTORY

Image styles are not generating under the /styles folder and I am getting broken images whenever they should appear on-page.

I HAVE TRIED:

Rewriting my Nginx config.
Setting all permissions to 777 (for testing purposes).
Adding $conf['image_allow_insecure_derivatives'] = TRUE; to
settings.php.
All directories and files are owned by the correct user/group.
Flushing cache as well as image stores.
The only type of errors I have been able to find are in my nginx
access.log: "GET
/sites/default/files/styles/large/public/2017-05/my_image.jpg?itok=Ax9jzc70
HTTP/1.1" 404 571 "https://mysite.mysite.come/node/1" "Mozilla/5.0
(Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/58.0.3029.96 Safari/537.36" "-"Safari/537.36" "-"

nginx.conf:

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    server {
        listen 443 ssl http2;
        server_name     mysite.mysite.com;
        root /var/www/drupal;
        ssl_certificate SSL CERT HERE;
        ssl_certificate_key SSL CERT KEY HERE;
        ssl_session_cache shared:SSL:100m;
        ssl_session_timeout 30m;
        ssl_protocols TLSv1.1 TLSv1.2;

    location / {
        try_files       $uri /index.php?$query_string;
    }

    location @rewrite {
        rewrite ^/(.*)$ /index.php?q=$1;
    }

    location ~ /vendor/.*\.php$ {
        deny    all;
        return  404;
    }

    location ~ \.php(/|$) {
        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
        include fastcgi_params;
        fastcgi_param   HTTP_PROXY "";
        fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param   PATH_INFO $fastcgi_path_info;
        fastcgi_param   QUERY_STRING $query_string;
        fastcgi_intercept_errors        on;
        fastcgi_pass    127.0.0.1:9000;
    }

    location ~ ^(/[a-z\-]+)?/system/files/ {
        try_files $uri /index.php?$query_string;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        expires max;
        log_not_found   off;

    }

    location ~* /sites/.*/files/styles { # For Drupal >= 7
        access_log      off;
        expires         max;
        try_files $uri @rewrite;
    }
    }

server {
listen       80 default_server;
server_name  mysite.mysite.com;
root         /var/www/drupal;
return 301 https://$server_name$request_uri;
}
}

Everything else seems to be working like a dream, but I can't for the life of me seem to figure out these image styles. Any guidance would be greatly appreciated. Thanks again.


texts: Need to add SKU to order confirmation email - Commerce 2

texts:
I have been able to customize the order confirmation email twig file for a client to some degree, however when it comes to adding the SKU for each item ordered I cannot find a way to have it populate. I have tried to insert the commerce checkout order summary block that displays each product variation's sku, it did not populate in the email. I have also looked at the order item table which does include the SKU for the items ordered so I cannot pull from there.

Any advice on how to pull the SKU's into the order confirmation email twig file?


texts:
I've been trying to ajaxify the node creation form, the purpose?

Save the node and remains in the node creation page (Done)
If the user clicks the save button again save a new node

The second point is not working yet because once the Ajax request is sent again the previous created node is updated.

I tried with:

function saveAjaxForm(&$form, FormStateInterface $form_state) {
  $response = new AjaxResponse();
  $response->addCommand(new AlertCommand('Saved'));

  return $response;
}

It works, but other #submit callbacks in the form aren't called again.

How can I "execute again" all the submit functions in the form?


texts: How to send HTML/Rich text email from /contact

texts: I want to allow other text formats on the /contact form than just plain text.  I haven't been able to find a module that does this.  Is it possible to do this in D7?


texts: How can I grant permissions to anonymous users per session to download a file?

texts: Anon users can fill out and submit a form (webform). As soon as submitted, the user will be offered to download a pdf file with his entered form data. How can I manage this? With sessions?


texts:
I can add an order item from the cart by doing this :

\Drupal::service('commerce_cart.cart_manager')->getStorage('commerce_order_item')->create(array())

Is there a similar way to delete a product line from my cart ?


texts: How to configure chosen on Form API with an entity_automcomplete widget?

texts:
How to configure chosen field on Form API with drupal 8.
I have already installed chosen and it's works in User Interface and not in form API.

This peace of code doesn't work:

          $form['tags'] = array(
        '#type' => 'entity_autocomplete',
       '#chosen' => TRUE,
        '#target_type' => 'taxonomy_term',
        '#selection_settings' => ['target_bundles' => ['tags']],
        '#title' => ('Tags'),
        '#empty_value' => ''
       ;


texts: How can I modify the search results on drupal 7 so that the submitted by author and date doesn't appear?


texts: Is there a way to display an 'All' link following the alphabetic glossary with Views 7.x-3.x?

texts:
I have an existing feature in a Drupal 5 site I'm trying to reproduce in Views 7x3x, but I didn't find a way to make it happen.

I have the glossary functionality working in Views 7.x-3.x but the 'All' link functionality is eluding me. This selector needs to work in combination with a filter (taxonomy) so this limits the obvious workarounds because the Views module needs to be aware of the filtering.

How do I display an 'All' link following the alphabetic glossary?

I have it working using a jQuery snippet, but would love an elegant server side solution.

I found these solutions on drupal.org.

I haven't tested any but if anyone does; please post your experience as an answer for this question.


texts: How to give weigthage while creating a folder?

texts:
I am creating folders in public:// folder by using file_prepare_directory function. I will create a folder while installing a module, So I want to keep that particular folder always bottom. Whenever I create new folder those should come on top. So How can I achieve this? In my case because of creating a folder while installing the module will become always on top I want that to be last. Thanks in advance for any suggestions. For example: I need like below

defaultFolder -created while installing.this should be always down.

Folder1 created later. these below 3 folder should be always up  of defaultFolder
Folder2 created later
Folder3 created later

But in my case defaultFolder is coming always on top and remaining folders are coming below of defaultFolder folder.


texts: How can a group manager create new users from within an Organic Group?

texts:
Is there a way for an Organic Group manager to create new users and automatically assign them to the group? Currently, OG allows the group manager to add users that have already registered to the site, but there is no form that shows something like create user form that is usually only available to the site administrators (as opposed to group managers).

I've also seen the config where the users can subscribe to the group, but it's a different case. What I want is only allow the group manager to create new users and not allow users to subscribe to the group themselves.

I've only been searching for modules and OG configs but couldn't find any relevant search results.


texts: How to disable "publish" content for a particular role?

texts:
I created a role called writer who should have the ability to create content, but not be allowed to publish it.  A person with the admin role can review the content then publish it.

Also, if a writer edits existing content, it can not be immediately published to the website.  Only an admin can publish it after review.  Until then, the old version is displayed.

How do i disable the ability to publish for a person with the writer role?


texts:
I have a hook_boot() module that detects certain circumstances and changes the theme using $custom_theme to a specific theme. All works good, however if Drupal has a cache of the page that page will be served regardless of the fact it is not the correct theme.

Is there anyway to force drupal not to use and caches for that specific theme? Or is there a way to force drupal to keep two caches? One for each theme?

I am using Drupal 6 btw.


texts: How does one get the server IP address of the server you are on to appear at http://examplehost.com/admin/reports/status/php -- at the very bottom ? I keep getting 127.0.0.1. This is on two web servers that are behind a load balancer.


texts: How do I use a different template for the anonymous users?

texts:
If the user is the anonymous user or an authenticated user, I want to use the page1.tpl.php; with other roles, I want to use page.tpl.php.
How do I write the code?


texts: Adding custom classes to Views Filters (view-filters) and Content (div.view-contents)

texts:
I'm using a theme that includes bootstrap. I'd like to inject class one_third into
 and two_third last to
. Is there a way to do so from any theme theme_preprocess_area?

I know I could accomplish using javascript (selecting div.view-filters and addClass()), but I think it would be most prudent to handle in perhaps the preprocessing?


texts: How to get organic groups post in a separate view

texts: I am having troubles creating a new view of Group nodes and including the post that are associated with each group. Is this possible using relationships?


texts:
I tried setting the cache max-age to 0 in hook_views_pre_view, in hook_views_pre_build and in hook_views_query_alter but it just doesn't work.

Eg:

function my_module_views_pre_build(ViewExecutable $view) {
  $view->element['#cache']['max-age'] = 0;
}

The views caches the response until the caches are cleared.

I need to do this programatically because I need to force the views to not cache the results for more than 10 minutes based on some conditions.

Later Edit: The issue discussed in "How to use max-age" does not apply in my case. I know how to use cache tags, contexts and max-age for pages/rendered arrays and they work just fine. But for views I can't make them work.


texts: Implementations suggestions for content on front page

texts:
My front page needs to look like the following:

The header, navigation, and white content areas are part of my page.tpl.php, and show up on all pages.

I'm assuming I can power the blue Image Carousel by creating a content type that contains an image and caption, then create a view that pulls those images out of the database.

Below that are 3 areas which contain different stuff.

"1" is an image that is a link. The image and link need to be controllable by the admin.
"2" is a Facebook social plugin. I'm assuming I can just create a content block and paste the HTML from Facebook into that and assign that block to show up on the front page, somehow.
"3" is another, smaller, image carousel, but will most likely use a different content type (assuming I should be using content types for this at all).

What is the best way to put this page together?
It doesn't need to be completely flexible from the admin screens. I'm OK with building a front page template.

How would you build this page? I'm getting to the point where I can get things to work, but I don't think I'm doing them in the most efficient and/or Drupalish way.


texts: How do I set up a More Link in a View's Pager?

texts:
I have a View and am using the Pager to display a specific number of items, limited to 4. I want to create a "More" link to link to the rest of the items.

I've set my view up as such:

But no More link is appearing, even though I have more than 4 items and even though the helper information says:

  This will add a more link to the bottom of this view, which will link to the page view. If you have more than one page view, the link will point to the display specified in 'Link display' section under advanced. You can override the url at the link display setting.

I've looked through the HTML to ensure the link is not hidden by anything else. It's simply not present.

Would anyone know how to get this working?


texts: Field widget do not save values in database!

texts:
I have a strange problem. I'm designing a new field type using field-API with a widget of course.
My widget display is ok but when I save a node the field do not save the value entered in the widget..

This is the hook_field_schema()

function MODULE_field_schema($field) {
  $columns = array(
    'streamtype' => array('type' => 'varchar', 'length' => 25, 'not null' => FALSE),
    'streamtag' => array('type' => 'varchar', 'length' => 25, 'not null' => FALSE)
  );
  return array(
    'columns' => $columns,
  );
}

And this in the hook_field_widget_form()

function MODULE_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {

      switch ($instance['widget']['type']) {

        case 'MODULE_default_widget':
          $item = $items[$delta];

          $element += array(
            '#type' => 'fieldset',
            '#delta' => $delta,
            '#element_validate' => 'MODULE_field_basic_widget_validate'
          );

          $element['streamtype'] = array(
            '#type' => 'radios',
            '#title' => t('Stream type.'),
            '#description' => t('Search images by:'),
            '#options' => array('author' => t('Author name'), 'tag' => t('Tag')),
            '#weight' => isset($element['#weight']) ? $element['#weight'] : 0,
            '#delta' => $delta,
            '#default_value' => isset($item['streamtype']) ? $item['streamtype'] : NULL
          );

          $element['streamtag'] = array(
            '#type' => 'textfield',
            '#title' => t('Stream tag'),
            '#description' => t('Insert author name or tag depending to the selected steam type'),
            '#required' => $instance['required'],
            '#weight' => isset($element['#weight']) ? ($element['#weight'] + 1) : 0,
            '#delta' => $delta,
            '#default_value' => isset($item['streamtag']) ? $item['streamtag'] : NULL
          );

          break;

      }

      return $element;
    }

The basic fieldset have a validation function and, in this one i can see the correct value in the $item.
An example from watchdog()

Array ( [0] => Array ( [streamtype] => tag [streamtag] => tag1, tag2, tag3 ) )

Where can i search the error?
Please help me, this problem is driving me crazy T____T


texts: How to set image style for particular image in node creation or edit?

texts:
I want to add some image style to the particular image, preferably the first image for adding some badge like "Agent Face Image".

My idea is when creating the node, there is an option for check box. If the user selected the check box, a particular style need to be applied to that image only, if unchecked then vice-versa. I'm using Drupal 6.

How can I achieve this?


texts: How to catch username or password using hook_form_alter

texts:
I need to catch username/password using the hook_form_alter(). I'm using this code:

function sds_form_alter(&$form, FormStateInterface $form_state, $form_id ) {

  if (in_array($form_id, ['user_login_block_form', 'user_login_form'])) {
    $username= $form_state->getValue('name');
    echo "Username Value".$username;
  }

}

but it returns null. What am I missing here?


texts: Can I have a body apply to a different page than the current content type?

texts:
I want to give the editor user a good experience where he/she can edit everything about one news article in one content type. I have a gallery that takes a content type where he/she can place an image, caption, and a link. I desire this link to be pointing to the page where the body wysiwyg would be. I would like the body to be in the same content type, just displayed on a different page.
I hope I am clear. Thanks for your help!


texts: db_query() not compatible with IN operator?

texts:
I ran into a snag setting placeholders for the IN operator, and then I ran into a webpage that basically says, if I'm reading it correctly, that they are not compatible. I also found a forum post on this subject in which the questioner gave up and expanded his IN into a series of ORs.

Apparently, I have the choice of either expanding the IN into ORs or learning to do dynamic queries. Since db_select() apparently comes with a lot of overhead, I suppose the ORs will run faster.

Is this correct, or is there a way to use IN with db_query?


texts: Is it feasible to have UUID as the primary key for custom entities?

texts:
When creating your own entities via the Entity API module, it is possible to get a UUID key via the UUID module.

However, it seems that the default set-up is to still have a “serial” (ie. auto-incrementing integer) as primary key.

This is not optimal; there's no need to have two surrogate keys for the same object.

Does anyone have experience in using UUIDs as the the (only) primary key? Can you do it without having Views and other modules puke?


texts:
I'm only using i18n and not Entity Translation.

I've an English version of page set as front page( node/page1).

I've restarted working on my multilingual site after 2 months and previously it was working fine.
Earlier I had added French, German, etc translated version of this page.

So if I go to mysite.com/de or mysite.com/fr those translated pages are shown automatically(in short existing translated pages are getting redirected correctly).

But now (after 2 months) when I add translation for untranslated languages like "it" then mysite.com/it does not redirect to the Italian version of the home page.

I've Global Redirect, Translation Redirect enabled. I've also tried clearing all cache several times.

What could be the problem?


texts:
I would like to add a user reference field to the Workflow tab.

Currently we have a user reference CCK field but it is only editable in the Node edit form. Really it would make much more sense to be able to "assign" the content to an owner via the Workflow Tab.

Any advice on what might be a good place to start? Existing modules / template functions etc?


texts: simple SAML php Drupal Initial Load causes partial loading of $user variable

texts:
I have a very weird issue where the $user variable doesnt load fully during an initial login into the site. I am using simpleSAMLphp login module which routes me outside of the drupal site to authenticate and then brings be back to the drupal site. Upon coming back to the Drupal site, some functions are not loaded due to the fact that my "user role" isn't fully populated. This causes issues with context and other role based conditions. I tried moving the simpleSAMLphp module's weight lower to load it before other modules load, but that didn't seem to work.

Below are 2 screenshots of the initial login and the second image is after a page refresh which populates the $user variable properly. Again, this only causes issues on initial load of the site, but after a refresh everything functions normally again.

As you can see here, this is the first initial load. Notice the roles array only shows the role id only ([5] > 5) :

Now this is what we see on the refresh. It shows alot less data, and the roles show the full role name

Now the question is why is it doing this? It seems that its in an in between limbo before my $user gets updated with the authenticated role as the role names aren't even processed yet as it's only showing the role id during the initial load.

Is there a flowchart of how the $user variable gets populated and constructed on a drupal inital load?


texts: Is it possible to use jQuery's modal dialog instead of the browser-standard alert when using ajax_command_alert()?

texts:
I'd like to have a simple feedback form that is submitted via AJAX, using Drupal 7. Upon receipt of the form, I want a simple jQuery modal dialog to appear that will say something along the lines of "Thank you for your submission, etc.". The browser standard alert does accomplish this, but my client feels that this looks unprofessional, hence the desire for the more nicely styled jQuery dialog.

Using ajax_command_alert() causes the browser to use a simple alert() function. Is there any way to force usage of the jQuery modal dialog? For reference, my code is below:

function feedback_form($form, &$form_state) {

    $form['first_name'] = array(
        '#type' => 'textfield',
        '#title' => 'First Name',
    );

    $form['last_name'] = array(
        '#type' => 'textfield',
        '#title' => 'Last Name'
    );

    $form['email'] = array(
        '#type' => 'textfield',
        '#title' => 'Email'
    );

    $form['comments'] = array(
        '#type' => 'textarea',
        '#title' => 'Comments'
    );

    $form['submit'] = array(
        '#type' => 'submit',
        '#value' => 'Submit Feedback',
        '#ajax' => array(
            'callback' => 'feedback_form_submit'
        )
    );

    return $form;
}

function feedback_form_submit($form, &$form_state) {
    $commands = array();
    $commands[] = ajax_command_alert("Form received");
    return array('#type' => 'ajax', '#commands' => $commands);
}

EDIT: I see that the alert function is defined in misc/ajax.js, under Drupal.ajax.prototype.commands. If I were to alter the JS file's implementation of alert, this would work - but that would be considered hacking core, I believe. How else could I alter this function?


texts: Render one Paragraphs Module field value inside another Paragraph field's .html.twig template

texts:
This question is for the Paragraphs module for Drupal 8.

I've created a Paragraph Type with 4 fields: Title, URL, Image, and Description.

I want to take the value from the URL field, and use it with the Title and Image fields, so that my title and image have a link wrapped around it with the href getting the value from the URL field.

My idea was to use Twig template suggestions for the Title and Image fields, but I can't figure out how to render the value of the URL field in those .html.twig files....

For example, I have a twig suggestion template for the title, called:

field--paragraph--field-list-item-title.html.twig

My idea was to render the value of the URL paragraph field with this:

{{ paragraph.field_list_item_link_url }}

so that the code inside my field--paragraph--field-list-item-title.html.twig file looks like this:

  {% else %}
{% for item in items %}

{{ item.content }}

{% endfor %}{% endif %}

But its not rendering anything.

Is there a way to accomplish this? Is there another way instead?


texts: It seems most people rather keep the exif data, and have trouble keeping it. I have the opposite problem - we have a profile picture upload and it keeps the exif data. I'd like to strip that off the images. Is there a way to actively do that?


texts:
I am using Druapal 7 and wyswing editor. i used full HTML. Now my body content is not showing .Can anybody tell me the reason.

Thanks


texts: Remove password reset fields on user profile

texts:
Since we're only permitting logging in via the Drupal Admin and LDAP.

How might I turn off or hide these fields in the User's Edit Account (user/xx/edit) tab?


texts:
I want to have a page in my site where the logged in user can look for hospitals, clinics and pharmacies near to him.

I want these information to be shown on a map, preferably Google maps. I came to know about Location module, but I dont know whether I can accomplish what I want to accomplish using it.

The map should only show hospitals, clinics and pharmacies around the user's location (withing a 30 km radius for example).

What's the right way to go to get this done?

What reported in How to implement a store locator? does look similar to what am planning, but in their case they have kind of plotted all their stores on the map and they have displayed the ones near to the user. In my case, I want users to be able to search for hospitals and such places (it doesn't matter what hospital it is) or see those places close to their current position. I want to get something similar to what shown in the following screeshot, which is showing all the dental clinics in Bangalore. How can I get this functionality?

I have tried, OpenLayers Locator as suggested by nicoz. So far I have been able to get the below result.

I created a content called 'Location' which takes the address while creating. Using the Views module, I am displaying that address on a map. That's not what I want: I want the users to be able to search for it.
I am also not getting that proximity option. What customizations should I have to achieve this? I don't know what to change, and where. I am getting the following error on the module page:

  Error making request to server.

I am getting some AJAX errors when I try to edit views (especially 'page' option).


texts:
I have a website where visitors can follow a course. I have several course available. I have problems to achieve the following process:

A anonymous visitor can see a list with available courses and can click on subscribe. The subscribe link is a Rule_link names Subscribe and belongs to the course module.

If the users is already logged or authorised no problem. By the subscribe rule link I am able to do all.

If user are anonymous they should make an account. In this process I will lose the subscribion to the specific course.

How to solve this?


texts:
I installed the blog module.
Now I want that each user before posting first blog, choose their blog address.
I want that they can choose their own blog address.
For example user A can select that his blog be on http://mydomain.com/myblogaddress.
How to achieve this ?


texts:
I  have created a content type page named events where several fields are there. also I have created a  view page where list comes of events(title,body and read more). when we click on read more it takes me to the content display page

what I want to do is on display content page i want some sidebar links so that other fields should comes related to that particular node.


texts:
I am  building a custom block. The content of module_name/src/Plugin/Block/MyCustomblockName.php is the following.

    namespace Drupal\module_name\Plugin\Block;

    use Drupal\block\BlockBase;
    use Drupal\Core\Session\AccountInterface;

    /**
     * Provides a 'Demo' block.
     *
     * @Block(
     *   id = "demo_block",
     *   admin_label = @Translation("Demo block"),
     * )
     */

    class MyCustomblockName extends BlockBase {

      /**
       * {@inheritdoc}
       */
      public function build() {
        return array(
          '#markup' => $this->t('Hello World!'),
        );
      }

      /**
       * {@inheritdoc}
       */

  public function access(AccountInterface $account) {
    return $account->hasPermission('access content');
  }

}

It doesn't display the block at all. What could be the reason?


texts: How to know a user can access node/{nid} and node/{nid}/latest in fastest way

texts:
I have a view displaying list of latest node revisions.

The view has title field.

The website gives users permissions to access node/{nid}(shows latest revision if published default revision doesn't exist) and node/{nid}/latest (shows latest revision if defaut revision and latest revision is different) depending moderation state and user groups.

I want to override the view's title field according to the rules below:

if current user can access node/{nid}/latest the title links to the page
else if current user can access node/{nid} the title links to the page
else show only title text

Dozens or hundreds of people may simultaneously access the view so I want to keep it fast to display. What is the fastest way to check those?

edit:
I searched about hook_node_grants but it only supports view/update/delete operations so I think it can't hold data for node/{nid}/latest.
Should I store every pattern in table just like node_access table does and look up on it when view is updated?


texts: Migrate is putting map tables in legacy database

texts:
I'm getting some really strange behavior with my custom migration class where the map tables are all being put into the legacy (6) database rather than the destination (7) database.  This happens for all of my custom migration classes and not the ones using d2d.  I believe it has something to do with my $this->map in the migrations with the final argument being 'legacy' or possibly it's the $query = Database::getConnection('default', 'legacy') part of the migration.

My custom class for term migration does import the data into the new site from the old correctly, but the map tables are still going to the legacy database.

I've found a few sources of others having issues getting multiple databases to work in a migration but they seem to be conflicting with each other.

Here is my class:

class myUserProfileMigration extends myMigration {
  public function __construct($arguments) {
    parent::__construct($arguments);
    $this->arguments = $arguments;

    $this->description = t('My User Profiles Migration');

    $dependencies = array(
      'User'
    );

    $this->dependencies = $dependencies;

    $query = Database::getConnection('default', 'legacy')
          ->select('node', 'n');
    $query->condition('n.type', 'person_profile_page', '=');
    $query->join('users', 'u', 'u.uid = n.uid');
    $query->fields('u', array('name', 'uid'));
    $query->fields('n', array('uid', 'nid'));
    $query->join('content_type_person_profile_page', 'p', 'p.nid = n.nid');
    $query->fields('p', array(
      'field_about_me_value',
      'field_likes_value',
      'field_dislikes_value',
      'field_google_plus_value',
      'field_twitter_handle_value',
    ));

    $this->source = new MigrateSourceSQL($query);

    $this->destination = new MigrateDestinationUser();

    $this->addFieldMapping('uid', 'uid')
         ->sourceMigration('User');
    $this->addFieldMapping('field_likes', 'field_likes_value');
    $this->addFieldMapping('field_dislikes', 'field_dislikes_value');
    $this->addFieldMapping('field_about_me', 'field_about_me_value');
    $this->addFieldMapping('field_about_me:format')
         ->defaultValue('filtered_html');
    $this->addFieldMapping('field_google_id', 'field_google_plus_value');
    $this->addFieldMapping('field_twitter_handle', 'field_twitter_handle_value');

    $source_key = array(
      'uid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'description' => 'Original Author UID',
        'alias' => 'n',
      )
    );
    $this->map = new MigrateSQLMap($this->machineName, $source_key, MigrateDestinationUser::getKeySchema(), 'legacy');

  }

}

And here is my settings.local.php:

$databases = array (
  'default' =>
  array (
    'default' =>
    array (
      'database' => 'dest_db',
      'username' => 'root',
      'password' => '',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
  'legacy' =>
  array(
    'default' =>
    array(
      'database' => 'legacy_db',
      'username' => 'root',
      'password' => '',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
);


texts: How to display associated content through shared taxonomy?

texts:
I have two content types, 'Topic Summary' and 'Clip Page.' Both can share the same taxonomy. For example, they might share the taxonomy 'raccoons.'

When a user clicks on a 'topic summary' I would like to display links to the related 'clip pages' through their shared taxonomy in a block underneath the content of the 'topic summary.'

I've tried doing this using views and contextual filters but I'm having no luck. I wonder if anyone could tell me how do achieve this? Specifically, it would be good to know the Drupal way of doing so.


texts: How to remove duplicate terms in a vocabulary

texts:
I have a vocabulary with many terms that are duplicates. How can I remove those terms?

I have many duplicates; I need a way to delete them that is not deleting them one by one.


texts: Delete option 'None' of the select list of a cck field

texts: How can I delete the option -None- of the select list in a cck field.  The field is not required.


texts: Mobile_detect php redirecting to subdomain - Stuck in a redirect loop!

texts:
I am using the following code in a module for redirection to a subdomain whenever a mobile is detected;

<?php

  function mobydetect_init() {
  include("PATH/TO/Mobile_Detect.php");

  $detect = new Mobile_Detect();
  if ($detect->isMobile()) {
    header('Location: http://m.mysite.com');
    drupal_exit();
  }
}

However when I go to my site using a mobile I get this error message;

"This web page has a redirect loop."

I have disabled to subdomain from redirecting to the main domain in Aegir. So where's the loop coming from?


texts: Is it possible to define a FieldFormatter as a service

texts:
I need the 'language_manager' service inside a custom FieldFormatter. I'd prefer not to use \Drupal::service('language_manager').

Is there a special tag for FieldFormatters, or any other method to define it as a service?


texts:
Each user, lets say performer has profile page (which is node, not default user page) which is visible and can be made once..
Band (for example "Cool Band") can create image gallery, video gallery, bio, concerts etc...
On registration each user has to enter unique profile name (field_profile_name, in our case Cool Band)

After registering, user picks band node and path is created as his main profile page with pathauto (sub-pathauto is installed too):
example.com/performer/[node_author_field_profile_name] = performer/cool-band

After saving the node he gets new role which can not make new nodes of this type, and link can not be changed.

Views contextual are setup to show different content made by user, resulting in paths:
example.com/performer/%/photo-gallery = performer/cool-band/photo-gallery
example.com/performer/%/video-gallery = performer/cool-band/video-gallery
example.com/performer/%/concerts = performer/cool-band/concerts

What i can not figure out is how to create sidebar menu block which will lead to those pages, so when site visitor lands on any bands page he can see sidebar with links to other part of bands pages.  Sidebar menu should show link like this:

example.com/performer/cool-band/photo-gallery
example.com/performer/cool-band/video-gallery
example.com/performer/cool-band/concerts

I have tried to create view (users) with "overwrite this field as a link" and link is: performer/[field_profile_name]/photo-gallery etc., but i can not get the contextual right way.


texts: How do I change drupal_core_path to /public instead of /web?

texts:
I use Drupal VM and I have to change the folder from {{ drupal_composer_install_dir }}/web to {{ drupal_composer_install_dir }}/public.

When I do it and I run vagrant up, I get this error.

  An exception occurred during task execution. To see the full traceback, use -vvv.
  The error was: OSError: [Errno 2] No such file or directory: '/var/www/jb-inflatables/public'
  fatal: [jb-inflatables]: FAILED! => {"changed": false, "failed_when_result": true, "module_stderr": "Traceback (most recent call last):
  File \"/home/vagrant/.ansible/tmp/ansible-tmp-1560461183.6-73909259621121/AnsiballZ_command.py\", line 114, in <module>
  _ansiballz_main()
  File "/home/vagrant/.ansible/tmp/ansible-tmp-1560461183.6-73909259621121/AnsiballZ_command.py", line 106, in _ansiballz_main
  invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/vagrant/.ansible/tmp/ansible-tmp-1560461183.6-73909259621121/AnsiballZ_command.py\", line 49, in invoke_module
  imp.load_module('main', mod, module, MOD_DESC)
  File "/tmp/ansible_command_payload_KaNSZF/main.py", line 327, in
  <module>
  File "/tmp/ansible_command_payload_KaNSZF/main.py", line 263, in main
  OSError: [Errno 2] No such file or directory: '/var/www/jb-inflatables/public', "module_stdout": "", "msg": "MODULE FAILURE See stdout/stderr for the exact error", "rc": 1

How do I have to change the config.yml file so that Drupal is installed in /public instead of /web?


texts: Theming individual column of multicolumn field

texts:
I have a multicolumn field and I was able to theme all columns to be display as a table, that is working like a charm. When I want to use one of the columns values in a view I rewrite the output of the field and I select the raw value of the column and I can have it display that single value.

The single value I am displaying is a date field so the raw value is YYYY-MM-DD and I would like to format it to mm/dd/yyyy. I have try writing a custom formatter without any luck.

Is there any way I can apply a formatter to the individuals columns of the field?


texts: Sort nodes based on the amount of tags that match a specific node tags

texts:
Is there anyway to sort the nodes on a views display using the amount of matching tags of a specif node? I would like to have a views display that shows me all the nodes that most match with a given node.

For example: I have one node with three terms associated with it and I'll pass this node to a views as an argument. The views should display first the nodes that have this same three terms, after that it should display the nodes which match with two of the three terms, after that the nodes that match one of the three terms and after that the nodes that doesn't match any of the three terms.

I couldn't find something that could solve this problem for me. If there isn't any implemented solution I'd like to know if it's feasible to implement this on Drupal 7.


texts:
I'm searching a way to configure Drupal's HTTP Client Guzzle. I.e. the base_url and user agent.

The Guzzle docs provide info here: http://docs.guzzlephp.org/en/latest/quickstart.html#creating-a-client

But nothing that works with the Drupal implementation.

I can see in core/lib/Drupal/Core/Http/ClientFactory.php that there is a default config with which the Guzzle Client constructor is fed.

//Line 46-65:

public function fromOptions(array $config = []) {
    $default_config = [
      // Security consideration: we must not use the certificate authority
      // file shipped with Guzzle because it can easily get outdated if a
      // certificate authority is hacked. Instead, we rely on the certificate
      // authority file provided by the operating system which is more likely
      // going to be updated in a timely fashion. This overrides the default
      // path to the pem file bundled with Guzzle.
      'verify' => TRUE,
      'timeout' => 30,
      'headers' => [
        'User-Agent' => 'Drupal/' . \Drupal::VERSION . ' (+https://www.drupal.org/) ' . \GuzzleHttp\default_user_agent(),
      ],
      'handler' => $this->stack,
    ];

    $config = NestedArray::mergeDeep($default_config, Settings::get('http_client_config', []), $config);

    return new Client($config);
  }

Any way to reconfigure this?

\Drupal::httpClient() does not provide any parameters for configuration.


texts: menu item for current page is missing a href tag for anonymous user

texts:
drupal 8:
Theme used "bartik".

If user is logged in, the active menu item has an  - tag, if not the tag is missing.

Is this the expected drupal behavior? btw. the same happens on the language switcher block.

How can i output the a-href tag for anonymous users? This would make theming menus much easier. Thx for any help or pointing me into the right direction

markup for anonymous user

.....

    c

markup for admin user

......

    c


texts:
I am looking to manage user access to website content using Rules and the suggested access control module i.e. ACL, TAC etc.

There 3 levels of access to manage:

Unregistered - No access to any Course Content
Registered - Access to certain Preview nodes (see Preview Module below)
Paid - Access to the content to which they have paid (as well as Preview nodes)

Unregistered

Unregistered users will have no access to any Course Content nodes
However there may be pages on the site (Cookie, Terms etc.) which anonymous will need access to to keep the site functioning during registration/payment etc.

Registered Users / Preview Module

For each Course, 1 or more Modules (taxonomy term) will be marked as a Preview Module
Preview Modules are identified by the term with a boolean check box: field_module_preview
This should allow access to Registered uses to access the nodes within this Module.

Content types:
Course – setup as a product
Content

Taxonomy:
Topic
Module

Example:

> Course
> - Module
> - - Topic
> - - - Course Content NO Access
> - Module (Preview checked)
> - - Topic
> - - - Course Content: Access
> - - - Course Content: Access
> - - Topic
> - - - Course Content: Access
> - - - Course Content: Access
> - Module
> - - Topic
> - - - Course Content NO Access

Paid Access

Payment processing will be carried out using Drupal Commerce and PayPal. The setup of this is not required. Drupal install will be supplied with Commerce and product types setup.
Once a course is paid, then access is granted to the entire Course and all its nodes

I have tried to integrate rules but no hope to make it working.

Can anyone help me to apply this scenario in my drupal 7?

Thank you in advance.


texts: Bootstrap theme overrides "theme_list_item" function and removes div's "item-list" class

texts:
How can I stop Bootstrap theme from overriding the them_item_list and replacing the div's class from item-list to panel-body?

I have the following form and it does not render the items

$stages = array(
1 => array('data' => '1. Step 1'),
2 => array('data' => '2. Step 2'),
3 => array('data' => '3. Step 3'),
);

$stages[$current_step]['class'] = array('active');

$stages_list = theme('item_list', array('items' => $stages));

$form['header'] = array(
    '#type' => 'fieldset',
    '#title' => '',
    '#value' => $stages_list,
);

the Above renders a navigation steps menu just fine with Bartik and other themes however, when it comes to Bootstrap it  is empty rather having list of items.

I did some googling and found out this issue that might be somewhat relevant but, the solution does not seem to work for me. I tried to override the mytheme_item_list($variables) in template.php with following but, still no sign of the naviagtion.

function bootstrap_subtheme_item_list($variables) {
   $items = $variables['items'];
   $title = $variables['title'];
   $type = $variables['type'];
   $attributes = $variables['attributes'];

   $output = '
';
   $output .= "<$type" . drupal_attributes($attributes) . '>';

   $count = 1;
   $num_items = count($items);

   foreach ($items as $item) {
      $attributes = array();
      $children = array();
      $data = '';
      $count++;

      if (is_array($item)) {
        foreach ($item as $key => $value) {
          if ($key == 'data') {
            $data = $value;
          }
          elseif ($key == 'children') {
            $children = $value;
          }
          else {
            $attributes[$key] = $value;
          }
        }
      }
      else {
        $data = $item;
      }

      if (count($children) > 0) {
        // Render nested list.
        $data .= theme_item_list(array('items' => $children, 'title' => NULL, 'type' => $type, 'attributes' => $attributes));
      }

      if ($count == 1) {
        $attributes['class'][] = 'first';
      }
      if ($count == $num_items) {
        $attributes['class'][] = 'last';
      }
      $output .= '
' . $data . "
\n";
   }
   $output .= "</$type>
";

   dpm($output);

   return $output;
 }

The dpm above prints the exact thing piece of html that I want, the following but, the same is not rendered in the page.

1. Step 1

2. Step 2

3. Step 3

Not sure what I am doing wrong. Any solution that do not break other theme's would be very much appreciated.


texts: drupal_add_js settings and working around the anonymous page cache

texts:
What I'm trying to do is allow registered users to configure a few colors on public facing pages (profiles, etc.) and to do so I'm using the ColorField module and a few theme functions.

My problem is that the anonymous page cache is caching values stored in Drupal.settings, preventing changes from being visible until the page cache is cleared.

Here is the code I currently use to set Drupal.settings:

<?php
function themeName_preprocess_page(&$vars) {
  $branding = array(
      'header_bg' => '#ffffff',
      'accent' => '#0b40ac'
  );
  drupal_add_js(array('pageRebranding' => $branding), array('type' => 'setting'));
  drupal_add_js(drupal_get_path('theme', 'themeName') .'/js/branding.js');
}
?>

Disabling the anonymous page cache (globally or selectively) is not an option.

Is there a way I can pass values to Drupal.behaviors using ajax on page load, or another method to get around the anonymous page cache?

Here is my JS:

(function ($) {

    Drupal.behaviors.pageRebranding = {
        attach: function (context, settings) {
            var header_bg = Drupal.settings.pageRebranding.header_bg;
            var accent = Drupal.settings.pageRebranding.accent;
            /* Do Stuff */
        }
    };

})(jQuery);


texts: How to set a custom URL for a node without pathauto?

texts:
I have a content type that requires me to assemble a URL from several sources - the node title, a taxonomy value, and some fields of a product that are referenced from a product display that this content type references.  So:

mynode type
  - title
  - taxonomy value
  - entity ref -> product display -> product field

The entity ref can have one or more products, so there is some logic I need to crunch to assemble the right URL.  I didn't have luck doing this through pathauto, so it looks like I need to handle this on hook_node_presave(), which does set my alias, but I get a 404 on that alias, so it seems I'm missing a step.

My code is:

mymodule_node_presave($node) {
    if (empty($node->path['alias'])) {
        $node->path['alias'] = _some_fx_that_figures_out_url();
        $node->path['pid'] = 0;
        $node->path['language'] = LANGUAGE_NONE;
    }
}

I guess I'm missing something?


texts:
I have three domains that are pointing to the same website like this:

example.com
example.org
example.net
All of those work from the same db.
But If I login to the example.com website and then go to example.org I have to login again.

The second question:
If I'm logged in example.com and then go to www.example.com I have to login again!
Is it a server that misconfigured or what should I do?


texts: Pass multiple ids as Views Arguments in the Rule action Save PDF as file on server

texts:
I'm using views PDF to print out a list of nodes on a single PDF, one per page.
Now I have more than 1000 nodes/pages on a single generated pdf, so I'm trying to use VBO and Rules to create a view where I can filter/select the nodes I need and execute a Rule component that saves the resulting pdf on the server and sets a field "printed" to "yes" on those nodes.

The problem is that every time I fire my Rule the saved PDF has just the last selected node via VBO.
On the "Views Arguments" of the "Save PDF as file on server” action, instead of [node:nid] I've tried writing manually some node ids (eg. 1,2,3...)  and it works fine: the saved PDF has all the written nodes printed out.

Probably I have to write some PHP code to print the VBO-passed ids as a single csv argument.
I've tried something like this and doesn't work, blank pdf page. How to debug?

<?
$vboNids=arg(1);
echo implode(",",$vboNids);
?>

Thanx in advance.


texts:
I have implemented hook_menu in my module and created a page. Now how to add CSS to this page? I have the below code inside my page_callback function, but still the css is not applied.

$css = "table,tr,th,td {padding: 10 !important; }";
drupal_add_css($css, 'inline');

Any help is appreciated.


texts: How do auto-delete users that are blocked by access rules

texts: How do I actually get the system to delete a user that tries to sign up with a blocked E-mail? In Drupal 6, even when an E-mail is blocked via an access rule, the user can still register with that E-mail. The user exists in the system even though he's not allowed to login. This is cluttering up the user DB, is there a way to block the registration from taking place to being with or at least have the system delete such users automatically?


texts: How do I make a Views jump menu to anchor links?

texts:
I would like to make a jump menu in Views that is displayed as an attachment to the same Views page, which displays a list of documents.  I would like the jump menu to display the titles of all the documents, and have the destination for each link be an anchor tag on the same page, adjacent to the actual document.

I have applied output rewriting (in the Page display) to each document title, like this: [title]. In my jump menu display, attached to the top of the page display, I can rewrite the output of the title field to be mypage#[title], and that works, but the items in the jump menu are ugly.

What do I need to do in order to make the items in the jump menu display simply as [title], but jump to mypage#[title]?

Thanks!


texts: Change width and height of cropped image (EPSA crop)

texts:
I have the following problem: I have some image styles. I know how to change image style programmatically. But is there any way to change settings of the image style for single image, for example resize width and height?

I'm using EPSA Crop module. I'd like to do something like You crop image one time only, and then just change width and height of generated image (having crop area).

Here is the code I'm using:

$image_output = field_view_value('node', $node, 'field_image', $image[0], array(
'type' => 'image',
'settings' => array(
    'image_style' => 'preset_'.$preset.'_homepage',
    'image_link' => 'content',
  ),
));

Is it possible to change settings of image_style from this? For example change width and height of generated image?


texts: Jquery Validation & number field with comma

texts:
In my form i have this element :

   $form['poidsMin'] = array(
        '#type' => 'number',
        '#title' => $this->t('Poids minimum en gramme'),
        '#default_value' => $frais_port_entity->get('poidsMin'),
        '#description' => $this->t("Poids minimum du produit"),
        '#required' => TRUE,
    );

When i put 10 or 20, all is good but if i put 10.3 or 10,3 drupal 8 jquery validate tell me to insert a value like 10 or 11 with no comma.

My field in mysql is a float, how can i disable this validation for number type field ?


texts: Add as a particular role while creating an account in Drupal 7?

texts: In Drupal 7, I have a role named as "blogger". When user goes to blog site and created an account then a role should set by default as "blogger" rather than "authenticated user". How to do this? Any Suggestions please.


texts: Simple newsletter module is not able to send

texts:
My drupal website are using simple newsletter module.
I successfully recieve email from the module that I used my @hotmail.com to subscribe.

But I use other domain email such as @testdomain.com to subscribe, I cannot receive any email that send from the module.

Any solution or other free newsletter module to use?
Thank you.


texts:
I'm trying to alter the settings fields displayed when you click on the cog icon on the "Manage form display" admin screen.
More specifically I want to alter fields set by another module through hook_field_widget_third_party_settings_form
I finally found the solution so i'll share it here as an answer.
It was not that hard, but I had to dig a bit into the core code in order to figure out how to do it.


texts: 7- Field collection fields are not showing in registration profile

texts:
I'm trying to create a registration profile using Profile 2, in this profile most of all fields are field collections. The problem is, when I try to create account for this profile, none of them are showing up in the form.

I've tried by setting the permissions with field permission module, But still not working.

See the snapshot.

Please anyone tell me how can I make these fields to show up in the form.


texts:
In D7 I have two new node type defined e.g. branch and leaf. The branch is a collection of leaves that I'm referring to using the entity_reference module. In the picture below the leaves are the nodes representing the colors. The leaves could be re-used in several branches.
Here is a picture of my collection
I would like to add for each of the referenced leaves, two checkboxes to add some information about that leaf that is referenced in that branch. I have added on the picture manually the checkboxes. This is what I would like to achieve. Then, programmatically when I read the branch and all its leaves, I want to be able to retrieve the checkboxes value as well. Everything is working far, I just need to know how to add the leaves, so that at edit time when I edit a branch I can tick the checkboxes as needed.
How could I do that? If there is no module that exists, which hooks should I use for adding this fields to the referred leaf node in the branch?
I do not want to add new fields for the leaf node type, I need the new fields/chekboxes to be added to a branch for each leaf thus at the moment of referring to the leaf and for each leaf.


texts: Workflow, Multistep, and "Save" vs. "Done"

texts:
I have a Multistep node submission form with a couple of behaviors:

The user can save it, leave, come back, and edit it further. Paging between the steps as well as clicking "save" produces this behavior. (This is already implemented)
The user can also submit it by clicking "Done" on the last page. Currently all this does is save it the same way as the "Save" button, but it redirects to a display of the node that was just saved.
The desired behavior for the "Done" page is to "freeze" the node and prevent further editing by the user.

I'd like to use Workflow states or at the very least a permissions-altering Rule to remove the ability to edit the node upon clicking the "Done" button, but not upon clicking the "Save," "Next," or "Previous" buttons. Currently they all do the same thing (save the node) so as far as Triggers, Rules, etc. can tell, it's the same event.

How can I differentiate which button was pressed and use that to trigger a rule or workflow state?


texts: How to modify/add addition variable to service json after successfully register.json?

texts:
I am able to get the response after register using service register.json

Response:

    {
        "uid": "10",
        "uri": "http://example.com/apps_api/user/10"
    }

Input:

  { "name":"smart", "pass":"smart", "mail":"tushar@smalution.com",
  "status":"1", "roles":[ "3" ] }

I get all the information "uri": "http://example.com/apps_api/user/10" .
I just want to get the "name", "mail", "role" in response.

Do not need to go again "uri": "http://example.com/apps_api/user/10".


texts: Filter View based on current user profile info (from Content Profile Module)

texts:
I have the Content Profile module installed. With this module, each user has 1 to many locations that are attached to them.

These locations are created via a content type called locs.

I have another content type called todays_spot that also has a selectable location (only one) also being dynamically created via locs.

So I'm pulling some of the todays_spot data out via a view, but I need to filter it so it only displays data if the user location(s) match.

Any suggestions, I've looked all over and can't find a thing.


texts: I have a multisite setup containing around 100 subdomains. I just want to redirect the user to parent website if a user enters an invalid subdomain. One way I thought was to access the $sites variable from sites.php but I didn't find a way to access that variable. Any help ?


texts: Get proper block title from block object

texts:
I have a block object in drupal 8 that I am trying to get the title of. I tried $block->label() and it seems to work for some block types, but not for Views blocks. On those, it returns the block's admin label, not the configured title.

If it matters, I am trying to find this information from hook_preprocess_region().


texts:
I've searched for an answer, but can't figure this out.

I've got PHP 5.4 installed on a server.  I've installed the latest 7.x branch of Drupal (7.39) and installed DRUSH via pear.

Now, whenever I type drush status, I get this:

[JAM 04:30:00 drush] > drush status
The following restricted PHP modes have non-empty values:                [error]
disable_functions. This configuration is incompatible with drush.
Please check your configuration settings in /etc/php.ini or in your
drush.ini file; see examples/example.drush.ini for details.
 PHP executable        :  /usr/bin/php
 PHP configuration     :  /etc/php.ini /etc/drush.ini /usr/share/pear/drush/drush.ini /root/.drush/drush.ini
 PHP OS                :  Linux
 Drush version         :  6.2.0
 Drush configuration   :
 Drush alias files     :

You can see that I've put a drush.ini in /etc/ and I point to it using the DRUSH_INI environment var. I've also put it in my ~/.drush/drush.ini and also in the drush install folder.

The issue I'm having is that it is always reading the regular php.ini first, and giving the error message about disable_functions.  I want the WEB to continue using the /etc/php.ini, but I'm trying to override the drush ini file, and it works (see the status) and recognizes the new files, but always picks up the /etc/php.ini first.

How do I get it to IGNORE the /etc/php.ini and only use the drush.ini?


texts:
I am trying to unsetting the deafult CSS through a foreach loop, but seems its not working in hook_preprocess_html(&$variables)

here is my code, please have a look.

$arrCSS = drupal_add_css();
          foreach ($arrCSS as $key => $value) {
            unset($arrCSS[$key]['data']);
          }
          $all_css = drupal_add_css();
          print_r($all_css);


texts: Change edit link URL in the content administration page

texts:
I been trying to recreate something in the admin section of Drupal from a previous.

In the content, when you roll over the "edit" link. It shows the link like this: https://www.example.com/dolor-melior/edit?destination=admin/content

But I needs it to be: https://www.example.com/node/1/edit?destination=admin/content

I have Pathauto, Redirect and Global Redirect modules installed.


texts: Running functional / browser tests in Docker + Traefik + TLS

texts:
Disclaimer: I am new to Drupal/PHP testing.

I am getting connectivity issues when running functional tests on my local Drupal 8 environment.

My environment consists of a couple of services that I'm running through Docker Compose and a Traefik proxy container.

The Alpine Linux (v3.7) Apache/PHP 7.1 container (I'm only showing stuff I think is relevant):

  networks:
    traefik_webgateway:
      external: true
    internal:
      external: false

  services:
    d8test:
      [...]
        environment:
          [...]
            DOCUMENT_ROOT: /var/www/localhost/web
            PHP_IDE_CONFIG: "serverName=d8test.docker.localhost"
        networks:
          - internal
          - traefik_webgateway
        labels:
          - traefik.backend=d8test
          - traefik.frontend.rule=d8test.docker.localhost
          - traefik.docker.network=traefik_webgateway
          - traefik.port=80
  [...]

The Traefik container:

services:
  proxy:
    image: traefik:latest
    command: --entryPoints='Name:http Address::80' --entryPoints='Name:https Address::443 TLS:/ssl/localhost.crt,/ssl/localhost.key' --defaultEntryPoints=http,https --docker --docker.domain=docker.localhost --docker.watch --logLevel=Debug --api
    networks:
      - webgateway
    ports:
      - "80:80"
      - "8080:8080"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./ssl:/ssl
      - ./traefik.toml:/traefik.toml

networks:
  webgateway:
    driver: bridge

In my traefik.toml file I have the following options set:

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "docker.localhost"
watch = true
dashboard = true
exposedbydefault = false
swarmmode = false
[docker.tls]

In my phpunit.xml I've set up the following:

<env name="SIMPLETEST_BASE_URL" value="http://d8test:80"/>
<env name="SIMPLETEST_DB" value="mysql://admin:admin@db:3306/d8test"/>
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value="/var/www/localhost/web/sites/default/files/simpletest"/>

Unit and kernel tests seem to be running fine, but when I try to create a simple functional test (extending BrowserTestBase) and then run the test from within the d8test (apache/php) container, I get the following error:

  Drupal\Tests\jj_login\Functional\LoginTest::testStuff
  GuzzleHttp\Exception\ConnectException: cURL error 35:
  error:1400410B:SSL routines:CONNECT_CR_SRVR_HELLO:wrong version number
  (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

I tried changing the url value of SIMPLETEST_BASE_URL, tried different ports, http and https, but then I usually get the error below:

  curl: (7) Failed to connect to [url] port [port]: Connection refused.

I am suspecting that my issue has something to do with Traefik requiring a valid certificate (I generated a self-signed one which I'm using to access the site in Chrome/FF), but I'm really not sure if I'm going in the right direction here, maybe I'm missing something more fundamental. Any help would be appreciated.


texts: Not able to login in Drupal 7 CMS as admin

texts: I am not able to login in my Drupal admin panel, i have tried to truncate sessions, watchdog and cache table from database, also tried to reset password from database directly, but there is no luck for me. Can you please suggest how can i login and what steps i need to follow ?


texts: Form Block module usage in multiple sections

texts: While working a project i came across an issue with "Form Block" module. I used this block on a basic page in content section. Now my client also wants this same block in the right sidebar on the home page. Is there a way out to get the desired result.


texts: Drupal 6 site not sending password reset emails

texts: The password reset emails for a Drupal 6 site I'm working on aren't getting to our users' inboxes. The emails aren't being blocked by spam filters, and according to the site logs at admin/reports/dblog the emails are being sent. How can I go about debugging this?


texts: Statistics module not effect with Services module

texts:
I created a Services Views, I added a Statistics field(total view) to the Views.

Then I try to use the browser to visit the node through RESTful api, like this url: http://daxuebao.local:8083/api/node/61

But, when I try to visit the Service Views, the Statistics field not effect, It still zero.

How to make Services support Statistics?


texts: Drupal 7:: create a page with views to show all the contents not authored by current user

texts:
I am creating two page with views module. First page will show all the contents authored by current user. Second page will show all the contents that current user can view but not created by him.

I am trying it with contextual filter but no luck yet.


texts: How do I render the search form for a particular Apache SOLR search page on its own?

texts:
I have the SOLR search module installed, and have set up a couple of different search pages.

I need to render the form for one of these pages on a separate page. I thought I could just piggy back off the default search_form(), but it doesn't work.

Using this code:

$build['search_form'] = drupal_get_form('search_form', 'directory/search', '', 'apachesolr_search');

The search form is displayed, and has the correct action property. But when the form is submitted, it just redirects to directory/search, without the keys in the URL (which are obviously required for the search).

What am I missing?


texts: How do I automatically approve a user account in Drupal 7 based on a rule

texts:
I would have thought that I could find the answer to this by just googling but here I am...

In Drupal 6 it appears that you could setup user access rules in core to do this.  So for example approve accounts that match the rule: %@email.com, which would approve any email.com address.
http://drupal.org/getting-started/6/admin/user/rules

Does anyone know how to do this in Drupal 7.  I would also like to be able to automatically assign a role to the account.

Thanks for your help!


texts: Views: pass link to referenced node to image field

texts:
I have a content type "slideshow" with three fields:
1. title
2. image
3. entity reference to nodes of a specific content type.

Then I created a view which I want to display as a slideshow on the frontpage. Its filter is set to the content type "slideshow" and I have three fields there:
1. the entity reference to the nodes (hidden)
2. image
3. title

What I want to achieve is, pass the referenced node from the entity field as a link to the image field so that the image in the slideshow has a link to the node from the entity reference field.

I tried the following:

In 2. image field settings: I checked: Output this field as a link and in the link path I put: [field__slideshow_link_gallery] which I got from the replacement patterns below.

The problem is that the image actually has a link but the link is the name of the referenced node rather than the link to the referenced node. I would need the link not the name.

In the 1. entity reference field in the view I have only three formatters (label, entity id and rendered entity). I used label as a formatter and checked "Link label to the referenced entity. Unfortunately only the name is passed to the image not the link. Any ideas would be greatly appreciated.


texts: Is there any alternate module of drupal core search form?

texts: Is there any module which can be used as an alternative to drupal core search form block.


texts: Move fields on User edit page between pages

texts:
I am using Simple News, which changes the user/1/edit page by adding a new "Newsletter' Page" that is at user/1/edit/simplenews ("1" can be any userId). This page has a Newsletter option field.

I would like to move this option field so it is on the main user/1/edit page.

How can I do this?

I have created my own customer user-edit template (tpl.php), following the instructions here.
The template effects both user/1/edit and user/1/edit/simplenews.

I can print out the Newsletter option field with <?php print drupal_render($form['subscriptions']);?>. But the field only prints out when the user goes to   user/1/edit/simplenews. On user/1/edit it disappears.


texts:
i have the follow installation:

Drupal 7.12
Views 3
Panels 3

I have an content type with the follow fields:

User name (textfield)
Job Function (textfield)
User reference (Reference Field)

I filled the content type with: Username: Test Job function: CEO, user reference: demo

I have 3 users at mom, admin, demo and normal

What I'm trying to do is when I change the User reference field on this content type to other user like, admin or normal:

It will update on the views page or panels page the nodes that this user has created

I have setup a View and put on the Contextual Filters: Author ID and pressed Apply (all display)

Then I created a panel page and Add a Content, selected Views and selected this view I created, then I have an option there called Author ID, and a select list that has this field called User Reference, I selected it and update and saved the panel

But when I visit the panel page, it does not show anything

The question is how can I do this that I'm trying to do?


texts: views load all posts but show limited number per page?

texts:
I want to use the load more module on a view. The problem I'm having is that I'm using a mp3 player that generates a player based on the number of posts on a page. Example: my page has 10 nodes so 10 players are generated.
When I click on load more posts using the Views load more module, 10 more nodes are generated. So now my page has 20 nodes but only 10 players.

This problem doesn't occur if I use the default pager and click on the next page.

Is there a way to load all nodes but only show x number of nodes per page in a view?


texts: How can I recreate a previously deleted Content Type?

texts:
I have deleted a Content Type called news some months ago using Drupal’s Field UI. Now I would like to recreate a new Content Type with the exact same machine name news. However no Content Type shows up. When I take a look at the database a new entry has been created in the node_type table.

Somehow Drupal doesn’t remove the Content Type in the database. What’s the recommended way to cleanup orphaned Content Types? Why does Drupal keep these leftovers? I don’t want to mess around in database.


texts: How to alter node load system to make it possible for only one field is attached to a node?

texts:
I have created a special content type using the build-in field system, which allows users to create multiple instances of the body field. In some circumstances the body field could be as large as 20M.

I would like to implement a hook that when a user visits a certain URL like node/1/body/0, then when node_load is called, only the body field with delta == 0 is loaded into $node object, so it won't affect much for the performance.

Is it possible? Thanks in advance!


texts: ERR_TOO_MANY_REDIRECTS on images after switch to HTTPS

texts:
I have the Drupal 8 site was working with HTTP on the port 80. I switched it to HTTPS with port 443. I got the problem for ERR_TOO_MANY_REDIRECTS when accessing some images from physicals path.

For example path: https://www.example.com/theme/sites/basic/img/fileimage.png

It happened on some files which are display on the pages. I tried access other files on the same level folder "img" is working. (i.e img/logo.png)

I guess it's cache problem. Here what I did:
 - Clear cache
 - Drush cr
 - Deleted some special table within cache_ inside.
 - I stop mysqld, it's still happened.

Here is my .htaccess:

# ensure www.
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# ensure https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

From my admin/config/Basic Site Setting. I still saw

Default front page: http://www.example.com

It should be https? How I can resolve it? Thanks