texts: Load view with ajax and contextual/exposed filters

texts:
I am trying to access content, that is provided via and can be filtered via a view. I want to load this content dynamically with Ajax. My problem now is, that I can access the view without problems using the following ajax-call:

$.ajax({
    url: Drupal.settings.basePath + 'views/ajax',
    type: 'post',
    data: {
        view_name: 'search',
        view_display_id: 'block_1',
        filterName: value
    },
        success: function(data,jqxhr) {
            $("#ajax-test").html(data)
            console.log(data[1])
        },
        error: function(error) {
            console.log(error)
        }
    });

This works fine, but it ignores the value of filterName (Which corresponds to the according input in the view form). Unfortunately using Better Exposed Filters and Links is not an option since I need to access many filters at once.

Also building an URL like so:

$.get(Drupal.settings.basePath + 'views/ajax/search/block_1/', "filterName[0]=filterValue" ,resultFunction);

did not work for me. Thanks ahead for any pointers!


texts: Force render the block programmatically?

texts: Is it possible? For example, if the module's block meets your needs but it a block (not a page) and you want to use ready solution. Writing in a tpl.php file something like render(desired_block), i.e. to get an output markup of the block for reuse.


texts: Updated >= Drupal 8.0.5+: Rendering forms/entities programmatically on theming level

texts:
There are several attempts and questions already asked about near to that topic in combination with the new Drupal core (8), but non of them came down to the bottom of the basic question. And non of them are up-to-date enough (2015) since many late changes in core arrived afterwards (2016). Answering the basic question will hopefully lead to answers for many depending questions and open HOWTO topics and could be a good basis for updated docs on drupal.org.

The basic question is:

How to programmatically render path/page based forms or any other entity bundles on the theming level to display them path independently, e.g. in blocks or other pages other than the given pages/paths of itself? And how can I find the right routing for the correct system calls or class paths for the needed preprocess functions in the new D8 core logic if I am new to D8?

The question arises from 2 points of view:

Why should a form be hard binded to a page view or fixed path? It's a page element, not a page. It should be available easely in any
other places without complicated coding struggles in a website
building CMF like Drupal on the theming level. It's part of theme
design to decide to have a form on frontpage, for example. (ok, this is arguable, I know, but in some cases it is)
From the basic structure how Drupal is build and what it tries to achieve in these times (the goal to rather build web applications
instead of classic and static websites), it should be easily
reachable to maintain such task like a form on the bottom of a
one-page site or to build a survey or render entities on unexpected
pages.

To keep with the form example:

here are some links to questions regarding this topic and I've tried already to interfere there and suggest to inform about changes in core here and there to update the posts or to link to sources:

How to programmatically render a contact form in a theme in D8
Rendering contact_form
Embed a contact form

The basic structure

.. how it works is common, mostly clear, and not so far from how it worked in D7:

You will use a preprocess_xxx() function in your D8 twig YOURTHEMENAME.theme file to call and pipe the form or entity array into the region variable array, to be able to render it via {{ var }} twig-tags in your xxx.twig file: e.g. block.html.twig or page.html.twig, since the form or entity is maybe not known in this layer (enviroment variable) by default.

Just an example (needs update and correction) of your THEMENAME.theme file:

preprocess_page(){
  $form = Drupal::routeMatch()->getParameter('contact_form'); // ???
  $message = \Drupal::entityTypeManager() // ???
  ->getStorage('contact_message')
  ->create(array(
      'contact_form' => $form->id(),
  ));
  /// ???
  $form = Drupal::service('entity.form_builder')->getForm($message);
  $variables['contact_form'] = $form;
}

Just an example page.html.twig file:

<header>
  {{ header_region }}
</header>
<div id="main"> ... </div>
<footer>
  {{ contact_form }} <!-- from $variables['contact_form'] = $form; -->
</footer>

But now comes the tricky part:

The docs are not up-to-date enough to make clear how to build the preprocess_xxx() function correctly, demonstrated with \\ ??? here. Using the demo example here as-is (atm) will cause an almost empty frontpage, only rendering html.html.twig but without the nested page.html.twig, obviously caused by a wrong coding in the preprocess function.

Somebody who tries to find updated docs or QA for that will have a hard time ...


texts: Should I use Libraries API if I only wish to use a 3rd-party library for my own custom module? version detection, duplicate declaration

texts:
I wish to use phpFlickr 3rd-party php library in developing my own custom module.

I considered Libraries API to centrally manage phpFlickr in sites/all/libraries but have some questions:

What happens if there are other contrib modules that also use phpFlickr and manage it through Libraries API? If my module registers phpFlickr with Libraries API then would there not be a duplicate entry with Libraries API? Does it know if more than one module wants to use it?
In general, how can I check for a minimum version of a library? with hook_libraries_info() a regular expression can be used to find the version, but there doesn't seem to be an explanation as to how to check for a minimum version.

I've already looked at the documentation for Libraries API and found it to be insufficient regarding examples ( https://www.drupal.org/node/1342238 ). I also looked at a page stating contrib modules that apparently used Libraries API ( https://www.drupal.org/node/1570568 ) but when I examined the code, it didn't seem to be the case, i.e. in the twitter module, I looked for "_libraries_info" but could not find it.


texts: Displaying all sub-menu items even when not "expanded"

texts:
I'd like a menu structure that is something like the following to be placed into a page's sidebar.

Insects
Animals
----Mammals
--------Bears
--------Whales
----Reptiles
--------Snakes

I'd like it to be set up so that if a user is on the bears page, the animals and mammals menus will be expanded...but the user COULD click an arrow next to reptiles to have that menu expand, and see the snakes option. When I checked the $page['sidebar'] render array, however, child menu items that are not expanded are not even included in the array. So, if I am on bears, there is nothing below $page['sidebar'][whatever number reptiles is]

I thought about writing a module that builds this through the DB, but at that point I'd be pretty much re-writing and implementing the menu modulem since I'd need to also include the html output of this new data on the page. What's the best way to approach this?


texts: webform submission details not getting displayed

texts:
i have multiple nodes each per language and the default is English(node/1).
For french node(node/2) after submitting the details of the contact form, the details not getting displayed in Webform-Confirmation.tpl.php page, however when i do the same in default English node, it is getting displayed. any configuration should i do for this please help


texts:
I am using Drupal Commerce in Drupal 8.

Where can I find the default email and rules related to order activities, like on completion, processing etc.


texts: How to add a node to the same group as a referenced node, using Business Rules

texts:
Using the groups module, my goal is to use Business Rules in order to automatically add a node to the same group as another node that is referenced using an entity reference field). The setup is as follows:
Node type project (is group content, has group field)
Node type page (is group content, has group field)
Group (has project and page nodes plugins enabled)
A page has an entity reference field that can reference a project.
When saving a page (either new or existing) I want the page to be added to the same group as the project.
For now assume that each project is part of only one group.
Using Business Rules:
Variables:

project variable
group variable

Actions:

Fetch project by ID [node:field_project:entity:nid]    THIS WORKS
Fetch group ID {{project_variable->entitygroupfield:0}}   THIS DOES NOT WORK
Add node entity to a group DIDNT GET TO THIS BECAUSE OF ACTION 2 NOT WORKING

Results:
The project ID is correctly fetched, but the group ID is not found.
It probably is because the context is not present of the group of which the project is part of, but I don't know how to add that.
modules:

https://www.drupal.org/project/group
https://www.drupal.org/project/business_rules


texts: XML format for creating a new submission in a webform

texts:
Can someone please tell me how to create a webform submission on XML form? Or if not can you please correct this code and tell me where I'm going wrong??

I've been struggling for a week
This is my code :

                var i:uint=new uint();
                for(i=0;i<count;i++)
                {
                    trace("These are the inputs"+myInputs[i].text);
                }
                trace("this is the user's token "+token);
                var headers:Array = [
                    new URLRequestHeader("Content-Type","application/x-www-form-urlencoded"),
                    new URLRequestHeader("X-CSRF-Token",_userXML.token)
                ];

                var request:URLRequest = new URLRequest;
                request.url=Constants.DOMAIN+"/api/submission";
                request.requestHeaders = headers;

                trace("this is the uuid we get from FormsListScreen"+FormsListScreen.item.uuid);
                var requestVars:URLVariables = new URLVariables();
                requestVars['webform'] = FormsListScreen.item.uuid;
                for (i=0;i<count;i++)
                {
                    requestVars['submission[data]['+i+'][values][0]']= myInputs[i].text;
                }
                trace("This is the request variable webform"+requestVars['webform']);
                request.data=requestVars;
                request.method = URLRequestMethod.POST;
                requestor = new URLLoader();
                requestor.load(request);
                requestor.addEventListener(flash.events.Event.COMPLETE, SubmissionDone);
                requestor.addEventListener(flash.events.IOErrorEvent.IO_ERROR, httpRequestError);
                requestor.addEventListener(flash.events.SecurityErrorEvent.SECURITY_ERROR, httpRequestError);
                requestor.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);

I tried with x-www-form-urlencoded in POSTMAN and it works fine with

submission[data][1][values][0]
for each submission

But I'm somehow not able to do it in as3 using x-www-form-urlencoded
,infact i'm getting a stream error 2023 for the URL now

PLEASE HELP!


texts:
Is the Search module supposed to search through the node/page titles, or just the node content?

Because, for me it is only searching through the content, and not the page titles.

Note: I am using Drupal 7.


texts: Group views exposed taxonomy filter terms based on parent

texts:
Here is the scenario :

We've got a taxonomy vocabulary called regions, this holds continents as parents and countries as children, this vocabulary then is used as a taxonomy term field in a content type called "Note", there user can select unlimited countries for the content. The user is forced to select from children so he/she cant choose a continent for that field.

Now I'm working on a view of "Notes", the country filter is exposed and user can select multiple countries, What I want now is to separate countries based on the continent they belong and show them in different part of form.

I know I can add a filter for each continent and select countries related to that continent using views but I'm looking for a programmatically based situation as the number of countries are so many and there might be human fault selecting proper countries for each continent.


