texts: Create jump menu with more options using programmatically

texts:
I am using Drupal 7 and CTools. I want to create a jump menu using Ctools. I have checked the example code provided in the Ctools module. And it is working fine for one link only.

How do I add more links in Jump menu:

In the code shown below, look at here: $url = url('mypostings/groupsort'); I want to add more links in the jump menu,like url('mypostings/test1'), url('mypostings/test2') etc..

/**
 * Implementation of hook_menu();
 * @return
 */
function post_display_menu() {
    $items['mypostings'] = array(
            'title' => 'My Posts in Group',
            'page callback' => 'get_my_postings',
            'access callback' => TRUE,
            'expanded' => TRUE,
    );
    $items['mypostings/groupsort'] = array(
            'title' => 'My Postings Filter',
            'page callback' => 'get_my_posting_filter',
            'access arguments' => array('access simple page'),
    );
    return $items;
}

function get_my_postings() {
    global $user;
    // Include the CTools tools that we need.
    ctools_include('ajax');
    ctools_include('modal');
    // Add CTools' javascript to the page.
    ctools_modal_add_js();
    $header = array(
            array('data' => t('Title'), 'field' => 'n.title'),
            array('data' => t('Created'), 'field' => 'n.created'),
            array('data' => t('Author'), 'field' => 'u.name'),
    );
    $query = db_select('node', 'n');
    $query->leftjoin('users', 'u', 'u.uid = n.uid');
    $query->fields('n',array('title', 'created'))
    ->fields('u',array('name'))
    ->groupBy('n.nid');
    $result = $query->execute();
    $rows = array();
    foreach ($result as $row) {
        $rows[] = array('data' => (array) $row);
    }
    $build['tablesort_table'] = array(
            '#theme' => 'table',
            '#header' => $header,
            '#rows' => $rows,
    );

    drupal_add_js($sample_style, 'setting');

    ctools_add_js('ctools-ajax-sample', 'ctools_ajax_sample');
    ctools_add_css('ctools-ajax-sample', 'ctools_ajax_sample');

    $output .= $build;

    // Create a jump menu
    ctools_include('jump-menu');
    $form = drupal_get_form('post_filter_jump_menu_form');
    $output .= '<h3>'. t('Jump Menu') .'</h3>';
    $output .= drupal_render($form);

    return array('markup' => array('#markup' => $output));
    return $build;
}

/**
 * Helper function to provide a sample jump menu form
 */
function ctools_ajax_sample_jump_menu_form() {
    $url = url('mypostings/groupsort'); // I want to add 3 links in jump menu How can i add it
    $form_state = array();
    $form = ctools_jump_menu(array(), $form_state, array($url => t('Sort')), array());
    return $form;
}


texts:
Drupal 7, Views 3, etc.

I'd like to use Views' grouping feature to group results hierarchically. I added the two fields I want to group with to the grouping list. I'd like to group by year, then by term. Here's the output I get now:

2011

Term 1

Result 1
Result 2

2011

Term 2

Result 3
Result 4

2012

Term 3

Result 5
Result 6

2012

Term 4

Result 7
Result 8

... and so on.

Here's what I want to see:

2011

Term 1

Result 1
Result 2

Term 2

Result 3
Result 4

2012

Term 3

Result 5
Result 6

Term 4

Result 7
Result 8

I thought that by using the "Use rendered output to group rows" checkbox, it would cause Views to ignore differences in the contents of the actual date field (which is more granular than just the displayed year) and only sort by year. Am I misunderstanding this checkbox, or is there something preventing it from working properly?


texts:
what tables related to drupal cache can be safely delete using SQL and how to be sure to empty it entirely?

It seems i have reminiscence of ancien block configuration when i empty cache using back office or drush cr


texts: How to list nodes in a view as checkboxes?

texts: For my drupal 8 website I need to create a view page with nodes of particular content type. I need to dispaly them as a list of checkboxes, and further implement a PDF manual, composed out of the "checked" nodes. Is it possible to implement it using standard Drupal tools?


texts: Importing data using Feeds into dropdowns/select lists/taxonomy terms

texts:
I'm importing a set of users into my website using the Feeds module. The users have various details including company name. I wanted to make the company name field on the website a dropdown list rather than a free text field. I was thinking to make the company field a taxonomy vocabulary, and then add a taxonomy term reference field to the user profile. If I did this how would I import the company data for the user profiles using feeds?

For example if Mark Twain works at Penguin how do I import correctly his company into his record?

Would it be possible to create a new field in my CSV file for the company term ID and then import this into the term reference field in the user profile?

I'm using D7 with the custom user fields and not the old D6 user profile module.


texts: Where to start with creating the theme for selling?

texts:
I have the task to create the Drupal theme from the existing Wordpress theme that will be sold on ThemeForest.

This is the first time that I'm doing something like this, up until now I was doing the themes for concrete clients according to PSD files, but I think that I need different approach for this.

Until now I usually did the themes as Omega sub-theme, can I create the Omega 4 sub-theme in this case? Can I use base theme at all or I must create theme from scratch?

I noticed that a lot of themes are based on Bootstrap, is that maybe the best way for creating the theme or you suggest some other way (I know this is maybe the question for opinion but I'm looking for the simplest way for creating the theme and Bootstrap is maybe one of the most complicated ways, so because of that I need your opinion and suggestion).

It would be really helpful if you could direct me to some page or tutorial where I can find more information and choose the way in which I will create this theme.


texts: How to programmatically modify an exposed filter?

texts:
I have an exposed filter on the Title field for my content type; i would like to use the same filter for applying the following condition: select all where (field_value) like %node.Title% OR %author.Title% where Author is a term reference to an Author vocabulary.
I've tried to do this but i wasn't able to solve it.
How can i do it? Have tried using views_query_alter but without success.


texts: Access Denied error on editing any profile?

texts:
I can't edit any profile from my admin account on Drupal, it says (Access Denied)
An other thing, any user can't edit their profile, same message (Access Denied)

How can I solv it?
I've enabled all permission..


texts: What is the best way to use Panels with the Omega theme?

texts:
I am new to drupal 7 so I have some questions about Omega theme.

I've installed Panels/Views and Omega Theme. Using the omega-tools I created a subtheme. How can I use the panels with the omega theme? I see there are two conflicting methodologies here. Is there any tutorial that can help me understand ?


texts: Adding an 'Add more' button to a settings form in the backend

texts:
For my module I need a settings form where administrators should be able to enter an arbitrary number of variables.

I have tried setting up an AJAX 'Add more' button, analogous to the example found in the AJAX example module. When I click the button, it doesnt add an extra field and I don't get any errors.

Can anyone help me out?

Example code, and my code: https://gist.github.com/Tagini/8282034


texts: Form returned from AJAX callback missing JS and CSS

texts:
I have a form set up like this:

function mymodule_form_{my_form_id}_alter(&$form, &$form_state, $form_id) {
    $form['actions']['submit'] = array(
        '#type' => 'submit',
        '#value' => 'Save',
        '#ajax' => array(
            'wrapper' => 'ajax-node',
            'method' => 'replace',
            'callback' => 'mymodule_callback',
            'effect' => 'fade'
        ),
        '#submit' => array('node_form_submit'),
    );
}

And then the callback:

function ajax_complaint_save_callback($form, &$form_state) {
    $nid = $form_state['build_info']['args'][0]->nid;
    $node = node_load($nid);

    return drupal_render(node_view($node));
}

Now this does work sort of, but the node is not rendered correctly. I have some more AJAX stuff on the same page which uses the ajax links api and that produces the node forms correctly. Here are some pictures to demonstrate.

In this picture, one of the links in the table was clicked and the stuff circled with blue was loaded using the links api - this is how it should look.

But if go to the edit tab on the loaded node (which is also loaded up through the ajax links api) then press the save button, I get this:

There's more to this picture, but this is loaded in the same div as the other stuff was - but it seems like it is missing style information, and also the view/edit tabs are missing.

How do I make it load up the node form properly?


texts:
I'm using Drupal 7 and I have some PHP pages that depends on my Drupal site.
In the PHP page, I tried to add a user programmatically in order the check the exception:

try {
  $new_user = array(
    'name' => 'user'
  );
  user_save('', $new_user);
} catch (Exception $e) {
  echo $e->getMessage();
}

I didn't give all the required field, like email and some custom fields that I set in Home » Administration » Configuration » People » Account settings, but Drupal still added this user.

I need the following:

Get all user field(s) and check if they are required or not
Get error on exception when I'm trying to add user without required fields

How should I do that?


texts: How to "flag" product that had already been purchased before "flaging feature" was added?

texts:
In reference to this question and answer: How to mark product if it has already been purchased by current user?

Now that I know how to "flag" the items in a way that lets me notify customer to avoid situation where customer buys two of the same product, remains one more question:
How can I now mark or "flag" all the products, that had already been purchased before the flaging feature was added to the shop?


texts: How to use one of the 2 context filters in a view (with an OR)?

texts:
I have a view with 2 relations with the store for 2 different entities.
I want to filter the view with the store id for the 2 relationships.
I created 2 context filters in the views. You must use the first context filter OR the second.
How to do this ? If 2 filters are added, there are no results


texts: My Custom drupal 8 module does not shown in modules list

texts:
I'm developing my first drupal 8 module, a custom migration module, the info.yml file is written as follow :

name : Drupal Center Custom Migrate
description : This module provides custom migration configuration and plugins to migrate my custom site from drupal 6.
type : module
core : 8.x

package : Custom migrate
dependencies :
  - migrate
  - migrate_plus
  - migrate_tools
  - migrate_upgrade
  - migrate_drupal

The above code is saved as dc_custom_migrate.info.yml . This module also provides some config migration file and some custom source plugins.

The problem is my custom module is not shown up in modules list.

I can't figure it up where am I doing wrong!!!

PS. I'm developing in windows 10 environment and using Aquia Dev Desktop 2 as web service simulator.


texts: How to save the URL of anonymous user on a webform?

texts:
Using Webform 7.x-3.18, I'd like to save the referring URL of an anonymous visitor on a webform. I added some code to MYTHEME__preprocess_page() in template.php to save the info as a cookie:
user_cookie_save(array('webform_referrer' => $_SERVER['HTTP_REFERER']));

On my webform I added a hidden component, with a default value of %cookie[Drupal_visitor_webform_referrer].

I'm testing with safari/chrome/ff on a Mac and on Windows. I can get this to work on my local testserver, but only about 10% of the time on the production server, and never from Windows to the production server. The production server has hardware load balancing. I'm suspecting this is a caching issue. I've also read that server vars may not be available as webform default values for anon users (http://drupal.org/node/296453#comment-2397674) - is this the issue? Why then would it be working for anon users coming to my local server?

I can't think of another way to integrate this easily into webform as a hidden field. Perhaps I have to write some kind of custom hander to save the referrer?


texts:
I am using https://www.drupal.org/project/webform_ajax for Drupal 7. I have a webform that is being submitted using ajax with the module above. heres what the form looks like:

however, if i submit the form without completing the required fields, the form itself seems to have some sort of graphics glitch (notice the black line at the bottom).


texts:
How can I print the rendered values of an entity reference field into node.tpl.php?

I have an entity reference field called Instructors which references users.  Using Devel I can find the target_id of entity reference items, but I can't for the life of me figure out how to render these ids.


texts: How can I group items by taxonomy within another taxonomy grouping?

texts:
I have content items that are tagged with multiple taxonomies. I would like to group the items first by taxonomy 'Site Section' then within that grouping by a second taxonomy 'Program Category'. I have added two relationships 'Content: Taxonomy terms on node' for each taxonomy but can not get the second grouping to display correctly. How can I group within a separate taxonomy grouping?
Example:
College of Arts & Sciences (Site Section term)
Arts (Program Category term)

Art (Site Section Taxonomy: College of Arts and Program Category Taxonomy: Arts)
Architecture (Site Section Taxonomy: College of Arts and Program Category Taxonomy: Arts)
Design (Site Section Taxonomy: College of Arts and Program Category Taxonomy: Arts)

    Natural Sciences

Biology (Site Section Taxonomy: College of Arts and Program Category Taxonomy: Natural Sciences)
Chemistry (Site Section Taxonomy: College of Arts and Program Category Taxonomy: Natural Sciences)


texts: How to gets analyts and generate visual reports from sessions?

texts:
I'm looking for a technique or approach to get data from user session logs and convert it to a some sort of visual style (bars/charts/whatever).

We'd like to specifically have the users session "arcs" (login->news->something->logout) displayed in a way that makes it easier to analyze the way people use the site.

This is meant for our service as a usability analyser with the idea that we could make out and see the UX/UI problems that users experience, just from the statistics.

Google Analytics and Piwik are cool and have some of the same functionality but we're looking to go a bit further...

Any ideas on how to get started? Also if I missed an obvious way of doing this, feel free to point out!


texts: What alternatives do I have to use the Computed Field module?

texts: I am currently using the Computed Field module to calculate field in Field Collection and use PHP code to generate the formula. The problem is that the user does not enough PHP skill to write that PHP code. So are there any alternatives that allow users to choose which fields and calculations instead of using PHP code?


texts: 7 Can't Makes changes to Views Variable Array

texts:
I'm attempting to change the values and add an additional array with some stripped down data to the Drupal views variables.

I've referenced the function in my template.php file, I am checking the  results through     <?php kpr( $variables ); ?> in views-view.tpl.php

The prog_search_vars array is not be created and the value for  theme_hook_suggestions is not being changed either.
Is there something I'm missing?

function views_vars(&$variables)
    {
        $view = $variables['view'];

        /* Applies only to my view */
        if($view->name == "myviewname")

        {

            /* Get data from views variables and strip down to string */
            $title = strip_tags($variables['fields']['title']->content);
            /* add data to array */
            $prog_search_vars['post_title'] = $title;

            $prgm_country = strip_tags( $variables['fields']['country']->content);
            $prog_search_vars['prgm_search_prgm_country'] = $prgm_country;

    /*Change existing key value */

            $variables['theme_hook_suggestions'][]='mytestvalue';

           /*Add my array */
            $variables['prog_search_vars'] = $prog_search_vars;

         };

     }

?>


texts:
I am using the Lightbox2 module in Views to make a image larger on click. This works great, but I also want to show a preview of the image on mouse_over. I also use hover_preview module, but I can't seem to use both module with a single view.

Here's a example of what I want:http://gochicorgohome.com/shop/15975,242,49668 (this link is ironic because its Hover_Preview module's example and shows what Lightbox does as well).