texts:
I have made a product page overview that displays all the products of my webshop. On the left, I have placed a filter where people can filter the products (e.g. country can be France, Germany...). When a customer selects a country (e.g. France) the URL changes and the id of the choice (France) is added to the URL. Now I want the next thing: when a customer selects a product, I want that the id that was added in the previous URL also is added to the URL of the product detail page.

So when you have www.test.com/products, you select France, you get www.test.com/products?field=country%1 and when you select a product, you should get www.test.com/products/product?field=country%1 instead of just www.test.com/products/product...

Anyone who can help?


texts: Can't place context-controlled block below user picture on user profile page

texts:
I have a views block of user content that I want to display on the user profile page below a custom generated block of user information created in code via a theme function (using the $build['user_picture'] element in hook_entity_view_alter().  If I place the block into the appropriate region using the blocks admin page and configure the block to only appear at user/*, it works fine. However, if I place the block using Context module with the User Profile condition, it places the block above all other content, and there seems to be nothing I can do to drop the block below the user_picture element.  The weight for the user picture element is set to -10 by default, but even if I make it lower, nothing changes is.

Is there a way to control the placement of the block via Context so it is below the user_picture element? I can see no way via the UI - either for Context or user profile configuration - or code. Do I have to override user-profile.tpl.php and manually split everything out? I need to use Context to be able to control which user profiles the block is on, so if I can't re-order, then I have to find another mechanism (probably Panels) to control this placement.

Thanks.


texts:
I'm trying to migrate a drupal website from a server into my localhost but I trigger the error

  The provided host name is not valid for this server.

I've seen I need to add the trusted host pattern, but looks like this is not working I still get the error

My server is run on port 9000

sudo php -S 127.0.0.1:9000

My trusted hosts, and I've no Vhost

$settings['trusted_host_patterns'] = array(
  '^serverStuffWeDontMind$',
  '^localhost\:9000$',
);


texts: Commerce Marketplace Missing Roles and Buttons

texts:
My Install

Drupal   7.77
Drupal Commerce 7.x-1.15
Commerce Marketplace 7.x-1.0-beta4 (all dependent modules are enabled)

I have reviewed:

Documentation mentions a Marketplace Owner Role
https://git.drupalcode.org/project/commerce_marketplace/blob/HEAD/README.md
, and
Commerce Marketplace Features
https://www.drupal.org/project/commerce_marketplace

I do not see:

Marketplace Owner (admin/people/permissions)
3 global store roles (admin/people/permissions)
An Add Store button (user/ID/stores)

Am I looking in the wrong place, or have I forgotten to activate something?


texts:
I have a content type book and it has two taxonomy term reference fields (free tagging, autocomplete):

author
publisher

Both two taxonomy reference fields have taxonomy terms from the same vocabulary: people.
While creating new book content, if I enter the same taxonomy term for both author and publisher, it double creates the same taxonomy term (if  entered taxonomy term didn't exist before).
I don't want to use different vocabularies for these taxonomy reference fields.
How to prevent taxonomy terms being duplicated on node form?


texts: What can I remove after install of Drupal 7

texts:
What files and folders can I remove after I have installed Drupal 7
My installation uses SQLite
In order to make the total package as small as possible I have removed unused themes from the root themes directory but what else can I remove?
Can I remove modules from te root modules directory that I will not be using e.g. Aggregator, Forums etc?


texts:
All Simpletest documentation and examples use the t() function for clickLink() or assertText() for example. However when I read the core issue about testing not working when locale of host session is not English and the patch that got committed (tl;dr it forces English to be the default language) I'm curious if it's really necessary.

MegaChriz has an interesting take on this, as he doesn't t() his string in Feeds tests. Extract from his comment as to why:

  In most cases, the "final" text is checked, thus the text for which the translation placeholders have already been replaced. So there is no original translation string to check for. If I remember well, there were also occasions where only a portion of the text was checked. Since tests are always run in English (at least, by my knowledge), this should have no harm.

If the default language is English, can't we simply remove the t() function from testing? Please note that I'm not looking for opinions but for facts.


texts:
I'd like to exclude a js file from loading on to a specific node.

Right now my libraries.yml file looks like this:

global-styling:
  version: 1.x
  css:
    theme:
      css/bootstrap/bootstrap.css: {}
      css/style2.css: {}
      css/header.css: {}
      css/color-1.css: {}
      css/themify-icons.css: {}
      css/jquery-ui.css: {}
  js:
    js/bootstrap.js: {}
    js/jquery-ui.js: {}
    js/popper.js: {}
    js/tooltip.js: {}
    js/wow.min.js: {}
    plugin/appear/jquery.appear.js: {}
    js/custom.js: {}
  dependencies:
    - core/jquery

I'd like to exclude the js/custom.js from loading on node/4. Alternatively I would like to load that file ONLY for the front page.


texts:
I would like to make a search form for my site so that users can use a series of drop down menus and click to search and it will create a view with listings that fit the criteria of the search.

Its for a property/real-estate website so I want the user to be able to select how many bedrooms, price range, and location. Then, they will get a list or properties that are in the location  selected with the number of bedrooms specified etc.  I  spent a while searching and all I could find is how to customize a single Drupal search field in the header.


texts: Node custom property exposed as extra field

texts:
I'm trying to add custom property to node bundle, my code so far:

/**
 * Implements hook_entity_property_info_alter().
 */
function mymodule_entity_property_info_alter(&$info) {
  $properties = &$info['node']['bundles']['program']['properties'];

  $properties['last_episode_date'] = array(
    'label' => t("Last episode date"),
    'type' => 'date',
    'computed' => TRUE,
    'entity views field' => TRUE,
    'metadata controller class' => 'EntityDefaultMetadataController',
    'extra fields controller class' => 'EntityDefaultExtraFieldsController',
    'getter callback' => 'mymodule_last_episode_date_getter',
    'description' => t("Date of the last episode."),
  );
  return $info;
}

/**
 * last_episode_date property getter.
 */
function mymodule_last_episode_date_getter($data, array $options, $name, $type, $info) {
  return REQUEST_TIME;
}

The goal is to have this property available in views and in node as extra field - in views it is available, but I cannot make it to work as extra field. Anything is missing/is wrong? Documentation on this is kind of lacking :( .


texts: D7: function calls too early (before DOCTYPE) and mess my page

texts:
I have included a class file in my module:

function MYMODULE_init() {
  require_once(drupal_get_path('module','MYMODULE')."/jcart/jcart.php");
}

where I declare a function

public function display_container(){

  echo "
";
  echo "
";
  echo "

\n";

}

I called this function in another module (they are all the same level default/modules)

The problem is this func displays its content before the html doctype causing the layout to mess:

<!DOCTYPE html>


texts: Site off-line with correct data in settings.php

texts:
I'm trying to set up a development folder for a Drupal6 already existing website.

Under htdocs/sites/<website>/settings.php I have the following line in order to connect to the drupal6 DB:

$db_url = 'mysql://root:<mysql_password>@localhost/<drupal_db_name>';

If I try to enter mysql using the same login data, I can do it without any problems, so I know this data is correct.

But I still keep getting the "Site off-line" message.

I've also tried using settings.php in the "default" folder under htdocs/sites/, but it didn't solve the problem.

Any suggestions of what could I try in order to fix or debug this?

UPDATE: I have not taken the site down through admin. I've taken the folder from a production server (where it's working correctly), and I've placed it into another server. I've also made the same thing with the DB.


texts: How can I create a GET form with the Form API?

texts:
I have been struggling with the Drupal 8 Form API all afternoon. It seems that the API is not meant to create GET forms, while the comments state otherwise. I am trying to build sort of a filter-form that should pass it's parameters to the URL so that it can be bookmarked, etc.

My first problem is that the FormBuilder->getForm($myForm) method creates a FormState object that defaults to method POST. Even when I set my form's method to 'GET', the FormState object will check the request method before the form is even being created and since the requestmethod is GET and the FormState's method is POST it will not process anything at all.

So instead I tried to create my own FormState object (which I obviously set to GET) and call buildForm instead (that way bypassing the getForm logic):

$form = new MyForm();
$form_state = new FormState();
$form_state->setMethod('get');
$form = \Drupal::formBuilder()->buildForm($form, $form_state);

This seems to work better. However, as soon as I give my form a submit-button it then gets in some sort of redirect loop, which I haven't been able to pinpoint yet.
I don't have such problems when using POST.

It's really weird that the API doesn't seem to be able to handle GET forms.

Also:
Would I get this to work, the comments in the Form API code state that GET forms do not use a form-ID, however the FormInterface does require a getFormId method.

Could someone please clarify what I am doing wrong, or point out some documentation about this?

A proper example

I decided to simplify my testscenario a lot, in order to make sure that I wasn't doing anything weird. So now my testscenario is as follows:

I created a simple module with a hook_preprocess_node. There I render my form and add it to the template:

<?php

use Drupal\my_module\Form\TestForm;

function my_module_preprocess_node(&$variables) {
    $form = new TestForm();
    $variables['test_form'] = \Drupal::formBuilder()->getForm($form);
}

My form is as simple as I could make it:

<?php

namespace Drupal\my_module\Form;

use Drupal\Component\Utility\Html;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;

class TestForm extends FormBase {

  /**
   * @inheritDoc
   */
  public function getFormId()
  {
    return 'test_form';
  }

  /**
   * @inheritDoc
   */
  public function buildForm(array $form, FormStateInterface $form_state)
  {
    $form_state->setMethod('GET');

    $form['test_input'] = [
      '#type' => 'textfield',
    ];

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

    $form['actions']['submit'] = [
      '#name' => 'test-submit',
      '#id' => Html::getUniqueId('edit-submit-test-form'),
      '#type' => 'submit',
      '#value' => 'Submit it',
    ];

    return $form;
  }

  /**
   * @inheritDoc
   */
  public function validateForm(array &$form, FormStateInterface $form_state)
  {
    // TODO: Implement validateForm() method.
  }

  /**
   * @inheritDoc
   */
  public function submitForm(array &$form, FormStateInterface $form_state)
  {
    // TODO: Implement submitForm() method.
  }

}

Now my node template renders a simple form containing an input field and a submit button.
When I submit the form it submits using a GET-request and I see the fields appear as GET-parameters.
However the Drupal formbuilder does not pick up the form as being submitted. It does not call the validate nor submit methods.

The form contains both $form_state->setMethod('GET'); and $form['#method'] = 'GET'; as suggested in the comments.


texts: How can I implement a feature to change settings?

texts:
in our site we have a country field in a registration page of our drupal site. admin can download the all registered users as excel report. I added a new country field in my users.XLS report in data export option at Structure > Views > Administrator:users in my development site.

How can I deploy these changes in my staging site(other development site) by using the Features module?
Which feature components can I choose while creating the feature?


texts:
I want to be able to put my Navigation block within the html.tpl.php, as it isn't going to change across any of the pages and it just seems like a more efficient option.

I know that I can't render a block using regular regions - so how do I go about doing this?

I'm using Nice Menus for my Navigation.

Thanks.


texts: How to grab the values of field collection items in a template file?

texts:
I have a field collection field_plaats_en_aantal with two fields: field_plaats (text) and field_aantal (integer). I'm currently displaying this field collection in a node view as an unordered list:

I'd now like to theme the field collection a bit in order to get something like this instead:

It seems fairly easy, but I can't find a way to achieve this. At first, I tried to work with a template file views-view-field--field-plaats-en-aantal.tpl.php, but I don't know how to grab the values of the field collection items there. Is this a good way to work on? If yes, how can I get the needed values?

Afterwards, I read some things on the internet about templates for the field collection items themselves and tried using two templates field-collection-item--field-plaats.tpl.php and field-collection-item--field-aantal.tpl.php, because that seemed an easier solution to me. However, those files aren't scanned and therefore don't affect the theming of the fields. What am I doing wrong?


texts: How to create multiple node at a same time programatically?

texts:
I am creating a node via code

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

        if($form_id=='article_node_form'){
            $form['#submit'][] = 'newApp';
        }
}

functin newApp($form,$form_state){
        $node = new stdClass();
        $node->type = 'application';
        node_object_prepare($node);
        $node->title = $prductData->title;
        $node->language = LANGUAGE_NONE;
        node_save($node);
        }

It's creating the application node. I also alter content type node form for article. When I click save button of article content type it's creating my application type node, but it's not creating the article type node. I need the site to create one node create of article type and second application when I save a new article.


texts: How to pass/link the node id of the result of a view (say, content type A) to another view of content type B, which are referenced in content type A?

texts:
I have three content types: Newspaper, Headlines, and Local. All entities have  standard Title/Body fields. Newspaper has two additional multiple value fields named Headlines and Local that are referencing the respective content types.

I ultimately would like two very similar RSS views (one for Headlines and one for Local) that would show respective nodes that are linked from a Newspaper content. I am able to do this using Views Relationships. The problem is how to display only referenced nodes that are linked from the latest Newspaper content type.

I also contemplated on the possibility of first creating a separate view that displays the latest Newspaper, but I can't figure out how to pass it to another view, if it's even possible.

Here's some concrete information:
Say for example, I have the following content

Newspaper

June 19, 2018
June 18, 2018

Headlines

Blah
Bleh
Meh

Local

Something Happened
Nothing Happened
Nothing Happened again

Here's a visual on what I'm trying to get.

The whole reason for this is that I'm working with a newsletter application whose templates can take in several feeds. The particular template has a different style per section. I was planning to pull in a separate feed per section so the section can be styled independently. Even though the would-be feeds are separate, I need them to be in sync with one another and make sure they're pulling from the same Newspaper content.


texts: How to configure EU cookie compliance module for only Google Analytics

texts:
I have installed and configured the EU cookie compliance module, but it only displays the message when I log into admin section. I use Google Analytics and I must show the message for all the site.

I think that the issue is that Drupal doesn't set any cookie and that's why it doesn't display the message (the GA cookie is external to Drupal).

How can show the message when I use only the GA cookie?


texts: Open login form in popup iframe? Using Colobox module?

texts:
I have the login form block in my header. I removed it and in its place to put a 'login' link.

When clicking the link I'd like a popup (iframe or inline content) to show up. When the form is submitted the popup should close and then return and refresh the parent page.

I think the colorbox module is the right module to do this but I think that my request must be a frequently request and maybe there is an easier way to do this?

Thanks


texts:
I am building internal in my custom module that I am porting to Drupal 8:
https://www.drupal.org/project/taxonomy_facets

I need to get a current language prefix so I can prepend it to the link. I Drupal 7 it was as simple as:

global $language;
$prefix = $language->prefix;
$mylink = $prefix . '/example/something';

How can do this in Drupal 8?

EDIT: My issue specifically is that I have a language prefix set to NONE for the default language at Home >> Administration >> Configuration >> Regional and language >> Languages >> Detection and selection. (admin/config/regional/language/detection/url)

For the default language, I want the code to return the real prefix, i. e. NONE, not en (the code for the default language, English).


texts: How to add custom text with node reference autocomple value?

texts:
i stucked in a very serious problem, i want to add my custom text with node reference target value, i already spent three days to figure out whats wrong, so finally after spending my 3 days on it to figure out whats wrong is going on i am here

here is my code :
in node.module

function node_field_form_alter(&$form, &$form_state, $form_id){
  global $user;
  if($form_id=='article-node-form'){
    $form['field_related_nodes']['und'][0]['target_id']['#autocomplete_path']= "somik"
  }
}


texts: Is there a way for a rules execute PHP action to return a value?

texts: I would like to be able to stuff the result of the PHP code into a rules variable. Is this possible?


texts:
I made a custom js script for a little calculator. I want to use this in only 1 node (article or page) so I do not want to load it via tpl files etc because I do not need it sitewide. And also: if every custom script (that I use only in 1 node) has to be loaded sitewide I would get an immense head section after some time. Does anyone have experience with how to do this in a simple and safe way?

Thanks.
Frank


texts:
I have popup showing on click on a link on my site which shows a login form in iframe.
i am able to login with popup iframe but when i close that popup, i am not logged in on main site and need to login again.
is there a way so that i only need to login once, either from main site or from iframe?


texts: Javascript file in theme does not get loaded

texts:
I just added a script scroll.js, but it does not get loaded.

My theme is called test. I put the script in the js directory within the theme directory.

Permissions on the script are 644 (like on all other scripts in other themes) and permissions on the js directory are 755.

I added a line scripts[]= js/scroll.js to test.info.

Sorry for forgetting to mention the version of Drupal. I'm using Drupal 7.
I flushed all caches and did a hard refresh in the browser (tried both Firefox and Chromium).

After it looking like nothing was being loaded, I added a line window.alert("sometext"); to the script just to be sure. Still nothing.

In Firefox and Chrome the file is neither listed as being loaded nor as failing to load or permissions error.

It seems to me that the change to the .info file is being ignored, but I might well be wrong. How do I force Drupal to not ignore the new script file?


texts: How much of Drupal 8 will rely on or be compatible with Symfony?

texts:
Now that Drupal 8 is being redeveloped with Symfony, and we are just about to go into the code freeze so that early adopters can start playing with it, what will it affect?

Will we be able to write modules and themes like writing bundles? Should we all start brushing up on or learning Twig?


texts: How can I create a custom user profile page without overlapping the registration and login pages?

texts:
I'd like to create a custom user profile page, but if I use /user/% path then it will also overlap /user/registration, /user/login and so on...

Is there any ways to avoid it?


texts:
I am trying drush cc all, but no luck.

https://api.drupal.org/api/drupal/modules!field!field.api.php/function/hook_field_info_alter/7

I need to programmatically hide a field and thinks that this is place to go.


texts: Image style is not working for larger size image

texts:
I am working on a drupal 7 site http://imgmart.com where I have defined multiple image styles. I have a content type called gallery with image cck field. Everything works fine if I upload image of lower resolution like 800px (around 1 MB) file. When I upload larger resolution image, image style won't work but image file is getting uploaded successfully. I don't see any error reported in log file or log messages page.

What could be the issue?


texts: Accessing $language inside node content in drupal 7

texts: Normally I would use $language to get the active language on my drupal 7 page. Now I'm doing some changes to a node content (set to PHP code) and I can't seem to get any variables working? I badly need to get the active language inside the node content - how?


texts: What is the order of return value for field_info_instances?

texts:
I've used field_info_instances function to retrieve all fields info under a content type.

field_info_instances('$entity_type','$bundle_name').

As from API page,

If $entity_type is not set, return all instances keyed by entity
type and bundle name.
If $entity_type is set, return all instances for that entity type,
keyed by bundle name.
If $entity_type and $bundle_name are set, return all instances for
that bundle.

I didn't get the third point here. what is the default order for return output by file_info_instances when $entity_type and $bundle_name given.

Any idea?


texts:
I got the following Error when a licensed commerce file should be shown in the "Files" tab of the user account:

  Notice: Undefined offset: 0 in commerce_file_handler_field_download_limit->pre_render() (line 27 of /web/websites_aip/atticindependent.ch/drupal/sites/all/modules/commerce_file/includes/views/handlers/commerce_file_handler_field_download_limit.inc).

I can reproduce this locally and some time ago it worked fine. The error doesn't appear in any search engine research ...

Any suggestions?

The Error was caused by a misconfiguration in the File Attache and Filesystem section. This case is closed. Thank you!


texts: How to show a block on user/uid but not on user/login and user/registration?

texts:
I have public profiles for my users at /users/1 etc and show blocks on that page with the setting "Only the listed pages" of "user*".

Now those blocks also appear on user/login and user/registration pages.

How can I exclude blocks from those 2 pages?

Otherwise I'll probably use the Pathauto module to have the user profiles at /profile/....


texts: Querying the database via a url and displaying the results?

texts:
Some background context:
I have created a custom form, which inserts data into several tables when submitted. In fact, five new records are created in the node table on submit. A new record is also created in several other other tables, which are all related to these five newly created records in node. One of these node records is the root of everything: from the nid you can access all the related records

The aim:
Now, I'd like to be able to enter a url, like example.com/record/1, and for the '1' to be used as the nid from which to get this root node record from the database, and all its related records, and to display it all on a page.

The question:
How can I do this? I have looked into node_load and menu_get_object, but I can't find any documentation which describes the process of querying the database, using information in the submitted url, and displaying the results on a page.