So   How do I get/find a module that will enlarge image on click AND preview and image on mouse_over like link above.

EDIT. I am using the REWRITE OUTPUT option in order for my image view to show the lightbox formatter effect.

UPDATE:
Ok I figured it out: Rewrite   However this outputs two images, no link, and "> after the image. I'm guessing my syntax is wrong?


texts:
I have a content type called Task, where I add tasks. After task being completed, I would like the node author to rate his satisfaction using Fivestar field.

While viewing the node (not in edit mode), how to enable voting on this satisfaction rating field by node author only on his task but others can't vote, they can see his/her vote.


texts: Make a div clickable using a render array

texts:
What is the (best) way to make a div clickable using a render array in code?

I am creating a module that outputs a title in a rounded box, so I use the markup type and specify a class with #prefix and #suffix and apply some css on that class. This gets me a box, but I want to make the box clickable with a different url for each box. What would be a good way to do this?

I could put an onclick in the prefix or put  in the prefix and  in the suffix. But both are not very pretty.

I'm using Drupal 7 and would like not to use additional modules like views.


texts: Why is my theme's block preprocess function not reordering elements?

texts:
I'm trying to do something that seems fairly basic, but I'm having loads of trouble.

The drupal search_form block outputs an input field and a submit button, in that order.  I'd like to swap the order of those fields.  I'm using theme_preprocess_search_block_form to attempt to reverse the order.  This is my current function:

function mytheme_preprocess_search_block_form(&$data)
{

    $data['form']['search_block_form']['#attributes']['placeholder'] = 'Search ...';
    $data['form'] = array_reverse($data['form']);
    foreach(element_children($data['form']) as $k) {
        if(!empty($data['form'][$k]['#weight'])) {
            $data['form'][$k]['#weight'] *= -1;
        }
    }

    $data['form']['#sorted'] = FALSE;
}

This function does get called, since a var_dump will output to the browser, however, the changes don't make it to the front end. So, what is unchanging my changes?


texts: How to hide label in customized contact form?

texts:
I added a field 'Contact_Catégorie (system name: field_contact_categorie)' to the default 'feedback' contact form.

The field type is List (Text) in which I store a set of "email address | label" in order to redirect the email to the proper recipient depending on the item selected in the list.
That works well!

My issue is about the form display: whatever I choose for the label (Above, On the same line, Hidden, not displayed), the label (Contact_Catégorie) appears in the form.

Any idea?


texts: How do I change the content text programmatically?

texts:
I have enabled the anonymous comment setting. And its E-mail form appears as shown below.

Now, I want to change the text "The content of this field is kept private and will not be shown publicly." to "E-mail address will not be shown publicly."

How can I change this programmatically.

For information the HTML part I have copied through fire-bug which is as below.

     E-mail *
     <input id="edit-mail" name="mail" value="" size="30" maxlength="64" class="form-text required" type="text">

The content of this field is kept private and will not be shown publicly.


texts:
I have an AJAX call that binds to the window popstate event.  It works, except that I'm parsing the arguments from the querystring.  The problem is the ajax call is bound to the window when the page loads, so my arguments don't change when the url does.  I'm thinking if I add a listener to the window, if I could just execute the ajax call rather than binding it, it would reparse the querystring each time.

for example if the page loads domain.com?x=1&y=2 then my call sends x=1 and y=2.  But when the popstate fires and it becomes domain.com?x=1&y=2&z=3 it still sends x=1 and y=2.

here is my call

var ajax_path = Drupal.settings.views.ajax_path;
$.each(Drupal.settings.views.ajaxViews, function (i, settings) {
    var view = '.facetapi-facetapi-links';
    element_settings = {
        url: ajax_path,
        submit: settings,
        setClick: false,
        event: 'popstate',
        selector: view,
        progress: { type: 'throbber' }
    };
    var viewData = {};
    $.extend(
        viewData,
        settings,
        Drupal.Views.parseQueryString(document.URL),
        Drupal.Views.parseViewArgs(document.URL, settings.view_base_path)
    );
    $.extend(viewData, Drupal.Views.parseViewArgs(document.URL, settings.view_base_path));
    element_settings.submit = viewData;
    var ajax = new Drupal.ajax(false, window, element_settings);
});

what I was thinking was doing something this, but I'm not sure how.  Or is it possible to use Drupal.ajax.prototype.beforeSend somehow?