Thanks


texts: Can you use the features module to replace existing functionality

texts:
Say I have an existing content type and related view on a site.  Can I install Features and convert that content type and view into a feature.

I want to start using Features for better portability.


texts:
I am using SolrPhpClient with Drupal, and I want to use Drupal as higher-layer user-interface to be able to query and retrieve search results from Apache Solr.

I tried to use this example for testing if Drupal works with SolrPhpClient, but I am getting two errors:

  Deprecated function: Function split() is deprecated in ApacheSolr_Response->_construct() (line 117 of /var/www/drupal/sites/all/modules/apachesolr/SolrPhpClient/Apache/Solr/Response.php).

  Warning: htmlspecialchars() expects parameter 1 to be string, array given in eval() (line 80 of /var/www/drupal/modules/php/php.module(75) : eval()'d code).

Have anyone used SolrPhpClient before? I have never used PHP, so I had a difficult time understanding it.


texts: Add to Cart Forms Buttons disables Boost Module Caching

texts:
I've installed boost on my drupal 7 site with commerce setup. Boost is working fine, but any pages with a form, such as an add to cart form. It will disable boost caching. I need a way to ajax load these form buttons after the page is loaded so boost doesnt cache the forms.

What methods are there to solve this solution?


texts: Domain Access with Google Analytics modules two different google analytics code

texts:
I have my main site and i created a subdomain with Domain Access module. for example i have www.example.com and i created www.example.com.uk. I have read that you need to install the Domain Configuration and that would create a block in domain access list that yu can provide your second google analytics code (UA-XXXX-XXX) without any success. Has anyone managed to accomplish that? if not how can i do that?
Thanks


texts: Drupal 7 different urls with same information

texts:
I have a new drupal site,it was built by other website designer.Now i got a problem for the url.There are some different url with same information.For example:
"/taxonomy/term/31/0" and "/projects/led-tunnel-lighting".I only need the url like "/projects/led-tunnel-lighting".
Please tell me how to fix this problem.Thank you very much!
I was a novice of drupal.


texts: Links in sidebar to link to search results

texts:
I have a view in sidebar showing a taxonomy Category. There is a view on /search-page that displays search using Search API view and exposed filters. I want the sidebar Categories to link to the search page with filtered category (/search-page?filter_category[]=13)

What would be a proper way of doing this?

I tried to do rewrite on the Name field in sidebar view.

"Rewrite the output of this field"
rewrite Text to [name]
checked the "Output this field as a link"
set Link Path to search-page?field_[machine_name]%5B%5D=[tid]
the links in sidebar get double escaped (it's a bug https://www.drupal.org/node/1342124)

In addition to the bug, I don't particularly like this way, because the path is hardcoded.

Is there a way to kind of link to the search view with some params instead so that Drupal handles the URL internally?


texts: When adding Content: has taxonomy term id contextual filter to view and check specify validation criteria box, why don't I see validation options?

texts:
My request is closest to these two questions:

Filter by multiple taxonomies in URL

Views contextual filters taxonomy name

I have a view which is a page and displays node titles in a table format after the user selects a state, school year, school division, and school using exposed filters. And since each resultset can have dozens of nodes (nodes about that school for that school year) in it, the results are pages of links to 10 nodes at at time. I have exposed filters for state, school year, school division, and school. The view works fine, but the urls for each page of 10 node titles pertaining to an individual school looks like this:

http://www.mydomain.com/schools?field_state_tid=123&field_school_year_tid=456&field_school_division_tid=789&field_school_tid=999&page=1

when I would prefer it look like this where instead of term_ids I have terms in the url:

http://www.mydomain.com/schools/arkansas/2012-2013/little-rock/clinton-elementary/page1

I have created state, school year, school division, and school taxonomies and each node is tagged appropriately with 1 term from each taxonomy.

But when I try to follow the instructions in the above mentioned questions, I get stuck at the part where it says to "specify validation criteria".

I check that box, but I have no options - the options are unavailable.

In the second question referenced above there is a part that says:

"Make sure Specify validation criteria is checked and you should be presented with more options."

[emphasis added]

That is exactly my problem - I should be presented with more options, but I am not.

Can anybody tell me why I am not presented with more options?
Am I doing something else wrong?

Thanks in advance.


texts: User can input multiple terms, results can tagged as some or all of those terms, but not other terms

texts:
I think I'm going to have to make a custom operator for this, but I figured I might as well ask in case I'm missing something obvious.

Let's say I have (in D7) three nodes tagged with colours:

Node 1

blue
green

Node 2

yellow
red

Node 3

blue
red

Node 4

blue

The user selects red, blue, and green from the exposed filter in a view. This view should return Node 1, Node 3, and Node 4, but not Node 2 (as it is tagged with yellow). Using the "has taxonomy term" filter, the operators "is all of" and "is one of" don't work here, as the first one returns nothing, and the second returns Node 2.

To make things even more complex, I'll need to do this with two different filters in the view (with different sets of taxonomy terms), as well as have a standard "is one of" filter on a third taxonomy term set.

Am I missing a simple solution with this, or do I need to write a custom operator/filter? Thanks!


texts: How to list duplicate nodes based on title with views

texts:
I'm trying to list all duplicate nodes based on node title with views.

In views aggregation settings it's said that:

  If enabled, some fields may become unavailable. All fields that are
  selected for grouping will be collapsed to one record per distinct
  value. Other fields which are selected for aggregation will have the
  function run on them. For example, you can group nodes on title and
  count the number of nids in order to get a list of duplicate titles.

I enabled aggregation and added a node content title filter (aggregation: count) to count nodes and list if a title has more than one node (count:  Is greater than 1). But it doesn't work for me, it lists nodes with unique titles and duplicate titles (I mean no affect).

How can I list all nodes with duplicate titles by using views?


texts: How to locate the Entry Points of a Drupal 8 Core module?

texts:
I'm to perform a security audit on the Drupal 8 Core modules, and was curious if there were any telltale signs of Entry Points (ie, how a module communicates with an external module and vice-versa).

OWASP defines an Entry Point as "the interfaces through which potential attackers can interact with the application or supply it with data."

I assume this is not very different from Entry Points of standard web applications (forms, HTTP packets, etc.), but I am interested in knowing whether or not Drupal has its own standard as to where these Entry Points are located. Are there specific snippets of code I should be looking for?

I do intend on reviewing the modules manually and in-depth, but figured someone on here may have some advice to help lessen the steep learning curve.

Any and all help is appreciated!

Cheers! :)


texts: how to print 'add term' taxonomy form into block

texts:
I have a taxonomy vocabulary named "jenis dokumen". I want to let anonymous users add terms within this vocabulary. I'm trying to add a block and render that form to add new term using PHP filter, but it's failing.

This is my code:

include_once(drupal_get_path('module','taxonomy') . '/taxonomy.admin.inc' );
return drupal_render(drupal_get_form('taxonomy_form_term', jenis_dokumen));

Can anyone help?

now i have success with this.

$vocabulary = taxonomy_vocabulary_load(2, FALSE);
module_load_include('inc', 'taxonomy', 'taxonomy.admin');
return drupal_render(drupal_get_form('taxonomy_form_term', $vocabulary));

but, there is a default value in field name 'Jenis Dokumen'
how can i get blank (no value) in field?


texts:
I'm using search api and solr, with facet api.
If I display a "current search block", if I click on a facet the system add to the block a "(-) facet name", and if I click to "(-)" it removes the facet from the search.
Is there a way to theme this behaviour? I want to display it as an image.


texts: Create a view that links to another view

texts:
I'm trying to create a view that works as category page (aggregates a list of titles from content pages I've created). I need that list to link out to another view that is used to display photo galleries. Am I approaching this the correct way?

I want it to be dynamic so the customer can create photo galleries and they will automatically populate in the category page; then, a link send you to the proper display view.


texts:
I have a search view based on "Search API", I want to replace the default search block of the drupal core with a block "Search API".

1) How to modify the search block of the heart so that it uses search api instead ?

or

2) How to create a custom block /structure/block/block-content to use "Search API" ?


texts:
I have created a module that adds a an extra field for each user. I do this by first creating the field using field_create_field and then I bind it to the user object using field_create_instance. This is standard practice I think.

Now, I would like to add so that by default only administrators should be able to change the value of this field. I would like to keep down the number of external modules, so if possible I would like this to be the default behavior after installing my module, without relying on other modules such as field_permissions to achieve this.

Is this possible?

Thanks in advance!


texts: Search result problem with Taxonomy Term-Names in the result

texts:
I need a solution for following Drupal 6 problem:
In my search results, taxonomy terms are appearing in the summary ->
https://www.dropbox.com/s/reg4yebpuwvgref/Screenshot%202016-06-03%2009.13.47.png?dl=0 ( lp_almhütte_hüttengaudi, lp_bäuerinnen_backen, lp_brandteig, ...) and i can't get them out of there.

In the backend in the content type display settings, there is no option to hide them.

I found out, that the vocabularies are included via the vocabularies itself. So if you edit the vocabulary, there are all content types listed and you have to tick the ones you want to have the vocabulary in.


texts: Installation keeps complaining that Unicode library (mbstring) should be disabled, even though it seems it already is

texts:
I'm trying to install Drupal 8.1.3.
(Apache 2.4.7, PHP 5.5.37, Windows 7)

In the "Verify Requirements" step Drupal keeps complaining

  Unicode library -- Error -- Multibyte string input conversion in PHP
  is active and must be disabled. Check the php.ini mbstring.http_input
  setting. Please refer to the PHP mbstring documentation for more
  information.

However, I already have the following in my php.ini

mbstring.http_input = pass

and the diagnostic output produced by a call to phpinfo(); contains

zend.multibyte  | Off | Off

So I am not sure whether

I was unsuccessful in switching off the multibyte string input conversion,
I am looking at the wrong configuration files / settings, or
Something is wrong with Drupal's detection of these setting (see for instance this discussion on a failing detection).


texts: How to check which enabled modules are really used?

texts:
Is there a module or something else that you can use to check if all enabled modules on a site are really used?

I've searched the internet but with no results ...


texts: Which module will allow me to see the two buttons "Customize this page" and "Change the layout"?

texts:
When I use the Drupal distribution Openchruch, and I view a page as an administrator. There are two buttons in bottom:
customize this page
and
change the layout

Which module will let these two buttons appear?


texts: Views table output change row into column


texts: Is there any way to make that Drupal 7 built-in contact form sends the emails to a different address than the one of the UID 1?


texts: How the handle an override of the schema of a field type

texts:
To add other data to a state field, I overrode 2 functions of the StateItem class (from the state_item module)
    public static function schema(FieldStorageDefinitionInterface $field_definition) {
        $schema=StateItem::schema($field_definition);
        $schema['columns']['json']=[
            'type' => 'json',
            'pgsql_type' => 'json',
            'mysql_type' => 'json',
            'not null' => FALSE,
            'description' => "Store data about states in json format",
        ];
        return $schema;
     }
    public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
        $properties=parent::propertyDefinitions($field_definition);
        $properties['json']=DataDefinition::create('string')
        ->setLabel(t('Data'));
        return $properties;
    }

As I have already several fields of this type in my website, I got the following errors in the Status report page:
Entity/field definitions  Mismatched entity and/or field definitions
                          The following changes were detected in the entity type and field definitions.

...followed by the fields that must be updated.
Knowing the fact that I am the only user of this custom field, what is the best approach to handle this kind of change?
Here is the solution
As explained by @sanzante, I created an UpdateN function which is updating all the fields of the state type by adding an appropriate column to the table of each field:
function mymodule_update_8001() {
  $spec = [
    'type' => 'json',
    'pgsql_type' => 'json',
    'mysql_type' => 'json',
    'not null' => FALSE,
    'description' => "Store data about states in json format",
  ];
  $schema = Database::getConnection()->schema();
  $state_fields = \Drupal::service('entity_field.manager')
    ->getFieldMapByFieldType('state');
  foreach ($state_fields as $entity_type_id => $fields) {
    foreach (array_keys($fields) as $field_name) {
      $table = $entity_type_id . '__' . $field_name;
      $table_rev = $entity_type_id.'_revision' . '__' . $field_name;
      $new_field_name = $field_name . '_json';
      $schema->addField($table, $new_field_name, $spec);
      $schema->addField($table_rev, $new_field_name, $spec);
    }
  }

}

The key points are :
1-how the table names are constructed. (see $table and $table_rev in the code)
2-how the new field names are constructed. (see $new_field_name in the code an the fact that you must use the same column name as defined in $schema['columns']['json'])
3-You must use the same spec as the ones defined in function schema
After the updated ran, I still got the Mismatched entity and/or field definitions error message.
I could solve this by running drush entup (the module devel_entity_updates must be installed)


texts: How to use Facebook Connect's user picture in Views?

texts:
I'm using the Facebook Connect Module on my Drupal 7 site. If a user logs onto my site via Facebook, his Facebook user picture gets imported to his account on my site. But now I am wondering whether or not there is any way to show this Facebook user picture in Views. This picture is only shown on the user profile page, not in any view that references the user picture field.

Does anybody know how to do this or is there any way to automatically import the Facebook picture to be the standard user picture?


texts: How do I get a contextual filter argument in a template file?

texts: I use contextual filters for a view whose path is /path/langcode, where langcode is a contextual filter. How can I get langcode in a template file?


texts: Why isn't a PDO driver detected on the install page?

texts:
I have an old Drupal 7 project and I need to set it up on my localhost.
I have Ubuntu 16.04, Apache 2, php 7.0, and MySQL 5.7 installed.
Everything is working fine for other PHP scripts, But when I tried to install Drupal 7 project, I got this error.

Your web server does not appear to support any common PDO database extensions. Check with your hosting provider to see if they support PDO (PHP Data Objects) and offer any databases that Drupal supports.

I could not figure it out why Drupal doesn't detect PDO. How can I fix this issue?


texts: How can I find a module or activity that is excessively writing to the database?

texts:
Problem:

We have two productions servers: primary and failover. The two machines are linked via mysql replication. The mysql relay logs are clogging and bringing servers down the failover server. I see dozens of mysqld-relay-bin.000Xxxx files in /var/lib/mysql on the failover box.

My Question:

How might I find if a module or some other activity is doing excessive database writes?

Why am I asking a sql question on DA?

Now I'm asking this in Drupal Answers because we're trying to trace this from source to destination. I have a suspicion that we have a module that is a bit over-aggressive at logging. We only have two content editors and changes are made on a few pages a day. I've also asked a similar question on https://superuser.com/questions/869776/ to see if there is a more mysql-specific remedy.

Master my.cnf

$ cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# sync
log-bin=mysql-bin
server-id=1
expire_logs_days = 1
max_binlog_size  = 100M
.
.
.
# sync config
log-bin = /var/log/mysql/mysql-bin.log
binlog_do_db=drupal
server-id=1

Replicant (Slave) my.cnf

$ cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

server-id=2
master-host=xxx.xx.xx.xxx
master-user=slave_user
master-password=XXXXXXXXXXXXXXX
master-connect-retry=60
replicate-do-db=drupal
slave-skip-errors = 1062,1054
expire_logs_days = 2
max_binlog_size  = 100M
ssl

Various or interesting finds in the logfile via tail -n 10000 messages | grep drupal | grep -v "page not found"  | grep -v "access denied"

Warning: in_array() expects parameter 2 to be array, string given in context_menu_tree_add_active_path() (line 128 of /var/www/html/sites/all/modules/context_menu_block/context_menu_block.module).

Other considerations:

Drush runs once an hour via the OS's crontab. We pull in multiple calendar and RSS feeds to keep updated content.
We've recently migrated this site to Drupal. Our log files still indicate a few broken, dead links that spiders are finding. Which if I had db_log/watchdog enabled would be an obvious culprit.


texts: Error: Cron has not run recently. But it did!

texts:
I have a site (hosted on Acquia) which always return an error about cron not running on the Status report page, but it actually runs regularly and it does all the task attached to it.

Cron is running externally (through Acquia panel) and Automated Cron is disabled. The error appears regardless of the method I use to run cron (Drush, Admin UI, Externally).

I couldn't find any issue trying to debug this, it seems just a "false positive".

Any suggestion on how I could get rid of the error?

Thanks


texts: What hook to use to update history table

texts:
What hook can I use to update the history table for my use case?

I am using the answers module. When viewing a question it appends a view of answers by format of view mode. The history table for the question type is updated, but not for the answer type. This has the effect that all comments on the answer are always tagged as new. I added code to the hook_node_view for the question type wherein I get all related answers and update the history table correctly for them. However, hook_node_view runs before hook_comment_view and now all comments do not get a tag at all. I probably need to alter the history table after hook_comment has run. Any suggestions?


texts: How to display picture from field near every blog entry

texts: When I go into mywebsite/blog I have blog entries displayed. What I want to do, is display a picture uploaded to every blog entry left to the entries displayed on this page. How can I achieve this? Is there some code to display uploaded picture in page--blog.tpl.php? I also would like to NOT display picture when someone actually click and goes to some single blog entry.


texts:
I'm sorry my english is not very well, but I hope you can understand my problem. I try to make a views filter using hooks_view_pre_view to make a double-sided query. I got 2 fields, "gender" and "gender_search". I wish that views filters all users who have the gender that the current user searchs IF/AND the current user has the gender the loaded/other users are searching for.

There are many other filter-options, also based on get_locations, too, that's why I wish to use views.

I hope it is possible to solve my problem and you understand my request, it is difficult to explain.

Thanks


texts:
I've been retrieving information from  a database for display.

function myid_user_page_form(){
    $query = db_select('student', 't1',array('target' => 'import'));
    $result = $query->fields('t1', array('firstname','middlename'));

    foreach ($result as $record) {
        $info['firstname'] = $record->firstname;
        $info['middlename'] = $record->middlename;
    }
}

In my case, all data stored in my database is all uppercase. For example:

$info['firstname'] = "ALYSSA"
$info['middlename'] = "ENGANIO"

I want to make "ALYSSA" to "Alyssa" and make "ENGANIO" to "E.". How will I do that in Drupal?


texts: How to have no more than 20 Entity references to another content type?

texts:
I have a content type with a entity reference to another content type/view. The current possible relations could be 1,2,3 .... until 10 or unlimited. These are given in the field attributes screens.

I need 20. After that the user is not allowed to add another field in the gui.

Any solutions how to do this?


texts:
I have several custom modules that load and display data from custom tables. I have successfully managed to use the drupal search on these contents, using the drupal search hooks like, hook_update_index, hook_search_execute, etc. But now we have decided to use solr instead. Now I'm totally confused and don't know how to make solr index my custom data. The closest I've come to solving this is to this:

function msearch_apachesolr_index_document_build(&$document, $entity, $entity_type) {
    if ($entity_type == 'people' && isset($entity->description)) {
        $document->addField('s_firstname',
                $entity->field_firstname['und'][0]['value']);
        $document->addField('s_lastname',
                $entity->field_lastname['und'][0]['value']);
        $document->addField('ts_description', $entity->description);
    }
}

This code does not work(as in indexing my data) and it really shouldn't. There's no way that the $entity passed to this hook could have my desired data in it. Is there something I should do to manually pass the object to this hook? Do I need to implement hook_cron and do this there?

Thanks, any help is appreciated

PS:

I know how solr indexes data, through POST requests to solr/corename/update, but I doubt that's the way to go. If I had to go this way, I would've had to implement the whole mechanisms for indexing rows and making sure no duplicates were sent for indexing. OR SHOULD IT BE EXACTLY LIKE THIS???


texts: Get a vertical slider to float images next to each other (inline) rather than block-style

texts:
I'm working on a Drupal 6 slider that is supposed to scroll through logos (3-4 per row), one row at a time. I can even get the output to sort according to how I'd like it done.

My problem is that the images always display block-style (1 image per row) rather than float next to each other so there are 3-4 per row. I'm sure this is a simple CSS fix somewhere, but as I'm new to Drupal, I cannot figure out what file I'm supposed to edit to make this happen?

If someone has a solution better than manually editing files on the server, I'd be please to here it. Thanks!