window.addEventListener("popstate", function(e) {
    //execute ajax here so it reparses document.url
}

----------------------EDIT----------------------

I came up with this solution, but maybe someone has something cleaner?  I'm using a custom event, so that I can trigger the event manually, but I have to unbind and bind the new call everytime, this can't be the cleanest way

window.addEventListener("popstate", function(e) {
    $(window).unbind('custom');
    $.each(Drupal.settings.views.ajaxViews, function (i, settings) {
        element_settings = {
            url: Drupal.settings.views.ajax_path,
            submit: settings,
            setClick: false,
            event: 'custom',
            selector: '.facetapi-facetapi-links',
            progress: { type: 'throbber' }
        };

        var viewData = {};
        $.extend(
            viewData,
            settings,
            Drupal.Views.parseQueryString(document.URL),
            // Extract argument data from the URL.
            Drupal.Views.parseViewArgs(document.URL, settings.view_base_path)
        );

        $.extend(viewData, Drupal.Views.parseViewArgs(document.URL, settings.view_base_path));

        element_settings.submit = viewData;

        var ajax = new Drupal.ajax(false, window, element_settings);
        console.log(element_settings);
    });
    $(window).trigger('custom');
});


texts:
How do I determine the individual field type using an EntityFieldQuery?

Here is the sample code for extracting the fields of a content type named 'digital_iq_test_2012', which contains many fields. How do I determine the type of each field?

$query = new EntityFieldQuery;
$query->entityCondition('entity_type', 'node')
  ->entityCondition('bundle', 'digital_iq_test_2012')
  ->propertyCondition('status', 1);
$result = $query->execute();

Any help?


texts: Using tokens or variables in Views "No Result Text" field

texts:
How can I include a variable or token as a replacement in views "No Results Text"?

I would like to have information from the currently logged in users account populate this section when it would have otherwise been empty.

I would also like to access the second argument passed in the URL as replacement text.

example/values/passed/to/views

How can I use arg(2) as replacement text in views?

Here is how I'm hoping to use the UID:


texts:
I've got the following task:
i have a site which should be used as a kind of team calendar. there are lots of people in different roles (moderator, member) and moderators can create events (in my case ordinary nodes with time field) and members can now leave comments. there is not much more functionallity behind it, so no subscription, ... for events.

the problem i'm facing right now is the creation of events. normal events which occur once in a time are no problem, but there are much events that happen in a periodic time interval, e.g. every week.

so i need a possibility to create such a series but have them all as seperate nodes, to be able to edit individual dates. think about this scenario: the regular meeting x is scheduled every sunday from 10:00 to 12:00, but somehow it need to be changed in week 23 from 11:00 to 13:00.

is there a module for that?


texts: How to get the product id on hook form alter

texts: I am currently working on drupal 8 commerce. I need to form alter some of the expose fields but need to get the product id first so I can get my condition on the product fields. I used this kint($form_state) on my form alter to show the attached image. But when I try use this $form['storage'] im having wsod. Thanks


texts: How to customize the admin toolbar in Drupal 7?

texts:
I'm trying to customize the administration toolbar in Drupal 7 but I don't know how to do it.
I'd like to add custom links (e.g node/add/[content-type]) and links that are only available for specific users.

[Edit] Finally, I used admin_menu module and I added a menu item with a custom module using hook_admin_menu_output_alter


texts: Views Group By with profile with aggregation and relationship

texts:
I am looking for solution for following problem.

Problem:

I have "article" content type.
I have list of some users who are associated with different - 2 roles.

User having role "editor" can create articles. So editors type of user have created number of contents.

Now I need to display a list of featured articles on home page using Views-block with given conditions.

Every author who have created most articles, his block should come in top of list with his recent one article.
It should be followed by author name.
I will show top 10 articles of different - 2 authors with correct author ordering. I mean  author who have created most articles should come on top followed by rest of authors.

Note: In this block one author should come once with correct order.

Resolution:

I created views block with filter criteria where content type =
'article'.
I enabled aggregation.
I make relationship with User and in fields choose COUNT(DISTINCT
Content: Title) | Aggregation settings option.
I choose Query settings: Distinct.

I tried above possible solution but unable to get correct result. I am still getting duplicate result and also the order is not correct.


texts: Trigger custom code on existing Webform Submissions

texts:
I have created a custom Webform handler which submits the Webform data to an external webservice via SOAP. All is working but now I need to submit (to the same external web service) all the older Webform submissions that were received before I enabled my custom handler.

My current custom handler has my custom SOAP code wrapped in the function

public function preSave(WebformSubmissionInterface $webform_submission)

(I'm using the preSave function as the Webform is a multipage form.)

I was just wondering what function I should use to run the same SOAP code on existing submissions?

As I know the range of submission ID's that are affected, is there code that can loop through the submissions and trigger the code based on the Submission ID?

Or alternatively, as there only about 20 of the older submissions, I could open and save each one to trigger a Handler based on submission update - in which case, what is the function call I need to wrap my SOAP code in the custom handler?

Thanks

F


texts:
i want a vitual field for print value of sum in another entity :

My 2 custom entity content :

  commandes_entity

  commandesLignes_entity reference to commandes_entity

In the commandes_entity i have a view table who liste all my lines.
i want to add a custom column who sum all the children in commandesLignes_entity.

For that i make a field in .module :

function hook_views_data()
{

  $data['commandes_entity'] = array(

      'totalCommandeTTC' => array(
          'title' => t('Total Commande TTC'),
          'help' => t("Le total des commandes"),
          'field' => array(
              'id' => 'machine_name',
              'options callback' => 'Drupal\boutique\Controller\TestController::content',

          ),

          'sort' => array(
              'id' => 'standard',
          ),

      ),

  );

return $data;
}

This field is in my select field view, when i add it all is ok except one thing :

  SQLSTATE[42S22]: Column not found: 1054 Unknown column
  'commandes_entity.totalCommandeTTC' in 'field list': SELECT
  commandes_entity.totalCommandeTTC AS
  commandes_entity_totalcommandettc, commandes_entity.id AS id FROM
  {commandes_entity} commandes_entity WHERE (( (commandes_entity.statut
  LIKE :db_condition_placeholder_0 ESCAPE '\') )) ORDER BY
  commandes_entity.created DESC LIMIT 21 OFFSET 0; Array (
  [:db_condition_placeholder_0] => payer )

This field

  totalCommandeTTC

doesn't exist in my table, i want it virtual.

For now my callback just return 'test'.

Any idea for make this field really virtual ?

I try to move it to views group like this :

function boutique_views_data()
{

  $data['views'] = array(

      'totalCommandeTTC' => array(
          'title' => t('Total Commande TTC'),
          'help' => t("Le total des commandes"),
          'field' => array(
              'id' => 'machine_name',
              'options callback' => 'Drupal\boutique\Controller\TestController::content',

          ),

          'sort' => array(
              'id' => 'standard',
          ),

      ),

  );

return $data;
}

The field is in the Global group but SQL still try to get it into the commandes_entity table.


texts: Recaptcha not working in user register form

texts:
I am using google recaptcha in drupal 7 for user registration. The captcha works fine in the normal user register page but doesn't appear in the pop up dialog box for user registration?

some more info:

i created the pop register form using ajax
i checked the css of the site and the <div> of the captcha is present but doesn't have any content inside it like when it does when it is working.


texts: Custom module integration with Views3 for D7?

texts:
I have a custom module named ta_module which alters the user registration form.
But since I updated Views to version 7.x-3.0 - rc1, I have like a hundred errors barely the same as the following :

Warning: include_once(/{PRIVATE - DRUPAL ROOT FOLDER}/sites/all/modules/ta_module/views/theme/theme.inc) [function.include-once]: failed to open stream: No such file or directory in _theme_process_registry() (line 413 of /{PRIVATE - DRUPAL ROOT FOLDER}/includes/theme.inc).

Warning: include_once() [function.include]: Failed opening '/{PRIVATE - DRUPAL ROOT FOLDER}/sites/all/modules/ta_module/views/theme/theme.inc' for inclusion (include_path='.:/usr/local/lib/php') in _theme_process_registry() (line 413 of /{PRIVATE - DRUPAL ROOT FOLDER}/includes/theme.inc).

It seems like I need to create a /views/theme/theme.inc in my custom module folder. BUT TWO QUESTIONS REMAIN :

- Do I leave this file blank or am I supposed to put things in it ?

- Do I have to create other folders/files for Views not to interfere with my module ?

Thks for reading !  ;)


texts:
Can I modify core/image twig template only for specified entity.field?

I want to modify img tag output only for commerce_product.images custom field
but there is only 1 suggestion themes/bootstrap/templates/system/image.html.twig which override all image uses.

EDIT1:
if i'm implement hook_theme_suggestions_HOOK_alterm there is no entity or field info:

function mytheme_theme_suggestions_image_alter(array &$suggestions, array $variables) {
  $entity = $variables['item']->getEntity(); //ERROR
}


texts:
I want to add a block like message board/chatbox in my taxonomy pages.

Best and simple way to do it is comments.

Is there any way to use comments for taxonomy pages?


texts: ajax_deliver returns json instead of content

texts:
I have a panel with two columns. In the left is a views with teasers, in the right the full body text of a node.
If you click on a link in the views the content in the right panel should be replaced with the body text (and images).
Here the code of the module:

<?php
function customNews_menu() {
        $items['customNews/%/%node'] = array(
                'access arguments' => array('access content'),
                'page callback' => 'customNews_ajax_callback',
                'access callback' => 'user_access',
                'page arguments' => array(1,2),
                'type' => MENU_CALLBACK,
        );
        return $items;
}

function customNews_ajax_callback($js, $node) {
    if ($js == 'nojs') {
        drupal_goto('node/' . $node->nid);
    }
        $div_id = 'customNewsContent';
        $vnode = node_view($node);
        $vnode['is_ajax'] = true;
        $output = '
'.theme("node", $vnode).'
';
        $commands = array();
        $commands[] = ajax_command_replace('#'.$div_id, $output);
        $page = array('#type' => 'ajax', '#commands' => $commands);
        ajax_deliver($page);
}
?>

When I run it I get the following back in the browser:

[{"command":"settings","settings":{"basePath":"\/drupal\/","pathPrefix":"","ajaxPageState":{"theme":"seeleben","theme_token":"wdFHgqik_Sx4kvKrKXtT9tAndWxYgNr2-cO6lfT09gg"},"colorbox":{"opacity":"0.85","current":"{current} of {total}","previous":"\u00ab Prev","next":"Next \u00bb","close":"Schlie\u00dfen","maxWidth":"98%","maxHeight":"98%","fixed":true,"mobiledetect":true,"mobiledevicewidth":"480px"}},"merge":true},.........

What do I do wrong?


texts:
I'm working on entity form using the module "eform" in D8.

I would like it to send email when the user submits a form. It was done using some other modules rules and entity rules, but since "entity rules" is not released yet in D8, I couldn't find a way to send submission email.
Is there any module to make it possible or should I create a custom module to do that?


texts: I want to set up a view with a contextual filter that will work with any term id (without selecting a specific category). I could only find some old, dated mentions of this. So I'm not sure if this is really possible currently or not.


texts: modifying option text in ubercart attributes

texts: I am made an attribute with mulitple options on my Ubercart Product. I made an adjustment to the price of some of the options ie: -38 (its 38 less dollars) but now on the dropdown, it has the option name followed by ', -$38.00). How can I get rid of this text?


texts: How to implement membership subscriptions in Drupal site that is not product based?

texts:
I want to add "an option to become a member for a certain period of time" (for short "membership subscriptions") to my Drupal site, but I wonder how to do so.

I already used Recurring Subscriptions, which is working fine. But the problem (objection) I have with this solution is that it's based on the product you have purchased (which will then confirm your membership).

So I'm looking for a way to implement memberships subscriptions in a Drupal website that is not product based.

Any suggestions?


texts: How to get commerce product variation presave in drupal 7?

texts: I need insert data when product variations of node is updated , i tried hook_entity_update() and others but they didn't help to reach my aim.


texts: Multiple Date field with term attached to each instance

texts:
I have a need to build a "Project" content type that has a multiple date field. This date field will be used to mark particular "Milestones" within a project. I am attempting to attache a small text field or term to each instance of the multiple date field so I can plot each date on a calendar with description.

Is there a combination of modules I can achieve this with? I was reading about Field API but was hoping there was an alternative way.

Any help is much appreciated.


texts: Does Drupal strip out style and span tags?

texts:
I was trying use span and style tags in pages, rather than in CSS and it seems that Drupal is configured to strip them out whether the input format is Filtered HTML, i.e. they are applied to Full HTML.

Is that something which can be fixed only by editing the core files, or are the some modules or settings in Drupal's admin settings that can override that?


texts: How to pass Get parameter to url when url has "?" mark

texts:
In my site clean urls is not working. As a result ?q is getting appended to the url.

My site url is http://abc.com/?q=user

I wrote a form in a page, and redirect to another view which is http://abc.com/?q=listings.

When I click on submit button in form page GET parameter are not getting appended correctly:
They are getting appended as http://abc.com/?field_list=3 which has to be like this http://abc.com/?q=listings&field_list=3.
I must use GET method in the form.

How should I redirect to URLs that contains "?q="?

How to do this.


texts: Drupal 7: Help me to wrap my head around EVA/reverse node reference

texts:
What I wanna do shoult be quite easy but but till now I've been without luck. I've read different approaches but none of them worked for me.

Setting: Drupal7/Views 3.6/References/EVA

We have 2 node types:
"article" (e. g. "How to sleep better" and "What your dreams mean")
"theme week" (e. g. "Sleep")

"theme week" has a node relationship field which points to the "article" node type (i. e. theme week "Sleep" has references to "How to sleep better" and "What your dreams mean").

Now I want to show that referenced articles in my "theme week" node which reffers them. I use EVA to attach a view to my "theme week" node.

Problem: I can't get to set up the view properly; my guess is that I'd use a reverse relationship to my reffering node "theme week", but till now I haven't been lucky with that.

Any advices (step-by-step) would be highly appreciated! Do I have to set up a contextual filter as well? Which fields/filters must use the relationship?

Thanks in advance to everyone
sp


texts: How do I implement a block suggesting other relevant content?

texts: I want to put a block in the left column on my products page, to suggest similar products. Can I do this with a block based on the "search API" module? Does this module allow to propose products in a block, similar to the viewed page?


texts:
I have two select form fields on a webform. The first 'country' is a list of country codes / country names and the second 'recipient' is a hidden field which contains county codes and email recipients.

GB|United Kingdom
US|United States

GB|gb-address@example.com
US|us-address@example.com

I may have several countries with the same email recipient (hence having to use two lists and not just one mapping recipient|country). I would like to set the value for the second field based on the value of the first upon submitting the form. I have tried a few times with no success.

So far, my code is as follows:

function my_enquiry_form_form_alter(&$form, &$form_state, $form_id) {
  if($form_id == 'webform_client_form_11566') {

    $form_state['my_recipients'] = $form['submitted']['recipient']['#options'];
    $form['submitted']['recipient']['#access'] = FALSE;

    $form['#submit'][] = 'my_enquiry_form_form_submit';
  }
}

function my_enquiry_form_form_submit($form, &$form_state) {
  // ## some code removed ##
  $formRecipient = 'test-email@domain.com';

  // Update the recipient value
  $form['submitted']['recipient']['#value'] = $formRecipient;

  $form_state['values']['submitted'][5] = $formRecipient;
  $form_state['values']['submitted_tree']['recipient'] = $formRecipient;

  $form_state['complete form']['submitted']['recipient']['#value'] = $formRecipient;

  form_set_value($form['submitted']['recipient'],array('und' => array(0 => array('value' => $formRecipient))),$form_state);
}


texts:
Im trying to make it that each OG has its own URL eg. www.group1.com, www.group2.co.uk etc There was a module to do this apparently but not for D7. You'd think it streight foreward but it isnt. Probably due to path module. Everything I try gives me permission errors. Im using D7 and Cpanel. Any help would be really appreciated.
Thanks
Steve


texts:
I hope this question is neither a clone nor a stupid one, but I need to fix/understand this very quickly, I did some research though.

Coming to my problem:
I am building a no-profit website and we do require a small fee for the participants.
So I am using Ubercart to allow people to buy the "Participant" role.

I set everything up and also the payment system works properly.
My problem is the expiration. In the product I set the expiration to 1 year, but when a user registers no expiration is set.
When I go to People -> Role expiration, the table is empty saying "No expirations set to occur".

I followed some tutorials on-line and I believe I did everything right, can you guys help me with this?

I also think I properly set the permission, even though I have some doubts about.

Thank you,
guidout


texts: The most searched keyword of the default search?

texts: Is there a way, or a module, to get the most searched keyword of the site's default search?


texts: How do I access the nid of the current node in a field.html.twig template?


texts: refrencing node in another content type based on his two fields

texts:
i am working on a medical site. i have 3 content type drug, pharmacy, drug price.

to enter the price of a drug for a pharmacy i use drug price content type

here i take a reference of drug content type for drug name and it is working fine and populate nodes  title of drug type

and after that i want to add this price of drug to any particular pharmacy, because i have many pharamcy with the same name in differen area. so i want two add two fields in drug price content type, one for zipcode and another for pharmacy title. both of them are already there in pharmacy content type . so i want that entity refernce populate only the pharamcies based on zipcode given in the upper filed  by admin.

http://awesomescreenshot.com/0db1o14md9

please check the screenshots

Regards


texts: Views-based search not returning expected results

texts:
I've got a Views-based search interface for my Drupal 7 site. I'm noticing when I do a text-based search using the 'search terms' (Search: search terms) field it's only returning partial results.

I've already ensured the search index was rebuilt and cron was run.

My View is set to show all records by default. My other drop-down filters work fine.

It's just the search terms field that only returns partial results. Specifically if you search for a phrase it returns only results from one value of a field list...

Example: if I type 'the grantsmanship center' (without single quotes) it does NOT return all the correct results. However, if I type just 'grantsmanship' (without quotes) it does return the results correctly. Also if I type 'grantsmanship center' without quotes it returns the correct results. If I type "the grantsmanship center" (with quotes) it returns the correct results but puts only 2 items per page (for some reason I don't understand)...it's set to return 10 items per page. All the others return those results paged correctly.

Anyone know what might be going on here?


texts:
I am using Drupal commerce for one of my clients. I notice that the view with orders which are in a checkout status take several seconds to load. After i enable views statistics the numbers are

Query build time    23.51 ms
Query execute time  4.33 ms
View render time    209.68 ms

Which are pretty fast. But despite of the 200ms it takes 6-7 secs to load the view. What could cause this?? Any directions  in order to debug this??

My server is VPS and well configured. I only have this problem with this actual site.

Thank you in advance


texts: Confirmation Email from Webform Submission

texts: How would I send a confirmation email to the email address entered in a Contact Us form created with the Webform module?


texts: Clear cache on view at a set date from a node field value?

texts: What would be the best approach to clear the drupal cache on the exact date and time that a node Date field is set to? It's easy enough to do it on node save, but if the node is to be included in views at the specific time that a date field is set to, then I would need someway to set the cache to be cleared at specific times corresponding to date field values on nodes?


texts: How to Delete A Field and Retain Its Value?

texts:
I created a new field called field_code_file and I transferred all the value from field_code. Reference here.

Now if I delete the old field called field_code, the value in field_code_file is also deleted. So how can I delete field_code by retaining the value in field_code_file?

BTW, not only the value that is being deleted but also the files. What I'm doing is simply restore the files from the backup. The only problem I have is to retain the value in the table, whatever table it is.

Anyone can help me, please?


texts: Display selected menu parent with children in sidebar

texts:
I have a menu  build with taxonomy menu structured like this :
Agenda

agenda1
agenda2

News

News1
News2

Access

Access1
Access2

My main navigation is like this (no children): Agenda | News | Access
What i want to do is , when i click Agenda for example ,i would like to dispay in agenda page in the side bar the block menu corresponding with children
Agenda

Agenda1

Agenda2
I have read many forum on this but not able to get it working :

Show Parent Menu children in sidebar
Get menu link siblings
How to display a block with menu child items programmatically?
I try Menu bloc module to do this but when i set Initial visibility level = 1 , all the menu with children is displaying , but i would like just display the selected menu with his children
When i set Initial visibility level > 1 nothing is display
Any help is welcome


texts:
I'm coming from a do-it-yourself database design background, so bare with me.  Let's say I want two database tables, one of car manufacturers, and one of car models. The first table, car_make, would have two fields, a primary key (car_make_id) and a string (car_make_name). The second table, car_model, would have a primary key (car_model_id) a foreign key referencing car_make (car_model_id), a string (car_model_name), and, let's say, a numeric for engine size (car_make_liters).

I just installed the drupal console to generate the boilerplate code. It looks like an Entity might be the best candidate. I can use the admin/structure space to add fields to the Entities and link them together. However, If I uninstall the module, this fields are removed. How do I create this field structure (schema?) within the module? If fields are not the best way to do this, let me know.


texts: Why can't I change textfield #default_value based on checkboxes' values after an AJAX response?

texts:
I have been trying to learn Drupal forms with AJAX recently and from my current understanding of it I thought I should be able to do something like presented below (I wanted to store all selected values as a string in another hidden field to grab it later in my JS and do some stuff, but that does not matter here, what matters is what I do not get about AJAX).

So the idea is that selecting checkboxes will update the value in the input field with checkboxes' values.

Unfortunately, the #default_value on my textfield is not being set on my page, even though I can see it being set in my $form array when debugging with xdebug.

The form is used to filter some results with an AjaxResponse() ReplaceCommand.

Here is the simplified code, stripped from most unrelated things:

public function buildForm(array $form, FormStateInterface $formState)  {
  $values = $formState->getValues();
  $defaultCountry = implode(':', array_filter($values['countryId']));
  $form['countryId'] = [
    '#type' => 'checkboxes',
    '#title' => $this->t('Country'),
    '#options' => [
      '1' => 'Aaa',
      '2' => 'Bbb',
      '3' => 'Ccc',
    ],
    '#ajax' => [
      'callback' => '::ajaxResponse',
      'event' => 'change',
      'wrapper' => 'some-wrapper-for-filters-form-and-results',
      'progress' => array(
        'type' => 'throbber',
        'message' => NULL,
      ),
    ],
  ];
  $form['defaultCountry'] = [
    '#type' => 'textfield',
    '#title' => $this->t('TEST'),
    '#default_value' => $defaultCountry,
  ];
  return $form;
}

public function ajaxResponse(array &$form, FormStateInterface $formState) {
  $result = 'some processing logic';
  $response = new AjaxResponse();
  $response
    ->addCommand(new ReplaceCommand('.filtered-offers > div', $result));
  return $response;
}

What do I miss here?


texts: Are spam registrations a threat to a Drupal 7 site

texts:
Yesterday, as I was explaining to a client that someone would need to remove spam registrations, the client asked me what difference it made if they are in the system because we can just turn off all privileges that anonymous users don't have.

I was not able to give her a compelling argument of why this clean up is important. The fact that I like to keep everything on a website nice and clean was not a compelling argument for her. What are the security or other risks in not cleaning up the spam users?


texts:
Is it possible to send parameters along with tokens?

I have a module that defines the mod1_info and mod1_tokens.  If I enter %token:mod1:test on a page, it is replaced with .

What I actually want is to enter %token:mod1:test[variable] and get variable.

Is this possible?

Behind the scenes, the test.html is being built with a few dynamic parameters so it actually looks similar to test.html?param1=foo&param2=bar.  What I need is a way for someone editing the site to insert a token on any page, and be able to specify what appears as the link (an image, some text, or both).


texts: Change text size on a page with callback

texts:
I must add buttons on my site to change font size by the user, an accessibility option. Additionally, after user changes the font size, my custom javascript function must be called as a callback after the font is increased (or decreased).

There are two modules Text Resize and Text Size in Drupal, but they don't offer a callback. There is also a RV Font Size jQuery Plugin which doesn't offer a callback either.

Before diving into any one of those modules/plugins and customizing them, maybe someone knows such an accessibility module/plugin which already has a javascript callback after font change (and of course has cookie storage as those other modules)?


texts: Unable to see URL path setting menu for a user edit page

texts:
I want to see "URL path setting" tab which appears while editing any content, but can't see it while editing a user. need help or suggestion regarding this.

thanks


texts: XMLSitemap- Is it OK to add nodes both by content type and menu?

texts:
I'm making a sitemap using the XML Sitemap module.  The module and its submodules allow nodes to be added to the sitemap from the content type configuration screen as well as the menu configuration screen.

So, for example, I can add all nodes of type Basic page to the sitemap, and then I can add all links in the Primary links menu (many of which are nodes of type Basic page) to the sitemap as well.

My question: Is doing this OK?  Should I be worried about having duplication between adding the content types and adding the menus?  Or is this nothing to worry about?


texts: Voting a post several times by same user

texts:
I have a case where authenticated users can Vote a content many times.

I want a button at the top of the Node saying Vote This and when the users click the button it'll ask for confirmation Do you really want to Vote ?. When confirmed, he'll be redirected back to the same page, and be able to click the button again. However, in the backside, I want to record the time of voting and the user who voted it. Not necessarily the vote count, but just date/time and person.

I tried this with the Flag and Global Flag modules, but the issue is: once flagged, it can only be unflagged.

I also tried Fivestar module, with just one star (which I can change it to a button via CSS), but it doesn't ask for confirmation. It doesn't record the date/time either (I might be wrong here, but playing around with Fivestar, I didn't find a configuration option).

There must be something with VotingAPI which might be useful in my case, but I am unable to identify how to satisfy these conditions. I am seeking guidance.

Update: In addition to @Adam Balsam's answer to have confirmation I did

Use jQuery to add id to the link like: (I only have one vote in node)

$('.plus1-link').attr('id', 'vote-plus');

Then added jQuery confirm dialog like:

$('#vote-plus').click(function(e) {
               var cnf = confirm('Do you really want to vote?');
               if(cnf === false) {
                   e.preventDefault();
               }
            });

It might not be the elegant solution, but this how I solved my confirmation dialog option.


texts: How to handle non-fatal errors during a batch operation?

texts:
Most tutorials about Drupal batch processing suggests that you provide something like the following as a callback for when the batch has finished.

function mymodule_finished($success, $results, $operations) {
  if ($success) {
    drupal_set_message(t('Success'));
  } else {
    $error_operation = reset($operations);
    drupal_set_message(t('At least one error occurred'));
  }
}

This is also how my finished-callback looks like (I know you can report more fancy statistics about the operations, but that is not relevant here. I want to keep this question simple).

I want to loop through a bunch of files in a batch and report at the end if any of them are not readable by the web server.  I do not want to abort the batch when a non readable file is found.

My test site is a clean Drupal 7.37 + Devel and a custom module called "mymodule".

This is how operations function for processing a single file looks like:

function mymodule_process_one($file, &$context) {
  $context['results'][] = check_plain($file);
  if (!is_readable ($file)) {
    // I need some code here that indicates that this is an error.
  }
}

I've indicated with a comment were I think there should be some code that indicates that there is some non-fatal error.  My question is: What should this code be?

I've made sure that one of files processed are not readable.  Using Devel to print out the three variables passed into mymodule_finished, this is what I get:

$success is TRUE.
$results is an array with all the file names.
$operations is an empty array.

Since there is no actual code in the operations-function to mark an unreadable file as an error , my finished-callback always print "Success", even if there are one or more unreadable files in the batch.  How can I make it report any errors at the end?

PS: I've searched the site and found examples on how to terminate the batch process if a fatal error occurs in an operation - e.g.: How to terminate a batch when an error occurs and
Can a batch process be stopped.  I am not interested in that.  I want an answer that explains how to process all items and produce an error message in finished callback if one or more operations failed.

Edit: I know that I can accomplish this by using a global db variable as an error flag. However, I am not interested in workarounds.  I want to learn how do this correctly using the batch API.


texts:
I'm using a 3rd party hosting service for a Drupal 7 installation, and would like to put my Drupal site under the public_html folder like this:

public_html
|
|
|---->mysite
       |
       |-->includes
       |-->misc
       |-->modules
       |-->profiles
       |-->scripts
       |-->sites

However, I'm not sure what settings.php values I need to set, nor what if any .htaccess settings need to be changed?


texts:
Does the #AJAX FAPI property work on the body field? I've got it to work with things like submit buttons and textfields such as the title. When I alter the node edit form, and attach an #ajax array to the body field though, nothing happens. I've tried multiple event types (keyup, keypress, focus). Is there anything special that needs to be done to get #ajax to work on the body field?

  // This works (creates backend xhr call).
  $form['title']['#ajax'] = array(
    'wrapper' => 'autopreview',
    'callback' => 'autopreview_ajax_callback',
    'method' => 'replace',
    'event' => 'focus',
  );

  // Doesn't work.
  $form['body']['#ajax'] = array(
    'wrapper' => 'autopreview',
    'callback' => 'autopreview_ajax_callback',
    // 'method' => 'replace',
    'event' => 'focus',
  );

  // Doesn't work.
  $form['body']['und'][0]['#ajax'] = array(
    'wrapper' => 'autopreview',
    'callback' => 'autopreview_ajax_callback',
    'method' => 'replace',
    'event' => 'focus',
  );


texts:
I am using Lightbox2 module for a view module effect. Works great! Could I Add fields(text) or a Block to the Lightbox overlay
?  It doesn't matter if its text field or a editable content block.

Example from MS Paint:


texts: When rendering paragraphs in a theme, is there a way to look at the last rendered paragraph while rendering the current one?

texts:
I have about two dozen paragraph types. One of them inserts an h2, and generates a jump menu at the top of the page (I am generating that myself).

The pattern lab has the content that comes next (whatever the next Paragraph inserted may be) with a special CSS class on the container, because of the particular aforementioned type being used.

Is there a way in theme_preprocess_paragraph or theme_preprocess_field to 'look back' and add the CSS class if the current one is a certain paragraph type?


texts:
I'm using the Field Formatter Condition module. I have two fields: Countdown Timer Field and text field. I've created condition for text field: Hide when target field is not empty and target field is the countdown timer field.

Everything is working fine, but when Countdown hits 00:00:00, it takes over a dozen of seconds for condition to work and hide the countdown and show the text field.

Is there a solution to run this condition immediately after countdown hits 00:00:00?


texts:
I've got a virtualbox VM setup as a proxy server between Drupal to try to replicate a CDN causing errors on a client's machine.

My current port is as follows: http://site-name.dd:9999

When I go to the proxy-enabled site, and try to use a given entity reference, I get a 403 error:

An AJAX HTTP error occurred.
HTTP Result Code: 403
Debugging information follows.
Path: http://site-name.dd:8086/index.php?q=entityreference/autocomplete/single/field_guardians/participant/player/NULL
StatusText: Forbidden
ResponseText:
Access denied | Site Here
Skip to main content
Site Title Here
Main menuName
Another Name
A Third Name
Products
Access denied                                        You are not authorized to access this page.

My guess is that this is due to me trying to access via port 9999, and the direct site being on 8086.

I believe a similar (though perhaps not exact issue) is also facing the client. How do I deal with this AJAX error? Has anyone seen anything like this?

This is for a D7 site.

EDIT:

I have also tried changing these settings in settings.php:

$conf['reverse_proxy'] = TRUE;

And alternatively setting one of these two and testing with each, with no success:

$conf['reverse_proxy_addresses'] = array('10.1.0.157');

$conf['reverse_proxy_addresses'] = array($_SERVER['REMOTE_ADDR']);

EDIT 2:

From what I can find, the error is because it is getting the original server port from the autocomplete field input element value. So either I need a way for the 8086 port to recognize the 9999 port as legitimate or I need to switch to the 9999 port as correct.


texts:
I'm migrating data from Zoho creator into Drupal 7. I wrote a PHP script to get all records and save them into nodes and that worked fine, but I need help to get the images and add them to the nodes as well. This is the code I have to get the image using CURL.
curl_setopt_array($curl, array(
  CURLOPT_URL => $url . $id . "/Image1/download",
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array("Authorization: Zoho-oauthtoken $token")
));
$image = curl_exec($curl);

What should I do after that?


texts: How activate Privatemsg Module to all users?

texts:
I just enabled the Privatemsg Module in my Drupal 6. I would like to enable this module to all users, who join in the website. But the registered users cannot see the "Write new message and Messages" link.

Why the  Privatemsg is not active in users section ?


texts:
I want to add a class to the link in my delete content page, currently the 'delete' button itself is styled because it falls under the styling for input[type=submit] in my CSS, but the 'cancel' button is just regular text.

I also have the webform edit page with links for 'clone', 'edit' and 'delete' how would I go about adding classes to these as well?

I don't want to just add a class for all links because thats overkill in my scenario

Thanks


texts: How to properly create an alias to a content

texts:
When I create a content from Dashboard, I assign it an alias, to be exact I assign it:

  offers

But the route I'm getting is:

  http://example.com/?q=offers

How can I make it to be just:

  http://example.com/offers


texts: Ultimate Cron. Invoke a cron from a cron. Set a cron enabled status to TRUE till its queue gets empty. Then set it to FALSE

texts:
I am using Ultimate Cron for running individual cron runs and I see Ultimate Cron provide hook_cronapi() to create own cron task runs and provide enabled key as either TRUE or FALSE.

My objective is create two cron task one cron will run at specified time say 01:00pm and will update the enabled statues of second cron to TRUE so that it will run until it achieved certain condition  during each 1 min interval of this second cron task and after this condition is met, will be shut down the second cron task status by setting disabled status to FALSE so that it stop processing uselessly.

So, how do I set that enabled status to TRUE/FALSE during its run time.


texts: How would I hide a form and display thank you content in the same area - drupal 6

texts:
I've been trying to get to grips with the form api,
I'm currently trying to hide a form after it has been submitted and to display a thank you template in the same area as the form was in.

Hoping someone might have an answer.

Thanks


texts: What is the best way to add Jquery to my drupal site without building modules and keeping it cut and paste?

texts:
I see some very nice effect on http://www.jqueryscript.net/  and I would like to add some of these to my drupal site.

Can I just cut and paste the code in content or blocks to make this work?

I'm sure I can, but before I get into an adventure, I would like to do this the right way.


texts: Is it possible in Drupal Commerce to have 2 price fields according to role?

texts:
Is it possible to have 2 price fields, with manually added price?

Currently I have second price calculated. User with role "EUR_price" will see only EUR prices and others + anonymous will see USD. And this for product, in cart, order etc.

I'm not sure, if Rules (and separate price field) is enough for this.


texts: Search API Views Indexed Node Filter by Author Role

texts:
I have Search API installed, and have indexed all of my nodes.

The nodes all have a different Author, and the Authors have roles "Free user", and "Business User".

I only want the nodes belonging to Business Users showing up in search.

I created a view, the search works perfectly on indexed fields, but I cannot filter by Author:Role

I have added a relationship of Indexed Node: Author, but still no filter available.

Anyone know how I can achieve this?


texts:
I have form where '#theme' => 'ebanq_transfer_theme'. Template file is rendered but preprocess hook doesn't invoke. Any ideas?

/**
 * Implements hook_theme().
 */
function ebanq_transfer_theme() {
    return array(
        'user_accounts_form' => array(
            'render element' => 'form',
            'template' => 'user-accounts-form',
            'path' => drupal_get_path('module', 'ebanq_transfer') . '/templates',
        ),
    );
}

/**
 * Accounts form preprocess.
 */
function ebanq_transfer_prepocess_user_accounts_form(&$vars) {
    $form = $vars['form'];
    dpm($form);
}


texts: How to uncheck url path settings in node form alter for existing content?

texts: Here I wonder how to uncheck url path settings in node form alter for existing content?


texts:
I have some fieldable panel pane and I can attach this FPP in diferent nodes with panelizer functionality.

How can I get nid of nodes which contains(attach) this FPP programmatically ?

I have fpid but how can I check in which nodes use this FPP ?


texts: How do I translate/change the text of the order receipt email in Commerce 2?

texts:
The Commerce 2 documentation describes how to send a an order confirmation receipt:

Go to the Commerce admin page.
Choose order types.
Click edit for the relevant order type and check the box to email a receipt.

However, how do I translate the text of this receipt?  There appears to be no UI for this.


texts:
How can I add extra info like lang="ar" dir="rtl" to the <html> tag like the following?

<html{{ html_attributes }} lang="ar" dir="rtl">


texts: What is the best practice to exchange variables between page calls

texts:
I am trying to display a list of objects related to my custom node, by showing one node on the node's page and also giving a "next" button which will call the same page but with the id/index of the next objects to display.

Is there a custom/better way to do it than with a GET parameter added to the url of the page call and then the reading of this parameter in the template file via $_GET[]?


texts:
I'm writing a wrapper module for a php library, and for some reason, can't get to actually doing something. When I try to call

libraries_load($library_name);

I get an error message:

PHP Fatal error:  Call to undefined function libraries_load()

I do have set

dependencies[] = libraries (>=2.x)

in the module_name.info file
and module_name_libraries_info() seems to be okay.
When I run drush libraries-list, I do get the library listed correctly.

The version of the libraries api I have installed is 7.x-2.2

How do I fix this?


texts: Displaying block only when user visits his own profile page

texts:
I want to display the block only when the current user visits own page.
So in block visibility I use the following PHP:

global $user;
if ($user->uid == arg(1)) {;
return TRUE;
} else {;
return FALSE;
};
endif;

But that block returns on every page.What am I doing wrong?


texts: EntityFieldQuery with pager and db_or using addTag

texts:
I'm having an issue that I hope some of you can help me with.

Drupal version: 7.36

I've created a list of all nodes of a certain content type using EntityFieldQuery. Since there are a lot of nodes with this content there's also pagination with 6 nodes pr page (not that it matters). Right above my list I have a little search field, where the user can search within this list of nodes with the specified content type. With this I'm using the addTag and db_or method described here: Using hook_query_TAG_alter to add 'OR' queries to EntityFieldQuery. With this the user searches both in the title and the content.

However. For some reason it doens't quite work while having $query->pager() or $query->range() and using the $query->leftJoin() function at the same time. If I outcomment the $query->leftJoin() and the connected db_or->condition() everything works fine. Or if I outcomment the $query->pager(6) everything works fine as well.

Here is all my code for getting the list of content types:

function node_load_by_type($type, $options = array()) {
    $settings = array(
        'limit' => array_key_exists('limit', $options) ? $options['limit'] : -1,
        'pager' => array_key_exists('pager', $options) ? true : false,
        'offset' => array_key_exists('offset', $options) ? $options['offset'] : 0,
        'orderDirection' => array_key_exists('orderDirection', $options) ? $options['orderDirection'] : 'DESC',
        'keywords' => array_key_exists('keywords', $options) ? $options['keywords'] : false,
    );

    $query = new EntityFieldQuery();
    $query->entityCondition('entity_type', 'node')
        ->entityCondition('bundle', $type)
        ->propertyCondition('status' , 1)
        ->propertyCondition('nid', arg(1), '!=')
        ->propertyOrderBy('created', $settings['orderDirection']);

    if ($settings['limit'] !== -1 && $settings['pager']) {
        $query->pager($settings['limit']);
    } else if ($settings['limit'] !== -1) {
        $query->range($settings['offset'], $settings['limit']);
    }

    if ($settings['keywords']) {
        $query->addTag('search');
        $query->addMetaData('keywords', $settings['keywords']);
    }

    $results = $query->execute();

    if (is_array($results) && array_key_exists('node', $results)) {
        $results = node_load_multiple(array_keys($results['node']));

        if ($settings['limit'] !== -1 && $settings['pager']) {
            $results = theme('article_list', array('nodes' => $results, 'pager' => theme('pager', $query->pager)));
        }
    }

    return $results;
}

function THEME_query_search_alter(QueryAlterableInterface $query) {
    $keywords = $query->getMetaData('keywords');
    $words = "%" . $keywords . "%";

    $or = db_or()->condition('title', $words, 'LIKE');
    $query->leftJoin('field_data_body', 'n', 'node.nid = n.entity_id');
    $or->condition('n.body_value', $words, 'LIKE');
    $query->condition($or);
}

Has anyone experienced this before and found the solution? Or can simply see in my code somewhere that there's an error which is causing my problem.
Ideas for doing it differently is also welcome.

Thanks in advance. :)

UPDATE:

More testing tells me that what triggers this is actually joining another database table into the $query. If I don't use pagination but still the $query->leftJoin(), $query->join() or any similar functions the search actually returns a count of a lot of results even though there might only be 1 result.

Using the global variable $pager_total_items I can see that when there's actually only 1 result, it tells me that there are 1917 results. Then the pagination goes mental and doesn't know what to do, so it creates a lot of pages with the 1 result on each page.


texts: Add class to top-level ul using menu_block

texts:
I am using the Menu Block Module to generate my main and sub navs.  I want to add a class to the ul for just the top level of the main nav.

As I understand it, I can do something like this:

function theme_menu_tree__menu_block($variables) {
  return '
' . $variables['tree'] . '
';
}

or this:

function theme_menu_tree__menu_block__main_menu($variables) {
  return '
' . $variables['tree'] . '
';
}

However, that seems to wrap every level of the navigation with the above html.  How can I restrict the modification to the first level?

It doesn't look like I am given much data in $variables. Am I missing something?


texts:
I have field called field_3d_model_xml_path which is a text type. I am currently retriving the value like this.

//get current node
$node = menu_get_object();
//build xml path
$xmlPath = DRUPAL_ROOT . "/" . $node->field_3d_model_xml_path['und'][0]['value'];

Is this right way to do it or there is some better way?


texts: How to use check box in select list for multiple selection in content type?

texts:
I simply want a select list like this.

Is there any options to add a field like this.


texts: Print message only if checkbox field is alter using form alter

texts:
I have created a checkbox in user edit using form alter and based checkbox state I want to print the message. For this I used below code

function module_form_user_profile_form_alter(&$form, &$form_state) {

  $form['account']['checkbox'] = array(
    '#type' => 'checkbox',
    '#title' => 'Test check',
   );
   $form['#submit'][] = 'module_simplenews_unsubscribe';
}

//~ //Submit handler for Subscribe/unsubscribe newsletter.
function module_simplenews_unsubscribe($form, &$form_state) {

  if ($form['account']['checkbox']['#value'] == 0) {
    drupal_set_message(t("You are checked"));
  }
 if ($form['account']['checkbox']['#value'] == 1) {

    drupal_set_message(t("You are unchecked"));
  }
}

It works fine. When checkbox is checked/unchecked and user saves the profile it prints respective message. But when user doesn't modify this checkbox field and modify some other field and saves, again it prints message based on checkbox state.

I want to display the message only when checkbox field is modified. How can I achieve this?


texts: When in edit, and presented with a wysiwyg editor for example, I've got a "Switch to plain text editor" link under. However, in one of the sites, in addition to this link I also have  "Insert image or link" links. But not in the other sites. Where is this setting coming from? Is it generally good practice to have these links?


texts: How to redirect from URL with trailing slash to one without

texts:
We are using the Redirect module 8.x-1.2 with Drupal 8.5.6. When generating URLs, we are finding that a trailing slash is added to the end of the URL, and this is creating a 503 error code.

How would I redirect the anonymous users from the URL with the trailing slash to the one without trailing slash?


texts: Mixing field collection items with regular fields in views

texts:
I've got a content type that contains fields like this:

title
field collection
body
link

The field collection contains:

image
text

The field collection is going to be for 3 iterations in one node. In views this is the desired output:

title
field collection 1 image
field collection 1 text
field collection 2 image
field collection 2 text
field collection 3 image
field collection 3 text
body
text
link

I've set the relationship in views and retrieved the field collection fields. The problem I'm running into is it's duplicating all the single fields for every field collection item. The output looks like this:

title
field collection 1 image
field collection 1 text
body
text
link
title
field collection 2 image
field collection 2 text
body
text
link
title
field collection 3 image
field collection 3 text
body
text
link

How can I get it to draw all the field collection fields without duplicating the rest of the fields along with it?


texts: How do I exclude a bunch of nodes from being indexed by Solr?

texts:
I want to remove unused nodes from indexing in solr and also I need to make sure that they are not indexed again. I will fetch the list of the unused node IDs using a query.

If any of the nodes is getting updated, then I need to index that node again.

How can I achieve this?


texts:
I am using the default taxonomy view that comes with the views module and everything is working as expected. The one problem I have is that I cannot figure out how to display a page showing all nodes under my parent vocabulary term.

Vocabulary = videos

-Term 1
--Term A

-Term 2
--Term A

-Term 3
--Term A

So with the example above if I go to any of the terms I will get the terms and children associated with them. Ex: www.site.com/videos/term-1. That works.

But I would like to have a view listing ALL of the nodes when a user goes to www.site.com/videos.

It's gotta be pretty simple, but I am missing it. Thanks!


texts: How can you expose a Quantity update / delete field in the checkout cart?

texts:
Currently when adding items to cart, I have all users redirected straight to /checkout, but the problem arises is when users want to modify their cart contents.

I tried adding the Quantity Text Field, but no update button shows up. And I tried adding the delete button, but it doesnt delete anything.


texts: User subscribes to newsletter even if checkbox is not checked

texts:
I have a newsletter on my drupal page created with simplenews.

I have created webform, that lets you apply for a job and it has "subscribe to newsletter" Newsletter email checkbox. When someone submits the form, I can see in the form results, that some people have there value "val" and some have empty string. But all people get subscribed no matter what the value was. Even if they did no check the checkbox.

How can I prevent that?


texts: how do i use subquery in db_api condition?

texts:
I am using drupal 7 and i would like to create subquery in condition clause with db_api. With db_query it goes something like this:

select *
from some_table_1
where some_table_1.something =
 (select max(some_table_2.something)
  from some_table_2
  where some_table_1.id = some_table_2.id
);

Among other, I was trying it with

$query->condition('some_table_1.something', $subquery);

and i cant get it to work.

How can i do that?


texts:
Is there any way to embed form fields (i.e. textfield) within other field (i.e. radios). I'd like to create something like radiobuttons list: first default and second (if selected) allow user to enter text value.
Maybe I should create custom compound cck field?


texts:
I want to use Drupal as a Framework for my application. Apart some modules, such as Image, Imagecache, Views, and Panels, I will make custom modules. I need the best performance and result.

What version of Drupal should I use?


texts: Add a vocabulary and a term-reference field or just add a select field?

texts:
I have various content types which have sub-types in my Drupal 7 site. e.g. "downloadable resources" content type, and within this there may be reports, presentations.

Is there any reason not to add this to a select field with a list of value=>label pairs?

Should I create a separate vocabulary for these options and add a new field referencing that terms? I have a couple of other content types similarly modeled, so I would end up with a load of very small (2-3 terms) vocabularies.

Taxonomy seems to be favoured but instinctively it seems overkill?

Edit: or is it better to have very granular content types (report, presentation...), even though the fields are the same between them?


texts: Allow admins to translate interface strings on a headless/decoupled site

texts:
I have a list of common UI strings that will appear in multiple places across my headless Drupal site's webpages. Things like "more", "next", "continue", etc.

I'd like to allow admins translate these in one place. The interface translation UI (from the core Interface Translation module) is promising but because I'm not using Drupal templates, I don't have a way to get the strings into, or out of, Drupal.

Do you have any idea on how to go about setting this up?


texts: "This page was last modified on" code not displaying

texts:
I added the following code to my node.topl.php but nothing is displaying on my site. What am I missing?

<?php
if ($submitted) {
  echo 'This page was last modified on ' . date( "F j, Y",$node->changed);
} ;
?>


texts: User Points Rules: Remove points (based on content type)

texts:
I currently am using the User Points Rules module to grant points (both moderated and unmoderated) to users for signing up for content using the Signup module. However, for cases where the user cancels the signup, it doesn't seem possible to remove (through another transaction) the points.

The points aren't static (i.e. 1 point per signup and thus -1 point per cancellation), but are dependent on the integer value entered for the Events content type.

Suggestions?

Issue on d.o: https://www.drupal.org/node/2419721


texts:
if there any solution for this?
I need to do views slideshow with content loading (with ajax).


texts: How can I change the selectable years in a date field?

texts:
I have a date field, birthday, created with the Date module. By default, the selectable years are 1900-2050.  This makes no sense for birthdays so I want to change it to only show years from 1900-(current year-18).

How can I do this?

There is a solution for Drupal 7 but that code does not work in Drupal 8 because form_process_date() does not exist in Drupal 8.

This is the full error:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'form_process_date' not found or invalid function name in Drupal\Core\Form\FormBuilder->doBuildForm() (line 993 of core/lib/Drupal/Core/Form/FormBuilder.php).

Here is the code I'm using:

function mymodule_form_user_register_form_alter(&$form, &$form_state, $form_id) {
  $form['account']['birthday']['#process'] = array('form_process_date', 'mymodule_fix_year_range');


texts: How to change the query value using hook_views_query_alter?

texts:
I am having a problem trying to change the query output on my view.

I am using this code:

function zed_views_query_alter(&$view, &$query){
  if ($view->name == 'questions_home' && $view->current_display == 'rates_related') {
    $or = db_or();
    dpr($query->where[1]['conditions'][2]['field']->condition());
  }
}

I am trying to alter the word %california%. The output is the following one.

DatabaseCondition Object
(
    [conditions:protected] => Array
        (
            [#conjunction] => OR
            [0] => Array
                (
                    [field] => node.title
                    [value] => %california%
                    [operator] => LIKE
                )

            [1] => Array
                (
                    [field] =>
                    [value] =>
                    [operator] => IS NULL
                )

        )

    [arguments:protected] => Array
        (
        )

    [changed:protected] => 1
    [queryPlaceholderIdentifier:protected] =>
)

How can I go about changing the value %california%?


texts: How to translate entity in the views footer

texts: I am creating a multilingual site. I have views and when it was created, I added to the footer entity (node/22). Next, I created a translation of this content and now changed id (node/45). How to specify the settings views to display different node corresponding to the user's language?


texts: Get the active menu parent from a menu block

texts:
I'm attempting to use hook_block_view_alter() to set a block title to the name of the page's parent menu item.

The block is a menu block for the main menu that is showing second-level items.

I've found that this works to set the title:

/**
 * Implements hook_block_view_alter().
 */
function nama_components_block_view_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block) {
  if ($build['#id'] == 'nama_d8_main_menu') {
    $parent_menu_item = 'just testing!';
    $build['#configuration']['label'] = $parent_menu_item;
    $build['#configuration']['label_display'] = 1;
  }
}

From here, how would I look up the parent menu item from the block so I can actually set $parent_menu_item? I've looked through what I'm getting in the $build and $block parameters, but I'm just not seeing it.


texts:
I try to create a migration from  a webservice but i can't set the authentication...

In my YAML, i have this :

source:
  plugin: url
  data_fetcher_plugin: http
  data_parser_plugin: soap
  authentication:
    type: basic
    parameters:
      username: user
      password: password
  urls:
    - https://urltowsdl?wsdl

I get an error 401 when I use the command. But in SoapUI my username and password work just fine...

Thanks


texts: How do I get rid of the "Configure Blocks" link above my menus?

texts:
I know the answer to this will be obvious (and probably embarrassing), but the link started appearing on my new development site, and I want to turn it off to do some styling.  The link only appears above menus and I cannot find a setting in a relevant module to turn it off. This problem is at the annoying stage for me, but could become an obsession if I..don't....squash.....this......nasty..........bug!

Does anyone know what controls this?  :)


texts:
I'm using drupal 7.

I want to use $view->set_exposed_input(array('filter_identifier' => 'filter_value'));

How to know the filter identifier?


texts: Drupal commerce donate: Safely update to dev version of module on live site

texts:
I need to update my charity website to the dev version of commerce donate because we have recently discovered that donors cannot donate decimal amounts with the current recommended release (e.g donate £5.20) and this is something that we need as people need to pay in fundraising money etc.

I am weary of uninstalling the current module and reinstalling as we have several products that are created using the donation content type and don't want to lose them or the existing donations people have made from the system.

Is there a way to do this safely and (preferably) easily?


texts: Insert user password into e-mail body sent by Rules for Ubercart's order completion

texts:
I have a Rules for Ubercart

Event: Order Checkout Complete
Do :  Send a mail to a user

I need to insert the password of the user the mail is sent to but there is no token for it.

How can I insert the user password into the mail body set by Rules modules?


texts: Add multiple co-authors while creating node

texts:
I have a content type proposal. Now I would like to have multiple co-authors of the node. I want to give the author the opportunity to add users like this:

The users have to be entity references. I know there is a module Node access user reference but how can I have a collection of entity references that bundles the "co-authors". The module doesn't work with Field Collection module.

Has anyone encountered this and is there a module for this or a simple solution?


texts:
Old website is running on live. The version of the old website is drupal 6. Last two months ago, I receive a task to create new website by using drupal 7 to replace old one. That time i have 0 knowledge of drupal. Now ready to replace old one and face problem. Old website is drupal 6. New one is drupal 7. Sure have problems.That why i decide to duplicate old website and database to sub domain. Purpose is to upgrade old website from drupal 6 to 7. Old website in sub domain display succesfully, but the link all point to site listing of the sub domain

FYI, I had managed to replace new website D7 to old website D6 successfully. However, the solution is not base on migrate D6 To D7. This question will be remain unanswered...


texts: dissecting the og module - where is the content type form submit handler for function og_ui_form_node_type_form_alter?

texts:
drupal version: 7

Hi, I'm trying to add settings to a content type form and I'm using organic groups as a guide. I see the form elements for OG being added in the og_ui.module at line 316 in this function og_ui_form_node_type_form_alter but I don't see where these form elements are being submitted, handled, saved, processed... I would've expected it to add another submit handler to the form but it doesn't seem to be the case. Anyone have any experience with this?


texts: sort views comments by vote result keeping thread

texts:
I want to show comments of nodes ordered by vote result (most popular comment at the top of the list).
I have installed voting API, rate and views module. Then add a yes/no voting to comments and enable threading for comments in order to let users reply each other.

I created a views to show comments in most popular order with these sort criteria:

Comment: Thread (asc)
SUM(Votes: Value)

Now the problem is that when views tries to keep thread it sort theme by post date (asc/disc) and do not see the second sort criteria.

So how can I sort comments by vote results keeping threading?

EDIT:


texts: Drupal 7 taxonomy add term missing url path settings

texts:
I'm working with a Drupal 7 installation, I watched a video that shows how to work with taxonomy, http://www.youtube.com/watch?v=Qmr2HW6CtJQ but when I go to "add term" to create a new term in my newly created vocabulary, the "URL Path Settings" was missing which has to generate automatic url alias that was shown at 04:15 of the video.

How to get this to show up?

Thanks.


texts:
In the settings.php file if the site, I added the following line.

$settings['trusted_host_patterns'] = array(
  '^www\.example\.com$',
);

I'm using Drupal 8.2.6.

Do I need to add the proxy address too, or my IP? It is a single domain.


texts: Is it possible to build a complete web site with Drupal 7 without using contributed modules or Hooks?

texts: Is it a good programming practice to add your own hooks in a template.tpl.php or is it best practice to make all the changes possible into a custom module?


texts: How to display a contact form as a node block?

texts:
I have a content type let’s say "hotels" and there are a bunch of nodes for different hotels. I would like to display a content form either as a block or in the node itself, where users can send an e-mail to the accordant hotel owner.

How can I do this? I have tried using display suite and entity reference but could not get this to work.

Thanks for your help :)


texts: I googled, but I didn't find any automated solution. So, I've started it manually. Mapping CSS files is easy, but I'm looking for a way to map blocks/templates. Please, help.


texts: How do you change the location of `form_set_error` output?

texts:
Is there a way in Drupal 7 to change the location of the output of form_set_error?

At the moment, it calls drupal_set_message which queues all the form's errors to the top of the screen.

What I would like instead is for each message to appear below the appropriate field.

If this is not possible, can I manually flag the form as "invalid" within the MODULE_form_name_validate() function without using form_set_error?


texts: Do I need to optimise images for smaller file sizes?

texts:
Im adding images to my content through Drupal eg as a CCK field and im normally displaying them through image cache.

I want the images to be compressed for a smaller file size as sometimes the originals can be massive without looking that much sharper. Note, im not talking about resolution here, but the quality of the image.

Do I need to first do this with a graphics program like Photoshop or will Drupal automatically do this for me? If it does it automatically, are the results fairly good or is it still best to do it manually?

Thanks


texts: What is the order of preprocess functions?

texts:
I have started learning Drupal for few months. Now I'm doing some theming.

I would like to know the execution order of preprocess functions.


texts: Display Suite Custom Wrappers and Custom Classes Tabs Not Appearing in Manage Display

texts:
I am using Display Suite layouts for some of my pages. I want to add in some custom classes for the regions. However, the custom classes and custom wrappers tabs are not appearing on the Manage Display screen for my view modes. I am able to add custom classes on the Display Suite Custom Classes screen, but cannot apply them to the display, as the tabs are not there.

Am I missing something? I have seen videos where they appear for other users so don't know why they are not appearing for me.

Below is a screenshot showing the missing tabs.

I want to basically target the view mode as a class on the page. At the moment, it is only inserting the layout I have selected as a class, so if I am using the same layout for different view modes I can't differentiate between them if they are for the same content type.


texts: Enable clean urls drupal 7.56 / nginx - check failed

texts:
I have an issue with the clean urls check. When I test there is an error in the Nginx log:

2017/10/06 09:49:01 [error] 468#468: *199 open()
"/usr/share/nginx/html/drupal-7/admin/config/search/clean-urls/check" failed
 (2: No such file or directory), client: 192.168.1.254, server: localhost,
 request: "GET /drupal-7/admin/config/search/clean-urls/check HTTP/1.0",
 host: "localhost".

I don't know if it is a nginx problem or a Drupal problem.

update : i change some things in the nginx.conf now i have an error in the log of nginx :
2017/10/14 21:55:08 [error] 4804#4804: *1 directory index of "/usr/share/nginx/html/drupal-7/" is forbidden, client: 192.168.1.254, server: localhost, request: "GET /drupal-7/?q=admin/config/search/clean-urls HTTP/1.1", host: "localhost".
Here is my nginx.conf :

http {
include       mime.types;
default_type  application/octet-stream;

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

#access_log  logs/access.log  main;

sendfile        on;
#tcp_nopush     on;

#keepalive_timeout  0;
keepalive_timeout  65;

#gzip  on;
# set client body size to 200M #
client_max_body_size 200M;

server {
    listen 443 ssl http2;
    server_name toniozz75.fr;
    root /usr/share/nginx/html;
    index index.html index.htm;

location = /favicon.ico {
            log_not_found off;
            access_log off;
    }

location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
    }

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

location ~ \.(php|html|htm)$ {
         root           /usr/share/nginx/html;
         fastcgi_pass   unix:/run/php-fpm/php-fpm.sock;
         fastcgi_index  index.php;
         try_files $uri $uri/ /index.php?$args;
         include        fastcgi.conf;
    }


texts: Implementing Area 51 with Acquia Commons?

texts:
I'm probably going to use Acquia Commons to put together a site for communities, and I understand that it's set up as installed to have administrators create the groups and subgroups. However, I'd like users to be able to petition for new groups (and subgroups?) to be created in a process something like Stack Exchange's own Area 51, though perhaps without the following phase.

How would I go about implementing that sort of thing on the current release of Commons? It's based on Drupal 6 until more modules are ported to D7.


texts: How to render messages along with a login block programmatically

texts:
I rendered Drupal Login Block and Frogot Password Page in a region so I can trigger it in a bootstrap modal upon user click on login link, here's the code for those who might actually need it:

          <?php print $messages; ?>

            <?php
              $login = drupal_get_form("user_login_block");
              $form = drupal_render($login);
              echo $form;
            ?>

            <?php
            // include user form
            module_load_include('inc', 'user', 'user.pages');
            $passform = drupal_get_form('user_pass');
            $passformrender = drupal_render($passform);
            echo $passformrender;
            ?>

        <button type="button" data-dismiss="modal" class="btn user-modal-close">Close</button>
        <button type="button" class="btn btn-info pull-left nobrainer">Forgot password</button>

The problem is when a user enters wrong credentials and system wants to render an error message, it renders the error on page and not in the modal, even though I tried printing $messages as you can see in the code, it still doesn't show the error in the modal, I was wondering if there is a way to show the error in the modal,

Thanks.


texts: How to create views with date field of a content type?

texts:
I am using D6.
I want to create a views with date field using in a content type such as "Photo Gallery".
What i have done are:-

In argument, select Content: Date (Date Appears in: Photo Gallery) then
select granularity as "year", sorted descending, check "Content:Date
save it.
I separately do for both month and day respectively.

What i am getting in URL are like photo-gallery/2010, photo-gallery/2010/2010-10, photo-gallery/2010/2010-10/2010-10/10 for year, month, day respectively.

But i don't want this.

I want Url like for year- photo-gallery/2010, for month- photo-gallery/2010/10 and for day-photo-gallery/2010/10/10
I am stuck here. So how can i do this?


texts: System message (after form submit) not clearing

texts:
Hope someone here can help me to find a solution to this. Here we go:

Have created a custom theme for Drupal 8.6.9
In page--front.html.twig I created a custom region named "status_messages" which is hidden if messages_exists variable has nothing

The twig of that region looks like this:

{% if messages_exists %} //this comes from my .theme file where I retrieve the messages

{{ page.status_messages }}

{% endif %}

In my .theme file I retrieve the messages in a preprocess_page function like this:

$messenger = \Drupal::messenger();
$variables['messages_exists'] = $messenger->all();

In the drupal admin panel I added the message block into my custom "status_messages" region.
I created a form to be displayed in a contact specific url

So after filling out the form and click on submit, the page is redirected to the frontpage and the message displays correctly ("thanks for your message...") but then when I refresh the page, the region is still displayed but without the message. I used dump to check message_exists variable and it is still displaying the message. Shouldn't it to clear the message after refresh?

Thanks and if I missing some info please let me know.


texts: Webform Custom validate and element alter

texts:
I'd like to know if there is any way to:

1- Perform the validate of a webform programmatically from custom module.
2- Modify the value of some element before rendering the form from custom
module.


texts: Double breadcrumbs with taxonomy menu and taxonomy menu trails

texts:
I have an issue similar to the one described in
Why do my breadcrumbs see double? and How can I control them? A double question?

With taxonomy menu trails I got the breadcrumb to my node related to the taxonomy working, but now on my view page, when I go deeper than the first level, I start getting double-crumbs.

What should/can I do about it?