texts: Images loading fine on day 1, broken on day 2

texts:
Strange problem.

Images on my production site are 100% working at one point (right after getting a refresh from staging), and within a day or two, some images on some pages become broken links.

(Production is updated from staging through mysql database dump/restore).

As I continue to watch this over the course of subsequent days, more pages in production experience this symptom, but the images are always there in staging - never broken.

Here's some data...
When viewing the content of a page in the staging environment, an inserted image looks like this (Admin UI - view Source).

...installed one of the Outlook toolbars.

[[{\"type\":\"media\",\"view_mode\":\"media_large\",\"fid\":\"123\",\"attributes\":
{\"alt\":\"\",\"class\":\"media-image image-style-large image-style-large image-style-large\",
\"height\":\"298\",\"typeof\":\"foaf:Image\",\"width\":\"264\"}}]]

Who can ...

When the Staging content is pushed to Production, viewing the same page in the Admin UI on the production server, the content starts out exactly the same and the image renders fine.

Within a day or two, the Production page changes (presumably by something Drupal Cron is doing) to something like this:

...installed one of the Outlook toolbars.

Who can ...

The "img src" version that creeps in is a bad URL -

http://default/sites/default/....

I've grep'ed my daily mysqldumps for this bad URL string, and each day there are a different number that creep in.

    for file in /data/mysqldumps/*sql
    do
      echo -n $file
      echo -n ": "
      grep -o "http://default" $file | wc -l
    done

/data/mysqldumps/20121205-160101.sql: 0 (Zero occurrences on Dec 5 because I pushed
                                         on that date, & all images were known good)
/data/mysqldumps/20121206-160101.sql: 106
/data/mysqldumps/20121207-160102.sql: 130
/data/mysqldumps/20121208-000101.sql: 138
/data/mysqldumps/20121209-000101.sql: 157
/data/mysqldumps/20121210-000101.sql: 158

No local Admin changes have occurred on production, and nothing but cron is running there.

What can be causing this? It's only happening in production (which is totally awesome).

Any suggestions on troubleshooting?

Thanks,
Mark


texts: I have a content type with revision enabled, each time when I edit the node I can see authored on field has created date by default. I want this  field to be empty so that it uses latest updated time as created time. How can I achieve it?


texts: How to print name of Payment Method in Commerce 2 order receipt email?

texts:
The commerce-order-receipt.html.twig contains a variable called {{ payment_method }}, which returns no data. Likewise, when I add Payment Method field to my orders table view, it shows no data. Payment Gateway does contain the name of the payment method used in the order. I'd like to print that value in my order receipt email, but cannot seem to find the correct syntax. So far I have tried the following:

{{ payment_gateway }}
{{ order_entity.field_payment_gateway }}
{{ order_entity.field_payment_gateway.value }}
{{ field_payment_gateway }}
{{ field_payment_gateway.value }}

All of those turn up blank in the email.

How can I show the payment gateway title in the order receipt email twig?


texts: Create 2 or more exposed filters for the same view

texts:
I would like to ask how can I create 2 or more exposed filter for the same view,which can be placed in different places of a site.
E.g. one exposed filter will have 3 fields,the second one will have 7 fields.
thanks


texts: How to pass default values on node form through form_alter when using confirm_form?

texts:
My confirm form should consists part of node form but with disabled fields. I mean after I submit node form I rebuild it and append confirm form in hook_form_alter()(Before it I change submit callback and set 'reduild' flag in form_state in it).

But this form not containing filled values. I guess this is because I make rebuild but as I know there is no other way to display confirm form.
So the question is how to do it? How to fill values filled on previous step?

First phase submit callback:

function mymodule_content_confirm_form_submit($form, &$form_state) {
  $form_state['storage']['confirm'] = 'save';
  $form_state['storage']['values'] = $form_state['values'];
  $form_state['rebuild'] = TRUE;
  return;
}

Form alter the part where confirm form appends:

  $show_confirm_form = isset($form_state['storage']['confirm']);
  if ($show_confirm_form) {
    // We need this form for panels and we can't remove it so we just hide.
    foreach (element_children($form) as $id) {
      $element = &$form[$id];
      if (!empty($element['#type']) && in_array($element['#type'], array('hidden', 'value'))) {
        continue;
      }
      $element['#disabled'] = TRUE;
    }
    $message = t('Are you sure you want to save all these changes?');

    $form = confirm_form($form, t('Levels & Content'), current_path(), $message, t('Confirm'), t('Cancel'));
    $form['actions']['cancel']['#href'] = current_path();
    $form['actions']['cancel']['#attributes']['class'][] = 'button';
    $form['actions']['cancel']['#options']['path'] = current_path();
    $form['actions']['cancel']['#options']['query'] = $destination;

    $form['actions']['submit']['#submit'] = array('mobitek_custom_content_node_form_insert_values_submit', 'node_form_submit');
    return;
  }


texts:
I've a site with users that can create and edit contents, vote, flag, comment, etc.
I would like to have a page with a history of every action, something like:

on day X user has create the content "Title".
on day X user2 has commented "Title 1".
and so on.

Is there something like this?
I've found Activity, but for D7 there is only a "dev" version, released con july 2012.

Another way could be to create, with Rules or a custom module, custom entries in Watchdog and than create a view with Views Watchdog.

Any ideas?


texts:
I found on google that hook_menu() is cached, and I have to use a callback function, but I couldn't fix it. $user->uid is always 1. I don't know how to solve this problem.
I'm a beginner. Tnx.

function test_menu() {
  $items = array();
  global $user;

  $nodde = db_query("SELECT title, nid, vid FROM {node} WHERE uid '$user->uid'")->fetchObject();

  $items['test'] = array(
    'title'            => t($nodde->title),
    'page callback'    => 'test_output',
    'access arguments' => array('access content'),
  );

  return $items;
}


texts:
I have the following scriptthat runs on $(document).ready where the script alter some form elements such as radio buttons.

When the form is updated via JQuery ,the script is not run.

I need the script to alter radio buttons after successful AND unsuccessful form submissions.

Here is a link to my test site:http://test2.bratpaks.co.za/home

    (function($) {
      Drupal.behaviors.icheck = {
        attach: function (context, settings) {
          $('input[type=radio]', context).each(function(){
          var label = $(this).next(),
          var label_text = label.text();
          label.remove();
            $(this).iCheck({
            checkboxClass: 'icheckbox_line-realred',
            radioClass: 'iradio_line-realred',
            insert: '

' + label_text
            });
          });
         }
       };
     })(jQuery);


texts:
I've looked around on Google to see if anyone has detailed how to extend Paragraphs and create a new Paragraph Type programmatically. I'm sure it roughly follows creating a new Entity type programmatically (which is thoroughly documented), but I'm curious if anyone knows any paragraph-specific documentation.
In short, I'm attempting to extend Smart Content to use Paragraphs instead of Blocks. You can see how they extend the Block interface and I suspect I could do something similar for Paragraphs. For e.g. a 'Decision Paragraph' (this is the new type) that allows you to select a Segment Set and then loads all the possible Reactions for that Segment set with fields for entering which Paragraph to display when a Reaction wins. This is isomorphic to how it works with Blocks (see the interface image below). I'm curious if anyone knows the basics for extending Paragraph types like this.


texts: Can you retrieve the Omega breakpoint settings?

texts: As the title suggests, is it possible to retrieve the Omega breakpoints you set in the settings for your subtheme via any kind of function or call? Like the ones from the picture.


texts: Why xmlsitemap module implements hook_node_comment_delete this way?

texts:
Does someone know why xmlsitemap.module implements every hook_node_comment_ hooks, with a StdClass casting for the object passed in param ?
example :

/**
 * Implements hook_comment_delete().
 */
function xmlsitemap_node_comment_delete(stdClass $comment) {
  xmlsitemap_node_comment_update($comment);
}

(xmlsitemap_node.module l.95)

A teammate overrides some Drupal default comment behaviours by declaring a new entity, with CustomComment as "entity class" name.

Then, when we want to delete a comment, this xmlsitemap's casting fires an error because the loaded comment is not anymore a StdClass object, but a CustomComment object.

Do I have to hack that module ?
Any Idea ?


texts: Redirect from route when the controller has been changed

texts:
I'm trying to redirect to an external URL in a custom controller whenever I land on the 404 page.

Right now I alter the controller destination in a route subscriber like this:

public function alterRoutes(RouteCollection $collection) {
  if ($route = $collection->get('system.404')) {
    $route->setDefaults([
      '_controller' => '\Drupal\test\Controller\TestController::test',
    ]);
  }
}

This is my controller:

public function test() {
  return new TrustedRedirectResponse('https://google.com', 307);
}

Right now my controller redirects to the frontpage when I try to redirect.

I could fix this problem by calling $response->send() but that is not a good idea since I'm bypassing the http-kernel call stack that way.

How can I redirect from the 404 page?


texts: Display driving distance between coordinates

texts:
I have working a site that needs mileage given between user coordinate and node coordinate. using location module. I thought it was returning wrong results, when I discovered it returns actual miles "as the crow flies" so to speak. I determined that when looking at what it plotted on a map. I need driving distance.

I am trying the store locator module (but it really doesn't let me do coordinates yet. But the mileage doesn't display there, and views doesn't let me do that, that I can tell.

Everything I have tried has failed. Anyone doing this?


texts: How can I control access to group-private content based on organic groups roles?

texts:
I would like my groups to be able to create content that is not only private to a group, but also private to certain roles within the group. For example, a post that is only accessible by members of Group A that also have the "officer" role.

Ideally, I'd be able to make the roles group-specific because different groups should be able to create and assign roles to their members.

How can this be accomplished?


texts:
I have a function:

function _dc_election_races_get_articles($search_term)
{
    $search_url = 'http://feeds.example.com/vote_up/search.php?search='.rawurlencode($search_term);

    if ($cached = cache_get($search_url, 'cache'))
    {
        $results = $cached->data;
    }
    else
    {
        $results = json_decode(file_get_contents($search_url));
        cache_set($search_url, $results, 'cache', 60*60*3); //3 hours
    }

    return $results;
}

I basically want the cache to expire after 3 hours and re-fetch the data from the url. The  documentation on drupal made it seem like that it might not be removed from cache after 3 hours. Will cron cleanup caches?


texts: Rendering a form in a custom twig does not respect tag order

texts:
I have a small custom form that I am supplying a theme hook pointing to a custom template for. The weird thing is, it has all of the markup, but is not respecting it.

Here is the code in the form template being used:

/**
 * Implements hook_theme().
 */
function harlib_newsletter_signup_theme($existing, $type, $theme, $path) {
  $themes = [];

  $themes['newsletter_signup'] = [
    'render element' => 'form',
    'template' => 'form/newsletter-signup',
  ];

  return $themes;
}

Twig:

  <form{{ attributes.addClass('hl__single-input-form__form') }}>
    {{ form }}
  </form>

But here is the source, where it is out of order. The section tag is inside of the form tag instead of outside:

Also, why does this not add a class on the form tag?

<form{{ attributes.addClass('hl__single-input-form__form') }}>

I tried to also add it from the Form API itself with

$form['#attributes']['class'][] = 'hl__single-input-form__form';

When I do that, that class is added up to the parent div tag, the block that outputs the form.

The base theme is stable.

Form code:

$form['#theme'] = 'newsletter_signup';

$form['#attributes']['class'][] = 'hl__single-input-form__form';

$form['title'] = [
  '#type' => 'label',
  '#for' => 'edit-email-address',
  '#title' => 'Want to stay in the know?',
  '#attributes' => [
    'class' => [
      'hl__label',
      'hl__label--inline',
    ],
  ],
];

$form['email_address'] = [
  '#type' => 'email',
  '#required' => TRUE,
  '#attributes' => [
    'placeholder' => $this->t('Email'),
    'class' => [
      'hl__input',
      'hl__input--inline',
      'js-is-required',
    ],
  ],
  '#prefix' => '
',
];

$form['submit'] = [
  '#type' => 'submit',
  '#value' => $this->t('Sign Up'),
  '#attributes' => [
    'class' => [
      'hl__button',
      'hl__button--small',
      'hl__button--inline',
    ],
  ],
  '#suffix' => '
',
];

return $form;


texts: Adding an image to a media bundle's field

texts:
I am trying to add create a piece of new media with the following code. When visiting the media overview screen the media item is listed along with a thumbnail however when you edit the media item the file is not attached, although the file exists in the files area?

use Drupal\Core\Language\Language;
use Drupal\media_entity\Entity\Media;

$data =     file_get_contents("https://homepages.cae.wisc.edu/~ece533/images/airplane.png");
$file = file_save_data($data, 'public://plane.jpg',  FILE_EXISTS_RENAME);

$image_media = Media::create([
  'bundle' => 'image',
  'uid' => '1',
  'langcode' => Language::LANGCODE_DEFAULT,
  'status' => Media::PUBLISHED,
  'field_image' => [
    'target_id' => $file->id() ,
    'alt' => t('this is the alt text'),
    'title' => t('this is an image'),
  ],
]);
$image_media->save();


texts: How to sync configuration between multiple developers' environments

texts:
D8 Configuration management is really awesome and easy to use when there's only one developer working on a project. We are running into challenges in keeping configuration synced between environments when more than one developer is introduced to a project at the same time.

Example:

Developer A is working on feature A. Exports configuration to their feature branch and pushes it to a shared develop branch.
At the same time, developer B is working on feature B and does the same thing - pushes feature configuration to the shared develop branch.

How do you import feature A and feature B concurrently?


texts: How to setup external CSS and JS to prevent render-blocking from Google PageSpeed?

texts:
We are using Google's PageSpeed to help optimize the site. A couple constant issues that come up include render blocking CSS and JS. We have tried the following in our libraries.xml file, but cannot find the appropriate way to do this in D8.

We have found this to be an issue with our local aggregated CSS files that come from our theme and with external CSS and JS

We have tried:

AddAgg module but that still does not solve the issue as we still get render blocking CSS and JS
code below is what we have tried with and without preprocess = false. setting the attributes to async: true does not load the page properly so we using defer: true
We also tried moving the css-placeholder and js-placeholder from our html.html.twig file to the bottom of the page but that has side effects.

mytheme.libraries.yml

fonts:
  css:
    theme:
      //fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i: { type: external, preprocess: false, minified: true }
      //maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css: { type: external, preprocess: false, minified: true }

slick_carousel:
  css:
    theme:
      //cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css: {type: external,preprocess: false, minified: true}
  js:
    //cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js: { type: external, preprocess: false, minified: true, attributes: { defer: true }}

What is the proper way to add external and local CSS and JS without render-blocking?


texts: I have created a view for displaying taxonomies and it works fine it the view mode itself, that is - if I add contextual filters and test it out, in the preview everything shows up nicely, but not in the real world. Is there a way to override the default way posts are displaying with my view?


texts: Organic groups - The OG groups of the logged in user

texts:
I need to list all users from organic groups in which the current (logged in) user is an administrator member.

I manage to list all users from groups where current user is member (using relationship - OG membership: OG membership from User and contextual filter - The OG groups of the logged in user), but I can not manage to get only groups where the current user has administrator privileges.

Some idea?

Thank you.


texts:
Is there a possibility to change the sorting options ascending and descending by symbols in views to visitors?
I can change the words "Asc" and "Desc" in the settings of the view.


texts:
I'm trying to make a webshop with commerce 2.0 in Drupal 8.

But when I have added a product to the cart, and I've filled in the Payment Information pane, and I press "Continue to review", the same page is being reloaded and there's a duplicate of the product I tried to purchase.

So I'm stuck in the check out flow.
If I disable the Payment Information pane, then I can continue in the checkout flow, but then I'm missing the payment information.

Does anyone have an idea for a work around or a fix? or maybe knows what's causing this?


texts: Display taxonomy parent tid of a taxonomy term reference field

texts:
On a node template , i  am displaying a taxonomy term ( entity ref field ).
That taxonomy term has a parent.
How can have that info on the html generated , for css purposes ?
The field.html.twig display this:

Utilisation de Drupal

Rôle

I would like to have smth like

Utilisation de Drupal

Rôle


texts: Drupal response time incredibly slow, but only from some end-users

texts:
I am running across a super strange issue that is killing me. I am seeing response times coming back from my Drupal site of nearly 5+ minutes, but only for some end-users.

I have tested and ruled out a DNS problem. Pings comeback with 100ms response times, and when I swap the Drupal index.php out for a static index.html file, response time is lightning for all users.

I have an end-user in Argentina that sees 4 sec response times, and then when I try from my machine here in Los Angeles, 5+ min. The server is hosted on EC2 in their Virginia data center.

I have also tail'd the access logs and I see the Argentina user's traffic come in right away, but my traffic takes forever to show in the logs.

Is there anything in the Drupal configuration that you can think of that would cause something like this?


texts: How do I create a custom template for view?

texts: I have created a content type called "Hotels". I want to display to the view in different manner other than view options provided by Views module. For that I have to create custom template but don't know how to do it. What should be the naming conventions and where to store the template file. Please help me.


texts:
I need to create a link, which when clicked should be able to set a session variable.

I have used l() function to create the link and tried this but this is not working.

'name' => l(t($n['name']),'edit_details',array('attributes' => array('onclick' =>$_SESSION['id']=$n['id'] ))),


texts: The Zencoder API library is not installed ... zencoder in a library path such as sites/all/libraries

texts:
I have installed Zencoder 2.1.1 for my Drupal 7.22 but it's not working as I see the following error:

The Zencoder API library is not installed. Download the library and install it to a directory called zencoder in a library path such as sites/all/libraries.

I have already done what it required:

[root@ip-10-128-146-179 libraries]# pwd
/var/www/html/drupal/sites/all/libraries
[root@ip-10-128-146-179 libraries]# ls -lrt zencoder/Services/
total 12
-rw-r--r-- 1 root root 7867 Jul 21 16:32 Zencoder.php
drwxr-xr-x 2 root root 4096 Jul 21 16:32 Zencoder
[root@ip-10-128-146-179 libraries]# ls -lrt
total 4
drwxr-xr-x 5 root root 4096 Jul 21 16:32 zencoder

What do I need to now?

Screehshot


texts:
hi I'm trying to create a new Cart view which will simply show Items Total, Cost total and checkout links. I wanted to keep the Default view in place as a fall back, so I cloned it to work on it, but then I noticed my new clone view has a Save button attached to the footer* which isn't there on the original. Also the original is labelled as Display Master, which I've not sen before and dont believe I have access to create such a type.

The footer is set to Commerce Line Item: Line item summary  and investigating all the  options that come with this, none seem to control this Save button.

Can anyone help me out with these two oddities? show some info on the altered screen shots below.

cheers.


texts:
Every time I use a redirect from an URL alias i receive the foloowing report of:

Oops, looks like this request tried to create an infinite loop. We do not allow such things here. We are a professional website!

Ive tried clearing all the cache and ran cron.

I've tried searching everywhere and can't seem to fix it. Thank you kindly for your support.


texts: How to configure second instance of drupal to run from subdirectory

texts:
I have drupal installed in the root folder of the webserver. There is also a custom drupal app that is now running from root/subfolder. I have configured settings.php to recognize $base_url and changed .htaccess to rewrite base to /subfolder.

At the moment, it works great in terms of logging in and making content changes. However, trying to upload files returns an ajax error, if I try to save directly by pressing save, it doesn't return an error on the subfolder site, rather it throws back a 404 on the root site.

What gives? Any help is greatly appreciated.


texts: Reduce installation time and increase the installation speed using drush command "site-install"

texts:
Can anyone tell me how to increase the installation speed and reduce installation time using drush command "site-install".

or

Is there any alternate way to install the distribution via drush with minimal time.

Because, I am trying to install the larger size distribution via drush using "site-install" command. It takes more time to complete the installation and even some of the distributions are broken during installation after 10min time.

Is there any min requirement in-terms of hardware to install the distribution via drush. Or does it require any additional configuration in php.ini or httpd.conf config file.

We already tried to changing the config in php.ini file for the following attributes.

max_execution_time
memory_limit
max_input_time

Regards
Arun


texts: Error when upgrading to Drupal 8.7.1 on module menu_link_content

texts:
When running database updates (on domain.com/update.php) from 8.6.15 to 8.7.1, I got the following error:

module menu_link_content
Update make_menu_link_content_revisionable
Custom menu links have been converted to be revisionable.
Failed: InvalidArgumentException: Placeholders must have a trailing [] if they are to be expanded with an array of values. in Drupal\Core\Database\Connection->expandArguments() (line 735 of /baseserverpath/public_html/web/core/lib/Drupal/Core/Database/Connection.php)

I can see the error "Placeholders must have a trailing [] if they are to be expanded with an array of values" happens on several different occasions in Drupal 8, as there are some different posts on the issue dating back to 2016. But I cannot find it related specifically to module 'menu_link_content'. I wonder if the problem could be related to a special character that cannot be correctly escaped.

The upgrade doesn't work and some other database upgrades get stuck in the queue, since this one for 'menu_link_content' cannot be completed.


texts:
I am Using menu token module to access pages related particular user, I am getting issue while selecting path in token menu using replacement patterns. can any one explains on what basis it will take the link and direct to the page. i tried to use [node:content-type:name], As there are so many content types created in my site, so how it will take the specific content type which is related with the node.

kindly suggest me if there are alternatives for this..


texts:
Goal: For a multiple-value field, display only the first n (e.g. the first 3) field items.

E.g. only the first 3 of 10 images in an image field.

I realize this is possibly by writing a custom field formatter. But I wonder if there is an existing solution available. Also to mix this up with existing formatters.

Hint: I use Display Suite, so solutions which involve that are welcome.


texts: How to Move the Nodes Displaying in the Front Page to Another Page? (e.g. domain.com/articles)

texts:
I've searched almost everywhere and nothing found, so hopefully someone can help me in here!

Okay, I'm using Drupal 7, I installed it and changed the front page to a basic page as I want to have static page displayed rather than list of articles! So this bit is fine and working perfectly, but the problem is how to display a list of my articles on another page, say I'm posting articles regularly and I want to be displayed on the articles section of the website and not on the front page, so how do I do that?

This can be done easily with WordPress 3, but couldn't find a solution for Drupal 7? Anybody have any idea? If you do then please help!

For example http://mydomain.com/articles/ would display a list of my articles, by the way I want each of my articles to be displayed as http://mydomain.com/article/the-article-name

Any idea?

Thanks


texts:
I have a panel page with title set to %node:field_pub_year from substitution list. field_pub_year is a date field which is to select publication year. My problem is this is displaying whole date like '2012-01-01 00:00:00' as title. Is it possible to show only '2012' as title.

Thank you.


texts: Programmatically alter a field collection field item not yet saved in the database

texts:
Updating field collection field item gives error when one item is added.

I have the following code which works well when just changing values of a field already saved in the database but if I add a new field collection item to the node it throws an error (I guess because the value hasn't been saved yet in the database)

  EntityMetadataWrapperException: Unknown data property field_date :

function pdf_app_node_presave($node) {

 $node_wrapper = entity_metadata_wrapper('node', $node);

foreach ($node_wrapper->field_chapitres->value() as $library) {
$library_wrapper = entity_metadata_wrapper('field_collection_item', $library);
 $library_wrapper->field_pdf_title->set('newtitle');
                $library_wrapper->save();
  }
 unset($library);
 }


texts: How to show a link if the user is member of a specific OG group?

texts:
I am not a coder but I'd like to do this line of code:

If the logged in user is a member of the Organic group team1
Then show a Link to node/add/team_1_content with 'Text' = create node
Else show nothing.


texts:
I want join to my select three fc fields:

field_data_field_show_block_carousel
field_data_field_poster_film
field_data_field_film_link

I try this:

$nids = db_select('node', 'n');
  $nids->join(array('field_data_field_show_block_carousel', 'field_data_field_poster_film', 'field_data_field_film_link',), 'fc', 'n.nid = fc.entity_id');
  $nids->fields('fc', array('field_poster_film_fid','field_film_link_url',));
  $nids->fields('n', array('nid', 'title', 'uid',))
    ->condition('n.type', 'vodeo_library')
    ->condition('fc.field_show_block_carousel_value', 1)
    ->execute(); // returns an indexed array
  $result = $nids->execute()->fetchAllAssoc('nid');

but recived sql error? pls tell me what I do wrong?


texts: Is there a clear separation between user data and Drupal data in the database?

texts:
Possible Duplicate:
  Deploying content updates from staging server to live server

I am trying to find a solution to the following scenario:

Let's assume a Drupal site is in production. Users create a lot of content everyday.
In development, additional features (content types and others...) and modules are being added to the site.
Comes the day to move the upgraded site to production.
The upgraded site is out of synch with user data in production.

How does one solves this issue? Is there a clean way to perform this? Should one export 'some' databases tables from current production and import them into the upgraded system? If yes which tables?


texts: I have used feeds xpath parser to import xml file and created nodes from that data.one of the items in the xml is star rating.Example  3 stars .Is it possible to give star rating based on this item.say for example fivestar widget has to show 3 stars in the above scenario.need help on how to go about this.thanks in advance.


texts: Where do I put configuration files for testing?

texts:
Hopefully, this will be a simple question.

I am writing a kernel test for a class, called FooConfig, that reads from a configuration file. For the purpose of facilitating this test, I need a configuration YAML file that exists purely for testing.

So the question is: is it best practice for this configuration file to live under config/install, or should it exist within the /tests directory?


texts: What Drupal setting controls prepending language codes to internal links?

texts:
What Drupal setting controls the prepending of the language code when you hover over an internal link?

For example I have a node with a link to another internal node on it, and the hover link is:

http://localhost/drupal-7.43/fr/linked-page

I ask because I have another Drupal 7 website that doesn't prepend the language code and I'd like to turn it on.


texts: Drupal installation in nginx subdirectory

texts:
I have a new application that will be made of 2 frameworks yii and drupal 7

Yii framework will be in the root (/)

and drupal will be in a sub directory called admin (/admin)

I have a problem how to config it in nginx,drupal doesn't work,it gives me access denied,or just the home page and no link works

This is my configuration file in nginx

server {
        listen 80;
        server_name demo.example.com;
        root /home/www/example;
        index /index.php;

        location / {
                if (!-f $request_filename) {
                        rewrite ^(.*)$ /index.php?q=$1 last;
                        break;
                }
        }
        location /admin {
                root /home/www/example/admin;
                index  index.php index.html;
                try_files $uri $uri/ @rewrite;
        }
        location @rewrite {
                rewrite ^/(.*)$ /admin/index.php?q=$2 last;
        }
        location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
                index /index.php;

        }
         location ~ /\.ht {
                deny  all;
        }

}


texts: How do I filter a views page with contextual filters?

texts:
I have an all events views page where I would like to put the links 'All Events', 'Upcoming Events', 'Past Events' in the header.

I would like to link them to the same views page but show filtered results. It seems possible by looking at contextual filters but not sure which way to go.

Thanks,

Kevin


texts: Where shall I place "PHP SAML" library so that SAML Authentication module could find it?

texts:
I have a multisite Drupal 7 installation (not using Composer), and I can't figure out where shall I place "PHP SAML" library so that the SAML Authentication module would find it.
The instructions within the module simply say to install OneLogin's SAML PHP module (and the only provided instructions set uses Composer). The Libraries API module is installed, but wherever sites/domainname/libraries I try to place the content of the cloned https://github.com/onelogin/php-saml.git, the SAML Authentication module still says the "PHP SAML" isn't installed.
How and where do I place the right files in absence of Composer?


texts: How to programmatically change a Views page's html  separately to its on-page title?

texts:
Similar to Views: how to programmatically change Views title?, I want to update the title of a Views page using logic/data only possible in PHP.

However, I want this to update only the appropriate
 part of the <title> of the HTML  without  mirroring the change in the displayed title in the 's
.

To illustrate, imagine a view with some exposed filters that are used for navigating a product catalogue. Currently, every filtering of this page has the same titles:

<title>Products | My site name</title>
...

Products

I've written some code requiring access to $view->exposed_input that generates an appropriate string based on exposed filter choices (for example, "red, low cost, good condition"), similar to Using exposed filters as part of the rendered page's title. I want these in the html head title, so each navigable URL has a unique title with appropriate keywords for the content. I don't want them in the
, however, because they're already clearly visible in the exposed filter page UI and I don't want to duplicate the information. I want it to look like this:

<title>Products: red, low cost, good condition | My site name</title>
...

Products

Things I've tried:

Everything on that linked question applies to both the head and body titles

<title>Products: red, low cost, good condition | My site name</title>
...

Products: red, low cost, good condition

drupal_set_title() doesn't work at all from any of the Views hooks I've tried, presumably because the view overrides this further down the line. I've tried:

hook_preprocess_views_view
hook_views_pre_render
hook_views_post_render

Setting $vars['head_title'] in hook_preprocess_views_view also doesn't work, presumably for the same reason: Views overrides this.

Someone commenting on the hook_views_post_render API page with the exact same problem as me 3 years ago reports that it still doesn't work if you pass the variable to through to hook_preprocess_html and apply it to $vars['head_title'] from there


texts: How can I use range filters for strings?

texts:
I have created a view in Drupal 7 in which the dates are in text format, eg 2020-10-12 and I want to filter date ranges using between or >= and < but there doesn't seem to be such an option for strings.
eg. If I want to filter for the months of September and October the filter would be >= 2020-09-01 and <=2020-10-31
Am I missing something or are range filters for strings not supported out of the box in Views?


texts: Moving a Drupal installation to a subdirectory

texts:
Ok, I've got a Drupal install with a lot of links inside various nodes. All of these links are relative.

The problem is that if they're going to say, an image or a pdf in the /sites/default/files directory, they stop working.

Let me give an example:

There is a link in a node like this:

/sites/default/files/image1.png

www.livesite.com/sites/default/files/image1.png works

www.domain.com/devsite/sites/default/files/image1.png does not work

How do I (easily) switch the links to work in such a way? Do I have to do an .htaccess edit, or is there something in the Drupal settings for this? This is for Drupal 7