texts: "The form has become outdated. Copy any unsaved work..." when saving/deleting content

texts:
I have a site where saving or deleting content frequently displays an error message "The form has become outdated. Copy any unsaved work and then reload this page"

It does not seem to matter what type of content.
It happens on new content, as well as editing existing content.
It doesn't matter how long the page is open before Save/Delete is clicked.
There is only one person editing at a time.

Can someone suggest a way to track down this bug as it's proving difficult to find.


texts: Views Autocomplete search multiple values

texts:
I'm trying to have a search filter that searches on 2 values and works with autocomplete list.
This is what I've done:

Installed the module Views filters populate.
added two filters "CNK" and "Naam" (both not exposed) and added them to a OR filter group. I used the operator "Contains any word" for both fields.
Created a filter "Global: populate filters", added the two fields into this and exposed it.

My filter criteria looks like this:

But I don't have the option for autocomplete. How can I do this the best way?


texts:
I have found code to show the total:

How To Show Node Comment Count in node.tpl?

Unfortunately I need to have this value available via VIEWS because I want to list 5 nodes based on total comment count. Short of caching the total as a field in the node (intercepting comment post and incrementing the number) -- what are my options?


texts: How to extract an nid from and EntityFieldQuery

texts:
I'm trying to figure out if a node already exist, I'm using the following code

$query = new EntityFieldQuery;
$result = $query
                      ->entityCondition('entity_type', 'node')
                      ->propertyCondition('type', 'item')
                      ->propertyCondition('title', $full_name)
                      ->execute();

       if (!empty($result['node'])) {
         // do something
       }

The problem is this, when a result is returned, the structure of the result is this

    Array
    (
        [node] => Array
            (
                [96] => stdClass Object
                    (
                        [nid] => 96
                        [vid] => 96
                        [type] => item
                    )

            )

)

I'm trying to get the nid, but I can't figure out how to access it $

result['node'][0]

does not work. How do I get the nid in this situation


texts:
One exposed filter for multiple views

I have an exposed filter which is a date field containing a month and year using the “date module”.

I want to use different views to read the URL and filter with a “Contextual Filter”. This is how the URL looks and I can see it has separated out the Month and Year;

?field_month_value%5Bvalue%5D%5Bmonth%5D=6&field_month_value%5Bvalue%5D%5Byear%5D=2016&=Apply.

I know the contextual filter in views is looking for 062016 so I’m struggling to read the URL in the contextual filter.
Is it possible to use PHP GET in the contextual filter to get the month and year and convert it to 062016?

if(isset($_GET[' field_month_value']))
    return $_GET[' field_month_value'];
else
    return;

I’m using D7. Thanks loads


texts: How to fire a Rule when an image is removed from Image field with unlimited values?

texts:
Working with Drupal 7.58 and File Entity 2.19 and Rules 2.10

First I needed to fire a rule when saving a new file and I found a solution (here).

Now I would like to fire a rule when an user removes an image (file) from a content (Image field with multiple values).

I can not find any event to start working after an image is removed?

EDIT 1 :

Following @Pierre.Vriens "check list approach", I have tried to create a simple rule fired when an image is removed :

{ "rules_verify_pictures_removed" : {
    "LABEL" : "Verify pictures removed",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "TAGS" : [ "image" ],
    "REQUIRES" : [ "rules_conditional", "rules" ],
    "ON" : { "node_update--article" : { "bundle" : "article" } },
    "DO" : [
      { "LOOP" : {
          "USING" : { "list" : [ "node-unchanged:field-pictures" ] },
          "ITEM" : { "list_item" : "Previous list item" },
          "DO" : [
            { "CONDITIONAL" : [
                {
                  "IF" : { "NOT list_contains" : { "list" : [ "node:field-pictures" ], "item" : [ "list-item" ] } },
                  "DO" : [
                    { "drupal_message" : { "message" : "Picture has been removed.", "type" : "warning" } }
                  ]
                }
              ]
            }
          ]
        }
      }
    ]
  }
}

Unfortunately, condition is always False and I get the message even if no item has been removed (One message for each item, unchanged, added or removed)


texts:
After I installed a quiz module on my Drupal 7 site, it asked me to rebuild permissions. when I try to rebuild it throws this error:

I've tried everything that I found online, including:

increasing web server RAM
max_execution_time = 1600
max_input_time = 180
max_input_nesting_level = 300
memory_limit = 512M
disabling batch mode from node.module core file

nothing seems to work.

There are about 600k records in the node table. I know this is a lot, and probably it causes my issue, but what is the workaround? How can I rebuild permissions with this many nodes easily?


texts: Is it possible to display a set of nodes and display it on a blank page without the default template around it? This node data is meant for printing and I want it to display on the screen as it would appear on a printout.


texts: Taxonomy filter on custom view is only showing terms with no children

texts:
I have a form that sets the value for parent terms in a taxonomy vocabulary (web_topic). The variable 'search_topic_options' is stored in the variable table with variable_set.
The form allows the user to select taxonomy terms and this will change the view with hook_views_query_alter and show content associated with the taxonomomy term.  However, view only shows top level taxonomy with no children.
So if I have two terms
node/1 fruit >> apples
node/2 fruit >> bananas
node/3 fruit
node/4 animals >> cat
node/5 animals >> dog
node/6 animals
only node/3 and node/6 appear in the view.
In the function to build the form
     $vocabulary = taxonomy_vocabulary_machine_name_load('web_topic');
     $terms = taxonomy_get_tree($vocabulary->vid, 0, 1);
     $topic_options = array();
     foreach($terms as $term) {
       $topic_options[$term->tid] = $term->name;
     }
     $default_topics = variable_get('search_topic_options');

and the function

function MYMODULE_views_query_alter(&$view, &$query) {
      $view->query->where[1]['conditions'][] = array('field' => "taxonomy_term_data_node.tid", "value" => $topic_options, "operator" => "IN");

}


texts:
I am importing database from Drupal 6 to Drupal 7 with migrate module.

The progress bar is 5%.
The importing data taking a long time.

How could I make it faster? Using Drush?
And the error messages below are having problem?

  Processed 263 (0 created, 0 updated, 263 failed, 0 ignored) in 27.8
  sec (568/min) - continuing with '1cf4f3dbbFile'

  Processed 260 (0 created, 0 updated, 260 failed, 0 ignored) in 27.3
  sec (571/min) - continuing with '1cf4f3dbbFile'

  Processed 258 (0 created, 0 updated, 258 failed, 0 ignored) in 27.5
  sec (564/min) - continuing with '1cf4f3dbbFile'

  Processed 253 (0 created, 0 updated, 253 failed, 0 ignored) in 27.5
  sec (552/min) - continuing with '1cf4f3dbbFile'


texts: How do I view the string pulled from feeds image importer?

texts:
I am importing images from a feed using xPath parser. I think that I have the correct attribute value, media:content@url, but I am getting a Unable to handle the provided embed string or URL. error. My first instinct is to check that I'm getting the proper string. How do I do this? Is there a way through devel to view the imported string? Devel?

The url string I want to pull is https://cdn2.orgsync.com/images/os-photos/s5o0zqk8o29mi46_710.jpg


texts: Change commerce kickstart admin toolbar logo

texts: Hello I want to change the logo of the admin toolbar of commerce kickstart how to do it I cannot find any .tpl with that piece of code for chage that logo


texts:
I am trying to print the sql generated from the view but its not working. Below is the error message I am getting:-

Fatal error: Call to a member function arguments() on a non-object in /var/www/Exaxmple-Site/sites/all/modules/devel/devel.module on line 1834

I have seen many of them using this function to print the sql statement but in my case its giving error. Below is the code how I am calling the function.

function example_views_query_alter(&$view, &$query) {
    if ($view->name == 'search_jobs'){

        dpq($view->build_info['query']);
    }
}

Has anyone experienced this issue before?


texts: Editting field collections with service api

texts:
I am trying to build an phonegap app which uses data of a drupal site. I need to update some informations with using app. For example I have nodes and users need to update field_collections of a node. My nodes have field collection as:

"field_bundle_news":{
    "und":[
    {
        0:{ target_id: "308" }
    }]
}

I want to add some additional items or remove some of them with using service api. For example if I use put method with using "/node" endpoint I can edit some data of that node but I can not edit field collections.

Could anybody give me information about this problem with examples because actually I dont know drupal well I am learning it with implementing a mobile app.


texts:
I am trying to activate an AJAX callback on every change by the user of a text_format field (which is part of a standard bundle edit form). The name of the field in the snippets below is field_reponse

The code works perfectly with other fields (dropdown, textfield), but not for the formatted text areas of type "text_format".

I suppose it is connected with the post-processing of CKEditor. Am I right ? In any case, is there a workaround?

    function MY_MODULE_form_node_shut2_edit_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id){

    // Autosave

    $form['field_reponse']['widget'][0]['#ajax'] = array(
            'callback' => 'Drupal\MY_MODULE\Form\FormAutosave::autosave',
            'event' => 'click',
            'wrapper' => 'autosave_ajax_placeholder',
            'progress' => array(
              'type' => 'throbber',
              'message' => NULL,
        ),
    );

  // Add placeholder for Ajax response markup
  $form['autosave_ajax_response'] = array(
            '#type' => 'html_tag',
            '#tag' => 'div',
            '#value' => t('Placeholder for ajax response'),
            '#attributes' => array(
              'class' => array('hidden'),
              'id' => array('autosave_ajax_placeholder'),
        ),
    );
    }

    return $form;
}

The callback:

<?php

namespace Drupal\MY_MODULE\Form;

use Drupal\Core\Form\FormStateInterface;
use Drupal\node\Entity\Node;

class FormAutosave {

  public static function autosave(array &$form, FormStateInterface $form_state) {

    // Load the shut2 and get changed form element
    $node = $form_state->getFormObject()->getEntity();
    //$curr_values = $form_state->getValues();
    //$triggering_element = $form_state->getTriggeringElement();
    //drupal_set_message($triggering_element));
    // Set and save node with new value for field
    //$node->set($triggering_element, $triggering_element['#value']);
    $node->set('field_reponse', $form_state->getValue('field_reponse'));
    $node->save();

    // Add an Ajax response to avoid error
    $response = [
      '#markup' => t('Sauvegardé automatiquement !'),
    ];
    return $response;

  }

}


texts: Show a block on the user registration form depending on destination parameter

texts:
How can I show a block, or a a mini panel, on the user registration form depending on the destination parameter?

Right now, I'm showing, in a view, a link that leads the users to user/register?destination=courses. This works fine, but I want to show  certain infomation to the still anonymous users who are going to register an account.


texts: Import CSS stylesheet only for specific content type?

texts: I want to use materializeCSS for my Blog content type. Problem is, when I import the stylesheet (I have set up my content type to process all HTML tags), it does not affect only the area of content of that content type, but it "leaks" to the rest of the theme, and changing overall theme look where CSS classes overlap (like default styling of H2 element in Materialize changes the whole look of the theme). Is there a way/module to have imported CSS stylesheet only affect the content it is imported to, but not the rest of the theme? I tried several modules that deal with context and CSS on sites, but neither of them works.


texts: Having a view spitting out a form - the UI way

texts:
Suppose I have a lot of entities that match users to some nodes and the entities have a field called "rating" which is/could be a Drupal list of four possible values ranging from interesting to uninteresting.

I want to have a view that spits out all entities related to the currently logged in user and let him choose his rating for each of them. When he comes back later, he should see his choices and be able to edit it.
How to do that?

I know, that it's somehow possible by writing a module. Ideally, I don't want to do that but rather solve it completely with UI.

(I'm not fixed to the entity approach I described above. If you think it's a bad idea, I'll be happy to hear alternate suggestions.)


texts: How to delete data from a field programmatically

texts:
I have a content type called companies
In this cck I have an Image field and user can add more than one image

I want to make a form programmatically that will display all images in a grid and under each image a button to delete it

Is there is a way to delete it from the node (this specific image only or I should make node_load to get all fields and then check for all images and node_save the node again)


texts: Clear (not reset) Views Exposed Filter Values

texts:
I know i'm looking at this wrong and am running into a wall over and over again on this.

I have a view with an exposed filter in a block.  I am looking to clear / reset the values in the block without reseting the view, so the default reset button in views doesn't cut it.  Any Opinions?


texts: Field collection structure using entity wrapper

texts:
I have a requirement on a site where users have:

Membership periods and
parents or guardians.

Both can have an unlimited number of instances, and are similar in setup.
The first is a Field Collection (FC) with a string list and a date.
The second is a field collection with a string list and two other text fields.

I am making status fields for both fields using a computed field and entity wrapper.

$wrapper = entity_metadata_wrapper($entity_type, $entity);
foreach($wrapper->field_membership_type_periodical as $period) {
...

This one is working as expected and it loops over every "field_membership_type_periodical" FC added to the user, and I can use all other properties of this FC as expected.

When I do the same for the "field_parents_guardian" FC, although I have added items to the list, it doesn't iterate over it and if I dump the field_parents_guardian->value(), it says it is an empty array.

If I dump the whole wrapper object, I find it strange that the "field_membership_type_periodical" is dumped as:

[field_membership_type_periodical] => Array
                (
                    [und] => Array
                        (
                            [0] => Array
                                (
                                    [value] => 1
                                    [revision_id] => 1
                                )

                        )

                )

While the guardian field is dumped as:

[field_parents_guardian] => Array
                (
                    [und] => Array
                        (
                            [0] => Array
                                (
                                    [field_parents_guardian_type] => Array
                                        (
                                            [und] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [value] => Vader
                                                        )

                                                )

                                        )

                                    [entity] => FieldCollectionItemEntity Object
                                        (
                                            [fieldInfo:protected] =>
                                            [hostEntity:protected] =>
                                            [hostEntityId:protected] =>
...

So the first one it seems, is merely a reference to the FC item, which it will probably load when the property is asked for, while the second one seems to be having no reference information, but the object itself already loaded.

Both FCs have been setup in the same way and I can't find any major differences in their settings.
What might cause this strange behaviour in structure and could it be the source of the "empty list issue"?


texts:
I have a Drupal Environment that deploys to GitHub as well as my server. The only issue is I have local database credentials and server database credentials. For now when I do my merge/push, I have to manually change the settings file to make sure I don't connect to the server db and make local changes.

Is there a way to connect to a local database when appropriate and a server database any other time. I tried to use a different connection in the settings.local.php file, but it didn't seem to work.


texts:
I just ran into a situation where I need to run three imports, one after another using the same file providing successful import. Does anyone know how to do this? I looked briefly at Feeds rules but I don't think that will work unless I'm missing something?

Thanks


texts:
I am using the Parsely module and I want Parsely to ignore certain paths. I achieve this by setting the paths to be ignored field in parsely's settings page. I am able to use the * wildcard, and I need to know if there are other wildcards I can use to match paths.
Where I can find a list with wildcards used to match paths?

I ended up looking at the function drupal_match_path which is described here: https://api.drupal.org/api/drupal/includes!path.inc/function/drupal_match_path/7 ; it seems that it only replaces newlines,  and asterisks. Am I wrong? Are these the only "wildcards" available?


texts: Getting data from a view to populate a select drop-down

texts:
I am trying to implement a feature of a fancy drop-down select box. I am going to use the Chosen module to get the functionality I want for the select box. I have a view that lists the data that I want to populate the select box. All I need to do is render a plain old HTML select box with the fields and rows from this view.

How can I do this? Is there a style plugin or anything out there? I personally haven't found one after searching.


texts: Why is my content showing up below other blocks?

texts:
I did some work on my site and now i realize that even though my main page content block is weighted to be at the top, it shows below everything else within that area.

Is there any way someone can take a look and help me figure out why this is happening?

Using
- drupal 7
- omega3 main theme with a custom subtheme

example of my issue: http://www.destinationsound.net/contact

The two blocks "Buy Beats Front Page" and "Banner Ad Top" blocks are the two located above the contact form on the contact page (and other pages)


texts: How to add more Display Suite template suggestions

texts:
If you have Display Suite installed, then on the "Manage Display" tab of any content type you will see template suggestions:

  Possible template suggestions are:

  ds-1col--node.tpl.php
  ds-1col--node-page.tpl.php
  ds-1col--node-page-search-result.tpl.php

None of these suit what I'm wanting to achieve, as I wanted a template to apply to all "search-result" view modes for any content type. So my template suggestion would be:

  ds-1col--search-result.tpl.php

But it seems it's not by default accepted. Which hook can I use to add this template suggestion? I was thinking of hook_preprocess_node and adding my own template suggestion to theme_hook_suggestions but this didn't work as it wasn't using my suggestion on node types which have search_result view mode applied to them. The template was only being used on the ones without any search_result view mode configurations, and even then only normal node.tpl.php variables such as $content was passed to this DS template so I don't think it's the right way to do it.


texts: Where are the watchdog logs located or how do I view the errors created?

texts: How do I view the watchdog logs that are created? Is there an interface to view them with, or are the logs stored somewhere on the filesystem?


texts:
I'm trying to make the comment author name required with this code:

use Drupal\Core\Form\FormStateInterface;
/**
 * Implements hook_form_FORM_ID_alter().
 */
function MODULE_form_comment_comment_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
  $form['name']['#required'] = true;
}

But I can't find the way to do so. How to make the comment author name required for anonymous users?


texts: How do I show multiple nodes on the same page without writing code?

texts:
Let's say on my "contact" page, I want to use a google map (module), contact form (webform module), show our address (node using Address field), and list some social icons. Let's say stacked on top of each other in the "content" region.

What is the easiest way to do that?

Note: this similar question involves code, I want to avoid that:

How do I create multiple nodes on the same page?


texts:
Quick Summary: how do I pass a alias in a URL to a view's context filter, when that view is located somewhere in the site.

I've read dozens of similar articles, but nothing that directly makes this clear for me, so if someone has some insight, I'd be grateful.

I have a Content Type: "Artists" with an pathauto alias as so: artists/picasso
I have a Content Type: Artwork with an entity reference to artists.
A given Artwork might have an alias as such: artwork/minotaur (which is a work referencing picasso)

What I want to do is create a view, have it live here: (artwork/artists/picasso) that shows all Artwork by Picasso.

My trouble is: I can get the view set up, but it only displays correctly if I have the NiD in the URL path. For example: /artwork/artists/1 (with 1 being the Nid for the Picasso node)

How can I get the view to accept "picasso" as an argument to use in the location I want (artwork/artists/) for instance.

I have no trouble if I attach a view to the artists/picasso page as a block. I can show all works by him there, but I want to show works by him in another location.

It seems like this should be obvious, but I cannot find a clear answer as to how to implement. Your help is greatly appreciated."


texts: How to properly test access permissions when generating links?

texts:
I have a page that is only accessible by some people. It's entry in hook_menu contains following:

$items['mymodule/mypage'] = array(
  'title' => 'Edit Product',
  'page callback' => 'mymodule_mypage',
  'access arguments' => array('view mypage'),
  'file' => 'pages/mypage.inc',
);

It works all right, it shows page when it should and throws 403 when needed. Now I need a link to it on some other page. Usually I would just use:

  <?php echo l('My Page', 'mymodule/mypage'); ?>

in tpl.php file where I need it. But I don't want it to be visible for people who will get 403 if they will click it. l() does not test for permissions on it's own. And I feel reluctant about using logic in templates like this:

<?php if ( user_access('view mypage') ) : ?>

    <?php echo l('My Page', 'mymodule/mypage'); ?>

<?php endif; ?>

I always believed than if's in templates are only to provide things like odd/even, marking visible tabs and deciding if markup should be outputted, like if(!empty($header)).

On the other hand, building this in the module and passing to the template seems like an overkill for such a simple task.

So what is the "canonical", cache-safe way to achieve this?

Additional information about what this link really is in this case:

Link is related to the page it is presented on, so block does not make sense.

Leaving it to the user to add link to the menu, so that menu system will take care about permissions, is not applicable, as it violates the "if something have to be done during install, always the same way, and requires no user input of any kind, don't leave it to the user" rule. If there is a way to automatically place it in menu in a way similar to node/%/edit links shown on node/% pages, all right. I'll be happy to accept that as an answer. But my question is general, without assumption that links share front part. In my exact case, they actually do not.


texts: How to specify Views page as parent for menu link?

texts:
I have a module with a menu link which I want to appear as a child of another link in the admin menu. The would-be-parent link is to a Views page if that matters.

This is the contents of mymodule.links.menu.yml:

mymodule.add_location:
  route_name: mymodule.add_form
  parent: views.branch_locations.page
  description: 'Add a foo.'
  title: Add new
  menu_name: admin

I got the views.branch_locations.page machine name for the desired parent link from ViewsMenuLink::getDerivativeDefinitions(), the class responsible for dynamically providing menu links for the Views module.

With the current setup the "Add new" item doesn't appear under "Branch Locations" in the admin menu. The route_name definitely exists, and no error is thrown when clearing cache or rebuilding menus, which suggests Drupal is accepting views.branch_locations.page as a valid parent link somewhere along the line.

But how do I get this item to show up in the menu, as a sub-item of the specified parent? I guess I could use the API to programatically create the link, although I haven't tried it so it might have the same problem, but I want this one in config.

Is the problem maybe that because the Views module declares its links dynamically, I need to do the same for that dynamically created parent to even be available?


texts: HTTP Client Manager $request->getStatusCode() == 200 return?

texts:
When I read this HTTP Client Manager docs on Drupal, I don't understand why it returns the $build when $request->getStatusCode() == 200, is that supposed to be not equal 200? I also copy and paste the code from Drupal docs.

public function posts($limit, $sort) {
    $build = [
      '#theme' => 'mymodule_posts_list',
      '#posts' => [],
    ];

    $request = $this->httpClient->request('GET', 'http://api.example.com/posts', [
      'limit' => $limit,
      'sort' => $sort,
    ]);

    // This is the Part I don't understand.
    if ($request->getStatusCode() == 200) {
      return $build;
    }

    $posts = $request->getBody()->getContents();
    foreach ($posts as $post) {
      $build['#posts'][] = [
        'id' => $post['id'],
        'title' => $post['title'],
        'text' => $post['text'],
      ];
    }
    return $build;
  }


texts:
I've got exposed date filter (with daily granularity) and I want to provide default value for it. I just want to show nodes that have today 'field_date' date by default. The field has both start and end date. I use start date for exposed filter.

How can I achieve it?


texts: Render form element of type text_format, keeping WYSYWIG format

texts:
In Drupal 8 I have a form element fo type text_format, and I need to render it in a twig, but keeping the same format was entered in the WYSYWIG editor. I need to know how to render this element form, keeping the format? this its done in a custom form.

$form['template'] = [
  '#type' => 'text_format',
  '#title' => 'My title',
  '#rows' => 100,
  '#cols' => 120,
  '#format' => 'full_html',
];


texts: Email Customer if Order Contains a Disabled Product

texts:
I have Drupal Commerce configured on my site. Customers can purchase tickets to classes. However, if a class gets canceled, I need to notify any customers who purchased said class that the class is canceled.

I am thinking the best way to cancel a class is to set its status from "active" to "disabled". Once I do this, an email would be sent to any user who purchased said class.

I just don't know how to do this with Rules. Any help would be appreciated.


texts:
I try to adapt my Views block, I add Node Statistics: total views
but it always show Zero, what am I doing wrong? sth is missing


texts: Show pages with a specific template when user is logged-in

texts:
I would like to know if there is a way to show an existing node with a custom template if user is logged-in or has a specific role.

I have tried with a custom module route.

custom_module.presentation:
  path: '/node/1'
  defaults:
    _controller: '\Drupal\custom_module\Controller\myController::custom_presentation'
    _title: 'presentation'
  requirements:
    _permission: 'access content'
    _user_is_logged_in: 'TRUE'

In the page controller, I used the following code.

public function custom_presentation() {
        $myVariables = array();

        $build = [
            'description' => [
                '#theme' => 'my_custom_template',
                '#scriptVars' => $myVariables
            ]
        ];
        return $build;
    }

It doesn't work, though. What is the correct way of doing it?


texts: Initially unchecked radio boxes in a form on load

texts:
I have programmed module having a form (using Drupals's form API) which contains radio checkboxes like this:

$form['r_8'] = array(
    '#type' => 'radios',
    '#options' => array(
        '1' => t('Yes'),
        '0' => t('No')
    ),
    '#required' => TRUE,
    '#checked' => '', // ???
    '#title' => t('a label text ... '),
    '#default_value' => !empty($form_state['values']['r_8']) ?
        $form_state['values']['r_8'] : '',
    '#suffix' => '

'
);

When the page with that form is initially loaded, I want all these radios initially unchecked. I tried to set the #checked property to FALSE, but it doesn't work. Setting the #default_value to, for example, -1, a warning raises (which I can understand, because -1 is none of the provided option values).

Is there any way to load initially the form with the radio's unchecked?

I could not find any information pointer so that's why I ask here.

Thanks in advance!


texts: Search Api, solr, Facet api and facet with operators like > and <

texts:
I am using search api with solr, facet api and search api views.

I have 2 integer fields and I am looking to add facets to allow the user to filter by value, like:

Field 1 larger than:
>10
>50
>100

Field 2 less than:
<150
<100
<50

I have tried with https://www.drupal.org/project/search_api_ranges but I did not have any success. Do you have any recommendations?


texts: How to quickly create Drupal 7 Installation profiles / Distributions

texts:
Dose anyone know how to make quickly and easy installation proflies for drupal 7?
Something like this 5 easy step tutorial but for drupal 7.


texts:
I'd like to create a profile page (visible for every visitor) for every user on my website. There should be displayed some personal information about the user (name, date of birth, bio...) and some things related to their activity on the website (favorite articles, own articles...).

I've already added a lot of fields to users (wich have to be filled in during the registration) in the People > Account settings > Manage fields section and created some views with the Views module in order to display their favorites etc.

I'm struggling with the next step. I'm not sure whether I should create a profile page myself or use the Profile2 module (wich is installed at the moment). First of all, I don't know how I can create a profile page myself. How can I set this up, assign it to a user...? Secondly, I'm not very convinced by the power of Profiles2: I managed to add fields to a user's profile page, but I can't find a way to add blocks or views to it. A nice feature is the 'private' field option, but I'm wondering if that can't be realised without the module.

Can you help me in finding a good solution?


texts: How to show terms that haven't been selected in a view?

texts:
I have a vocab called 'Mounting Options' and I have selected a certain number of terms from this vocab on each Camera node type.

The ones I have selected show on the front-end but I want to show terms that I haven't selected in a separate field.

I can use views reference or a block on the camera node type but I can't figure out how to make the view to show terms that haven't been selected on that node.

Then on the camera node it will have a view block/field called Mounting Options That Don't Work

Then under this, just a list of titles of the terms that weren't selected in the previous mounting options field.


texts: How to create entity reference field from custom entity to another custom entity?

texts:
I'm on Drupal 8 and I created a custom entity custom_entity_one following the Drupal 8 examples, the content_entity_example module.
Now, in another custom entity, custom_entity_two I'm trying to create a BaseFieldDefinition like so:

$fields['cid'] = BaseFieldDefinition::create('entity_reference')
  ->setLabel(t('custom_entity_one ID'))
  ->setSettings(array(
    'target_type' => 'custom_entity_one',
    'multiple' => TRUE,
    'handler' => 'default'
  ))
  ->setDisplayOptions('view', array(
    'label' => 'above',
    'type' => 'id',
    'weight' => -1,
  ))
  ->setDisplayOptions('form', array(
    'type' => 'entity_reference_autocomplete',
    'settings' => array(
      'match_operator' => 'CONTAINS',
      'size' => 60,
      'placeholder' => '',
    ),
    'weight' => -1,
  ))
  ->setDisplayConfigurable('form', TRUE)
  ->setDisplayConfigurable('view', TRUE);

In the add form of the custom_entity_two, the reference field appears, however, it doesn't find any value, even though I have multiple entities of type custom_entity_one.

I thought that it will look for the label propriety of the entity, but it doesn't seem so. What I am missing ? Should I create a custom handler ? I'm not very sure how.


texts: hook_views_data Join by multiple value field

texts:
I need retrive data from a custom table in drupal db by a colum that match with a drupal field in a content type.

I have this table:
equipages
id_equipage|description|price|status

The id_equipage is a varchar and is unique.records example:
cliowave123abs|ABS of my Renault Clio|150|1
cliowave123oth|Some other option of my Renault Clio|10|1
cliowave123air|Air cond of my Renault Clio|250|1
meganeliveabs|ABS of my Renault Megane|310|1

Now I have a content type called car whit a text field equipages (table field_data_equipages) with unlimited values.
In this field I add all the id_equipage of the car.
So for example I have a node (nid: 5) like this:
Title: Clio Wave 2013
equipages:
1. cliowave123abs
2. cliowave123air

Now, When I read the node (nid: 5), I want retrive the 2 records from my custom table
cliowave123abs|ABS of my Renault Clio|150|1
cliowave123air|Air cond of my Renault Clio|250|1

Can I do this whit the hook_views_data()??

Can you help me?!

Thanks!


texts: How do I create a multisite with  shared users and nodes?

texts:
I want to create a multisite with Drupal 7: Every site works separately but users, and nodes must be shared among the sites.

How do I achieve it?


texts: Where are the database username and password stored?

texts:
I'd like to send my Drupal installation to a colleague, but I don't want him to see the username and the password of my database. Where are these informations stored?

I've seen that the username and the password are written in sitename/sites/default/settings.php, but is it the only file with these informations? Is it sufficient if I change the username and the password in this file and then send my colleague all my Drupal files and my database?


texts: How do I change the capitalization formatting of my Taxonomy terms programatically?

texts:
I am using taxonomy terms with the formatting where the first Letter of the phrase (if there is more than one word in the taxonomy) is capitalized, and then the others are not. So, for examples 'Cars and trucks'

In house we have made the decision to change these so that every major word is capitalized, so, 'Cars and Trucks,' excluding minor words like and, it, but, etc - basically the word list that is in the Path auto terms to exclude.

I have thousands of terms. More over, there was a point when the community contributed them so there is no consistency.

Thoughts on how to tackle this without having to edit them one by one?

Thanks


texts:
How do I leverage dependency injection for drupal 8 when invoking my module.install->hook_install() mehtod?

Or do I have to use \Drupal:: method at this point?


texts: Managing custom themes and modules using composer or git

texts:
If I am managing my drupal 8 site using the Composer workflow, how should I go about incorporating/managing custom themes and modules?

Let's say I have a custom theme that I manage using gitlab.

Do I bring in the custom theme using git clone after running composer install for the site?

Or should I add the git repo for the custom theme into composer.json so that the theme is installed during composer install?

What happens if the git repo is private?


texts: Use a custom Table/Storage for a Custom Field

texts:
I want to create a DR8 content field, which has no field tables, and passes the save and load mechanisms to a custom table. Is there a way to do this?
I've been able to prevent saving with:

class MyCustomFieldType extends FieldItemBase {
public function __construct(DataDefinitionInterface $definition, $name = NULL, TypedDataInterface $parent = NULL) {
$def = $definition->getFieldDefinition();
$storage = $def->get('fieldStorage');
$storage->custom_storage = TRUE;
$storage->set('fieldStorage', $storage);
$storage->set('cardinality', -1);
$definition->setFieldDefinition($def);
parent::__construct($definition, $name, $parent);
}

Yet this does not prevent the creation of the tables.
After that, I'm not sure how to implement the custom save functions.
Now I realize, I could do all of this with hooks, even the field widget, but I want to latch into the real drupal mechanisms to do this more cleanly. And I do want the content entities to which the field is connected to perform a task based on the save and load events.

Do I have to force all entities using this field to use a custom storage class, and is this possible, or is there a more minimal intervention?
Are there any experts out there, who have done this, who can help?


texts: Restrict access to a section of the site implemented by a custom module

texts:
I have a site with two different type of users: clients and anonymous users.

I'm currently building custom modules to handle a "client administration" section of the site, where clients are able to change their profiles, modify custom settings, etc. There is a section of the site "client" users are able to access, but regular users are not.

How can I restrict access to that section to only a particular class of user?


texts:
PHP errors will be debugged from "Error Logs".

I am working on ctools ajax popup forms. And I always get ajax error.

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /system/ajax
StatusText: Internal Server Error
ResponseText:

Is there any possiblity to debug AJAX errors just like PHP error logs?


texts: How to inspect a variable when testing with `drush test-run`.

texts:
When testing with my SimpleTests, I want to inspect a variable. var_dump() and the likes are not being rendered in the output of Drush, Xdebug interactive debugger does not work due to the simulated browser being ran in DrupalWebTest.

How can I render, export, inspect or otherwise dump the contents of a variable in my code? I.e. the DrupalWebTest of dpm(), var_export() and such.


texts: Prevent WYSIWYG inline images from showing in Teaser Display

texts: Is there an easy way to stop inline images placed through the WYSIWYG editor from showing on a teaser display? Obviously if I use the summary field the problem is solved, but the client may not be conscious enough to always do that. I am currently outputting a featured image through an image field on the teaser display, so when the inline image also shows up it not only blocks the teaser text, it looks pretty weird.


texts: how to show admin/reports/dblog in terminal ( cli )

texts:
While developing I really like a dedicated screen with all the drupal log messages.
Working on mac or *nix creating a new terminal window and doing a tail -f on the log file would be really nice. So I can do a tail -f on the apache error.log but I want to show the drupal log that is shown in admin/reports/dblog
Where can I find it and or is it possible to let it output to a terminal screen and if so how?


texts: Modify output on a page created with the View module

texts:
I'm pretty new to Drupal and I'm also pretty sure this is a noob question.

I'm trying to build my theme, and in particular I'm trying to manipulate node output to the page, before using the View I simply implemented myTheme_preprocess_page hook and got the content doing $nodes = $variables['page']['content']['system_main']['nodes'];. From that I made all the needed modification.

Now, I want to order the node using the modification date (or whatever parameter) and the View module seems to do just what I want. The problem is now that in my preprocess_page hook I don't have an array of nodes, but all the markup coming from the node.tpl.php file (with missing field of course, because I haven't had the chance to make modification to the output), e.g. insted of $variables['page']['content']['system_main']['nodes'] I have $variables['page']['content']['system_main']['main']['#markup'].

What am I missing? Shouldn't the preprocess_page function return the nodes fro the database (as it did without using View) instead of the markup? Is there another hook I don't know about that allows me to do my preprocessing stuff?


texts:
Yesterday I upgraded from drupal 8 beta 3 to beta 10. I noticed all my ajax calls are now getting error 406 (Not acceptable).

This is my route:

switch_customer.user:
  path: '/profile/get/{template}'
  defaults:
    _controller: 'Drupal\switch_customer\Controller\CustomerController::renderDisplay'
    _title: 'User Info'
  requirements:
    _permission: 'access content'

Controller:

$content = array(
            '#theme' => $templateName,
            '#items' => $items
        );

        $content = render($content);
        return $content;

Ajax call:

    jQuery.ajax({
        type: "GET",
        url: '/profile/get/info',
        success: function (data) {
           jQuery(".profile-sidebar-info").empty().append(data);
            if(cb){
                cb();
            }
        }
    });

I can't figure out what I'm doing wrong? All my calls were fine in the previous beta. Can someone assist me?

Thanks!


texts: Drupal 7 Profile 2 list field optgroup in options

texts:
I came across a requirement to add a list field from profile 2 with optgroups. I know that cck has the "PHP" option where you can return allowed values for a list box and can do optgroup there. But can anyone tell me how to do it in profile 2 select list type field ?

Thanks.


texts: Views Exposed Hierarchical Term Reference Autocomplete

texts:
I am trying to get the widget from this module https://www.drupal.org/project/term_ref_autocomplete to be available as the autocomplete widget for a taxonomy exposed filter on a view

So far I have nothing useful and I'm not sure which is the best way to do it.

Should it be a new filter with a custom plugin in a new module?, Am I going to have to duplicate all the code from the original module ? Can I hook_form_alter on the views_exposed_form ??

Any ideas / help very much appreciated

Thanks


texts: Content Pane on Landing Page not getting Context

texts:
I thought that would be fairly easy: I am working with Panopoly and I have multiple Landing Pages, a Vocabulary, Content Items and a View with a Content Pane.

The user can select one term per Landing Page (term reference) on creating the lp. Also the content items have one of the terms from the vocabulary attached (as well via term reference).

The View lists all the content items with a contextual filter by term. By default the content pane is part of a newly created Landing Page. So, in this simple case, I want the user to pick a term from the vocabulary and subsequently let the content tagged with this term appear on that landing page via the content pane.

What I get working is the contextual filter "Has taxonomy term ID" with "Argument Input: Input on pane config" Now I can pick a term through the IPE.

However for more complex applications I would like to hand the term selected by the user on creation of the Landing Page (in the edit form) to the content pane, so that the user doesn't have to set it on each content pane seperatly.

Any ideas?


texts: How to use Entity Metadata wrappers for fields of a bundle?

texts:
I am not able to access the fields of a bundle using entity metadata wrappers.Here is what I am doing.

//Entity Obj is the loaded entity object which contains a bundle whose fields I am trying to access
$entity_obj;
$wrapper = entity_metadata_wrapper('theentitytype',$entity_obj,array('bundle'=>'thebundlename'));

But I am not able to see the fields of the bundle after doing this.The metadata wrapper function says the bundle_type should be mentioned as key = 'bundle' and value='bundle_name' inside of an array like which I am doing.

What am I doing wrong here?


texts: how to apply tag functionality on drupal 7 nodes?

texts: I want to show tag in my news content type and want to show these tag for specific node in front end with the help of views.


texts: How to auto-yes "drush features-revert-all" ... via terminus

texts:
On a local machine

drush features-revert-all

will convert all features to codebase definition.
On a local machine ...

drush -y

will auto-yes any command.
On a local machine

terminus -y command

will auto-yes as well.

But when combined, even

terminus -y drush -y yoursite.dev -y features-revert-all -y

... will still ask for a key-press.

How can it be forced to run non-interactively?


texts:
So, after studying several examples, I started writing my own module to implement a notification-like entity.

I wanted it to allow separate bundles and be fieldable. This example was a great guide to me.

I've spend several hours and almost brought the wall down with my head due to the following issue though.

My implementation of hook_entity_info_alter:

function mymodule_entity_info_alter(&$entity_info) {
  foreach (notification_types() as $type => $info) {
    $entity_info['notification']['bundles'][$type] = array(
      'label' => $info->label,
      'admin' => array(
        'path' => 'admin/structure/notification-types/manage/%notification_type',
        'real path' => 'admin/structure/notification-types/manage/' . $type,
        'bundle argument' => 4,
      ),
    );
  }
}

to provide admin UI for my bundles, wouldn't work. It would provide "Manage Fields" and "Manage Display" tabs in my /admin/structure/notification-types list page with "broken" links such as /admin/structure/notification-types/manage/%25notification_type/fields.

Furthermore when I tried to manage fields of my bundles, I got a "page not found" error.

When I changed the 'path' array element to this:

'path' => 'admin/structure/notification-types/manage/%',

all of a sudden it worked, the wrong tabs went away and the bundles were manageable. My question: Why?!


texts: Does db_query and db_insert escape input values? prevent sql injection?

texts:
I've been reading through the documentation, but I feel like it's always a little bit vague on this, perhaps I'm missing something.

function foomodule_my_hook_menu_callback($unescapedUserInputString) {
    $sql = "select name from {foo_table} where bar=:inputString";
    $result = db_query($sql, array(':inputString' => $unescapedUserInputString));
}

Is the above code vulnerable to an SQL injection attack? Or will :inputString get appropriately escaped to make it safe for SQL? (I know I need to sanitize it for proper values in my implementation, but I'm just referring to the SQL safety)

What about with db_insert()?

$insert_id = db_insert('foo_table')
                ->fields(array(
                    'name' => $unescapedUserInputString,
                ))
                ->execute();


texts: Getting [current-page:title] in webform hidden field from panels

texts:
Using page manager panels, I created a custom page that populates info taken from several content types. On that page, I have a webform block (created from the original webform content type).
I need to get the page title in a hidden field that would be used as a email subject in the form parameters.

The [current-page:title] token does not return anything, I get a blank email subject.
To test out what happens I tried to use that token in regular text field as a default value: same result. However, the [current-page:url] token does work.

Configuration is :

Webform 7.x-4.14
Panels 7.x-3.9
Page manager 7.x-1.11
Token 7.x-1.7


texts: How to access an entity loaded out of the cache

texts:
I am working on a Drupal 8 modules which should push a http response header based on a value stored in an entity or a list of entities.

The module was originally done for D7 and now is in porting up to D8.

The main problem is that by using the Entity Cache in D8 any hooks are bypassed, which had been working in still in D7. So nor hook_entity_load or hook_entity_view are fired but only a single time before the entity is placed into the cache.

We might need to create an extra entity/node to a list and this should then eventually change the pages html-head section and the http response header.

So is there any chance to get informed (by a hook or event) for ALL entities be shown on a page (details or list/teaser)? Or can we store some information to a "cached" page (so a page that was assembled only out of cached entities) ?


texts: How to Setup Multilingual Section (Not Site)

texts:
I support an existing site that contains a multilingual section.  We have a link to this section on the homepage and it just consists of some basic pages.  Now I have been asked to incorporate one of our existing content types into this section (i.e. Content Type A - English, Content Type A - Spanish).  The node/add form and the node display pages all need to be in Spanish.  I also need to be prepared to support additional content types, additional languages, etc.

So I'm experimenting with the Locale and Internationalization modules.  The problem I'm having is that it seems to be designed for an entire multilingual site.  I need the site to remain an English site.  For example, when an anonymous user creates a spanish node, the user is returned to homepage:  www.example.com/es.  The homepage is not going to be translated.  User should be returned to www.example.com.  I also noticed all of the links on www.example.com/es include the es prefix in the path.

Question(s):  Is this the right approach to a multilingual section?  If so, is there a way to configure Drupal to understand that www.example.com/es, www.example.com/es/mypage, etc. do not exist?


texts:
According to the documentation, these are the available variables:

$items: An array of field values. Use render() to output them.
$label: The item label.
$label_hidden: Whether the label display is set to 'hidden'.
$classes: String of classes that can be used to style contextually through CSS. It can be manipulated through the variable $classes_array from preprocess functions. The default values can be one or more of the following:
field: The current template type, i.e., "theming hook".
field-name-[field_name]: The current field name. For example, if the field name is "field_description" it would result in "field-name-field-description".
field-type-[field_type]: The current field type. For example, if the field type is "text" it would result in "field-type-text".
field-label-[label_display]: The current label position. For example, if the label position is "above" it would result in "field-label-above".

However, I've attempted doing a print_r($items,1) (and the others above) and it seems none of these are actually available to me within my views-view-field--field-download.tpl.php where download is the name of the field I am templating.

  Notice: Undefined variable: items in include() (line 12 of
  /var/www/sites/path/to/templates/views/views-view-field--field-download.tpl.php).

What am I missing?

EDIT:

I also found this documentation, but am having a similar problem. It mentions I should have $fields, $view, and $row... but I am having trouble accessing some of these.

I am able to get some information I need using $row->_field_data["nid"]["entity"]->..., but how do I output the field as it would normally be output? I have conditionals set up and want to output it as it would normally be on one condition, and output something else on another condition. I am able to get the data for the conditions to work properly... but can't figure out how to output the field as it would normally be.


texts: Using rules how to redirect to a url + element id

texts:
After saving a node, I am redirecting to another form using rules.

I want to be able to append this value "field_article[und][0][nid]" to the url that I am sending to.  This corresponds to a select list id. Basically, I want this id appended to the url when I redirect.

Any ideas?


texts: How to fix doxygraph error when generating Drupal UML from XML?

texts:
I need to document my project and I'm using doxygen for that. The documentation has been created and works perfectly, what I need now is to generate the class diagrams of my entire project code base.

I've doxygen generate an XML version of the source code documentation, doxygraph claims that once I have that I can generate my class diagrams with ease. I've tried the example included in the library and it does a pretty good job.

I've tried to generate my project class diagrams but I get the following error:

Attribute (type) does not pass the type constraint because: Validation failed for 'Doxygen::XML::Compound::Linkedtext' with value undef at reader Doxygen::XML::Compound::Param::type (unknown origin) line 8
Doxygen::XML::Compound::Param::type('Doxygen::XML::Compound::Param=HASH(0xb4026f0)') called at doxygraph/doxygraph/lib/Doxygen/XML.pm line 228
Doxygen::XML::_member_parameters('Doxygen::XML::Compound::Memberdef=HASH(0xb3f57b8)') called at doxygraph/doxygraph/lib/Doxygen/XML.pm line 197
Doxygen::XML::_do_operation('Doxygen::XML=HASH(0x8e85ab0)', 'addressfield_views_handler_field_country', 'Doxygen::XML::Compound::Memberdef=HASH(0xb3f57b8)') called at doxygraph/doxygraph/lib/Doxygen/XML.pm line 165
Doxygen::XML::_do_class('Doxygen::XML=HASH(0x8e85ab0)', 'Doxygen::XML::Compound::Compounddef=HASH(0xb3f4e94)') called at doxygraph/doxygraph/lib/Doxygen/XML.pm line 136
Doxygen::XML::parse_compound('Doxygen::XML=HASH(0x8e85ab0)', 'docs/xml/d7/d76/classaddressfield__views__handler__field__country.xml') called at doxygraph/doxygraph line 17

How can I fix this?


texts: Why does module_invoke() return an empty array for anonymous users?

texts:
I'm using module_invoke to return an array of blocks in a hook_block_list_alter

function MY_MODULE_block_list_alter(&$blocks) {

 $foo = &drupal_static('foo');
 foreach ($blocks as $key => $block) {
  if ($block->module == 'bean') {
   $bar = module_invoke($block->module, 'block_view ', $block->delta);
   $foo[] = $bar;
  }
 }
 return $foo;
}

When I'm logged in with admin privileges, $bar will be an array containing $bar['content'], $bar['subject'] etc. But for anonymous users, the array is empty. I can't find any reason for this, hopefully I'm missing something obvious and easy (to others!).


texts: footer link to a page with hash changed content ready

texts:
I have set up the pages like this (using some php and jquery):

On this page, I have some tabs, using jquery to hide and display the content on click each tab. The url will change to #this_tab_name accordingly.

For example, www.mysite.com/thispage#tab1 will be showing the content of tab1 only when someone clicks tab1 on thispage.

Now I want to set up a footer site map, I want some of the menu items link directly to urls like www.mysite.com/thispage#tab1 and also display the right content while hiding the rest. Embedding "thispage#tab1" will only link to thispage, but without the right content.

Any suggestion? Many thanks!


texts: Access denied at password reset page when logging in

texts:
I run a D7 site that for some reason is not allowing users to reset their passwords, but only on the server. The email with the one-time login link is sent just fine, but when the user clicks on the link, they get a 403 page with the generic "You are not authorized to access this page" message. I know this must be server environment specific, because with a clone of the site on my local machine (sending the email using the SMTP module), it works just fine. I'm guessing the issue happens in user_edit_access(), where it is comparing the value of $account->uid with $GLOBALS['user']->uid, but that's just a guess at this point.

Any suggestions as to what the problem could be? The servers are using Varnish, so that's one thought that came to mind, but I'm not sure how to figure that out.

Thanks.


texts:
When I'm on a taxonomy term page, I want to list all my taxonomy in that vocabulary.

So I have a taxonomy term ID in the URL. I need to lookup which vocabulary has this value, than list all the values of that vocabulary.


texts:
I have created a block to display flash content. All it needs a a variable to be assigned dynamically from the content to flashVar. I created a field called myfile path in the custom content type. Which is just a text pointing to the path of file. I also created a block and below is the code inside the block.

<?php
$myFilePath = field_get_items('node', $node, 'field_myfilepath');
?>

Floorplan Basic

                To view this content you need Adobe flash player (v11+) plug-in installed on your browser

Get Adobe Flash player

I am getting this error

EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7663 of C:\...\www\includes\common.inc).

Can any on tell me how to get the value of the field in this block? I am totally new to drupal.


texts: How to implement User roles for specific taxonomies?

texts:
Some info about what I'm working on:

I have a taxonomy on my site called 'countries'.
I have three 'countries' terms: "UK", "USA", "AUS"
I have created a new user role in Drupal 7 called 'countries_admin'.

What I am trying to achieve:

I want to be able to add three countries_admins and assign each one a country (and be able to easily add more users when I add more terms).
The user should only be able to create/view/edit/delete nodes which are in this term.

My question:

Any suggestions about how to do this?

Note: I have tried Taxonomy Access Control but it seems that I'd have to create a new user role for each country, which isn't really what I wanted.


texts: Why does include() call PublicStream::stream_set_option()?

texts:
I am including a PHP file that in stored in the public:// directory.
(Yes, I know that's generally a bad thing, but there are reasons, and this is done on a local development server.)
I get this warning.

User warning: stream_set_option() not supported for local file based stream wrappers in Drupal\Core\StreamWrapper\LocalStream->stream_set_option() (line 356 of core/lib/Drupal/Core/StreamWrapper/LocalStream.php).

I don't understand what's going on.
Why is include() calling PublicStream::stream_set_option()?


texts: How to export user's content via features to new site in Drupal 7

texts:
Can anyone tell me how to export contents of users through some contributed modules?? like features,because I have a site which has 100 users,all contents are migrating through features but user's info and their images are not being moved with features module..

Your solicited help is needed.


texts: How can I automatically upload images on file selection rather than pressing the upload button?

texts:
I have a custom content type to allow users to upload images.  I'm trying to keep the interface as simple as possible.

The content type contains a single image field.  This works, but some users don't understand that the image has been uploaded because they don't see it after selecting (to preview the upload, the upload button must be pressed).  Is there a way to skip/automatically press the upload button so that an image is shown immediately after a file is selected?

In other words, immediately after selecting a file, instead of the following picture (where the path is shown but hard to read in Firefox):

I'd like the preview display to be shown like this:


texts: Why does my site whitescreen with content?

texts:
I am creating a drupal 8 site.  I have only installed two modules so far, Devel and Varnish.

However anytime I try to create an article and save it any page on the site that isn't an admin page is just White screen of Death.

I have no idea what could be causing this problem.  Why would it cause the white screen?


texts: Set user profile fields that are not visible on registration form

texts:
Very new to Drupal, first of all. I'm working on a custom module for user registration (we're still in Drupal 6) that I'd like to do a few things:

Geocode the user-supplied zipcode to get a city/state (uses US as default country as we're a regional news organization, but lets users pick another one if desired). This part works nicely.
If this is successful, add those values to the respective user profile and save them (these are hidden fields on the profile module settings). This part does not work
If this is not successful, add an error to the zipcode field. This works nicely as well.

I've been assuming that I could use form_set_value on a validation hook, but I realized that this may not work because the fields aren't visible. So I tried making one visible, but it still didn't work, so I'm at a loss.

Here's what I have (leaving out the geocode stuff, as it works well):

function module_name_form_user_register_alter(&$form, &$form_state) {
  $form['#validate'][] = 'module_name_user_register_validate';
  drupal_add_js(drupal_get_path('module', 'module_name') .'/module_name.js');
}

function module_name_registration_user_register_validate($form, &$form_state) {

  $zip = $form_state['values']['profile_zip'];
  $country = $form_state['values']['profile_country'];
  $country = countries_api_iso2_from_name($country, COUNTRIES_API_FORMAT_ISO2); // uses the countries_api module to get country code

  if (!isset($country) || $country == 0) {
    $country = 'US';
  }
  $postal_check = get_city_state($zip, $country); // geocode the zip/country combo as json

  $location = json_decode($postal_check);
  $city = $location->postalcodes[0]->placeName;
  $state = $location->postalcodes[0]->adminName1;

  if ($city == '' || $state == '') {
    form_set_error('profile_zip', 'You entered an invalid zip code. Please try again. If you are not in the United States, make sure you chose your country correctly.' );
  }

  form_set_value($form['profile_city'], $city, $form_state);
  form_set_value($form['profile_state'], $state, $form_state);
  form_set_value($form['profile_country'], $country, $form_state);

}

Any ideas?


texts: Site wide invalid Imagepaths withe Amazon S3 and IMCE

texts:
I'm working on an already existing page to make some updates. In the process Drupal 7 changed the images paths in the nodes, resulting into wrong paths to images.

The only thing I did that would explain this behavior was an update to the Amazon S3 module, to be able to use IMCE again.

A correct path would be:
amazonaws.com/projectfolder/subfolder/image.png

The wrong path that is used now is:
amazonaws.com/subfolder/image.png

This is a problem on the whole site. I can be certain that the URL on the S3 didn't change. What I think I would need to do is to add the "/projectfolder" folder to the url.

I can't think about a tool or way to do that.

I would appreciate some help, or insight.

Thank you!


texts:
I'm working on a site with the Recipe module for cooking recipes installed on it. According to the linked page, it's possible to import and export recipes to and from that module. Unfortunately, I can't find where that can be done. Does anybody know how to do it?

I'm fairly new to Drupal, so I'm sure I'm just overlooking something obvious...


texts: Calling a class defined from another module

texts:
I am calling the method defined in a class implemented from another module using the following code.

use Drupal\module_name\MyClassName;

$instance = Drupal\module_name\MyClassName::getinstance($host, $user, $pass);

My code doesn't work, as I get an error about a class not found. What am I doing wrong?

The class is contained in module/src/controiller/controller_name.php.


texts: Blocking JS from being executed more than once

texts:
JS lines of code are often executed more than once.
How can this ( annoying ) behaviour be blocked?

    (function ($, Drupal) {
  'use strict';

  Drupal.behaviors.recherche = {
    attach: function (context) {

      var filters = $('.block-facets-ajax');
      filters.wrapAll('

');
...........

what's expected:

what's happening:

EDIT: trying to apply the doc given in comments, unsuccesfully

Drupal.behaviors.recherche = {
    attach: function (context) {

      var filters = $('.block-facets-ajax',context);
      filters.once('behave').each(function () {
        $(this).wrapAll('

');
      });

EDIT2 : dependancies added to the library.
        It is not working as it is not entering the .each :

(function ($, Drupal) {
  Drupal.behaviors.myModuleBehavior = {
    attach: function (context, settings) {

      console.log('this is logged');
      $('.block-facets-ajax', context).once('myModuleBehavior').each(function () {
        console.log('this is not logged');
        // Apply the myModuleBehavior effect to the elements only once.
        $(this).wrap('

');
      });

    }
  };
})(jQuery, Drupal);

EDITED 3 :
if i remove context in the selector then .each is executed but instead of wrapping all elt together it 's wrapping each element individually.
This is the case no matter i use wrapAll or wrap method.

(function ($, Drupal) {
  Drupal.behaviors.myModuleBehavior = {
    attach: function (context, settings) {

      $('.block-facets-ajax').once('myModuleBehavior').each(function () {
          $(this).wrap('

');
      });

    }
  };
})(jQuery, Drupal);

what i am trying to achieve :

what's the outcome:


texts: How to restrict access to specific content types by role?

texts:
In D8 core you can either set permission for anonymous users to view all or non publish content, but not set permission different by content type.

I've found this that looked promising, but the functionalities doesn't work for this:

http://drupal.org/project/content_access

Any others suggestions for how to solve this?


texts:
I am trying to have more options visible in a select-box widget.

I have tried #size, to no avail.

function videomodule_form_video_node_form_alter(&$form, &$form_state, $form_id) {
    $form['field_video_taxonomie_video']['#size'] = 15;
}

Is there a way to do this with the form API?


texts:
I have a content type of Company, which can have multiple Images. In the company node, i want to display a slideshow of the images which belong to the company.

For some reasons, instead of storing the images in a field of Company, i created another content type of Image, which references the Company through an Entity Reference field type.

So now i have a view of Images which i want to filter using the reference field. I tried adding an Contextual Filter, but the filter cannot find the related images, which i think because the url is transformed. For example if the company has the name The Company, the path becomes /company/the-company (i am using automatic alias).

How can i filter the images correctly in the company page? Thanks.


texts: How can I update webform_submission uid in the table, after which the anonymous user has registered?

texts:
I'm a graphic design, and I just started using Drupal 7.

I have a form created with webform, which collects data entered by the user, after sending, the user is directed to the purchase page. The stages of the purchase is successful if both the user and logged in, whether the user is anonymous.

Here's my problem, from the control panel of Drupal 7 when I go to see the results of the webform, if the form has been sent by the user logged in, see the user's name, is so I know who did it then submitting the form. While it has been the anonymous user, in the results I see anonymous user even after the user has registered and recognized.

For clarity I describe what it does with this form, these are the steps that the user to fill out the form webform:

1) Fill out the form webform (in this form there two fields of the form "webform commerce")
2) after sending the form you will be directed during the cart / checkout, at this stage the user enters the email for the registration, if it is anonymous.
Everything works perfectly.

I noticed that the field in the table webform_submission uid inside the database remains at 0 even after the user has registered.

Browsing around the net in the blog / forum / drupal.org
I left this tutorials: example tutorial
so I'm starting to use hook_webform_submission_presave in a custom form.
So how do I fill the uid after the form has been sent?

This is the code:

            <?php
/**
 * @file
 * Questo modulo server per collegare utente anonimo con il webform inviato.
 */
// hook per ottenere l'ID dell'utente che ha inviato il modulo webform
function mio_modulo_webform_submission_presave($node, &$submission) {
  // Ottengo l'id dell'utente.
  //$user = user_load($submission->uid);
  global $user;

  $user->uid;

}
?>

Sorry for my english
Thanks in advance for the help


texts: If a pager is missing, then appears when using another theme, does that narrow the problem to the original theme?

texts:
I have a pager missing from one page, while visible on another. These pages are generated by my custom module. I'm working with a custom theme that's been hacked together (wasn't me!) When I switch the theme to Bartik everything works as expected.

Here is the query function:

function query_activities($tid = NULL, $did = NULL) {
  $record_count = variable_get('promo_list_count');
  $query = db_select('node', 'n')->extend('PagerDefault');
  $query->fields('n', array('nid', 'title'));
  if ($tid) {
    $query->leftJoin('taxonomy_index', 'ti', 'ti.nid = n.nid');
    $query->condition('ti.tid', $tid);
  }
  $query->condition('n.type', 'activity_promo_list');
  $query->condition('n.status', 1);
  $query->groupBy('n.nid');
  $query->orderBy('n.sticky', 'DESC');
  $query->orderBy('n.promote', 'DESC');
  $query->orderBy('n.changed', 'DESC');
  $query->orderBy('n.created', 'DESC');
  $query->limit($record_count);
  $results = $query->execute()->fetchAll();
  return $results;

I have a function that wraps the query results in theme arrays and can post the whole thing if needed (it's 120 lines) but I think the only relevant part is:

  $content['pager'] = array(
  '#theme' => 'pager',
  '#weight' => $count,
  '#quantity' => 5,
  );
  krumo($content['pager']);
  return $content;

The krumo() dump shows the pager array populated on both pages (pager visible & pager missing).

Does this narrow the problem to theme layer?

What should I look for to fix or diagnose the missing pager?


texts: How to add image field to module install file

texts:
How to add image field to database in module install file? I found on api documentation, that type is image, so tried the following code:

function profile_bg_schema() {

$schema = array();

$schema['profile_bg'] = array(
  'description' => 'The table containing backgrounds',
  'fields' => array(
    'bid' => array(
      'description' => 'The primary identifier for the background.',
      'type' => 'serial',
      'unsigned' => TRUE,
      'not null' => TRUE,
    ),
    'image' => array(
      'description' => 'The background image.',
      'type' => 'image',
      'not null' => TRUE,
      'default' => '',
    ),
    'class' => array(
      'description' => 'The class added to div.',
      'type' => 'varchar',
      'length' => 255,
      'not null' => TRUE,
      'default' => '',
    ),
  ),
  'primary key' => array('bid'),
);

$schema['profile_bg_unlock'] = array(
  'description' => 'User - background - active table',
  'fields' => array(
    'uid' => array(
      'description' => 'User ID.',
      'type' => 'int',
      'unsigned' => TRUE,
      'not null' => TRUE,
    ),
     'bid' => array(
      'description' => 'Background ID.',
      'type' => 'int',
      'unsigned' => TRUE,
      'not null' => TRUE,
    ),
    'status' => array(
      'description' => 'The primary identifier for the background.',
      'type' => 'int',
      'unsigned' => TRUE,
      'not null' => TRUE,
      'default' => '0',
    ),
  ),
);

return $schema;

}

First I was getting an error about image field, now module becomes ON, but nothing changes in database.

---- EDIT ----
Error below. It looks like Drupal do not know what type of field should create in database.

   Notice: Undefined index: image:normal w DatabaseSchema_mysql->processField() (linia 205 z C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\drupal\includes\database\mysql\schema.inc).
    PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT NULL COMMENT 'Background Img.', `class` VARCHAR unsigned NOT NULL DEFAU' at line 3: CREATE TABLE {profile_bg} ( `bid` INT unsigned NOT NULL COMMENT 'bg ID.', `image` DEFAULT NULL COMMENT 'Background Img.', `class` VARCHAR unsigned NOT NULL DEFAULT '' COMMENT 'css class for the background.', PRIMARY KEY (`bid`) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'background table'; Array ( ) w db_create_table() (linia 2720 z C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\drupal\includes\database\database.inc).


texts: I want to override Drupal 8 paths (routes) like node/{node} or taxonomy/term/{taxonomy_term} with custom panels variants. Is it possible?


texts: How to let the admin select multiple users

texts: Probably something like that table with checkbox in people menu. Is there something like that in drupal, some API for creating this type of table? It needs to have pager, because i can't load all users. Is there any way, how to achieve this, or i need to do it by my self?


texts: How to change Stars in Webform-star module?

texts: I have just implemented the Fivestar option in one of the evaluation form created by webform, I used the Fivestar module and Webform-fivestar module. But now I want to change the stars with different layout or design. In some of the article i read that we can change in manage display tab of the contentype but that option is not applicable for webform components. So that changing option is not available in the webform configurations. So please help me how to achieve this.


texts: How can I disable parent menu link to be non-clickable?

texts:
Nolink,None,Separator and other things does not work when added to URL path.
Have also Installed menu module but that did not help.
Its Drupal 7.

Thank you for your co-operation!


texts: Create multiple Menu blocks from the same menu

texts:
In Drupal 7, the Blocks page contained a link for 'Add menu block', from where you could create multiple menu blocks of the same menu.
In Drupal 8, menu blocks seem to be generated automatically, however only one-per-menu exists (two, if you have are using Superfish).
I have a main menu block that needs to be rendered in different ways, depending on the Content Type being displayed.
Most of my content has a menu position assigned, however one type does not as it has over 300 sibling nodes; I need the same menu to appear, just showing one level higher. The sidenav will normally show the parent page, with the current page and all sibling pages underneath:
Parent page
 - child 1
 - child 2
 - child 3 <current page>
 - child 4 etc...

For the special Content Type, I need this structure:
Grandparent page
 - Parent sibling 1
 - Parent sibling 2
 - Parent
 - Parent sibling 3 etc...

This would have been pretty simple in D7 - have I missed something?
How can I render the same menu at different levels? I'd rather not have to clone the entire menu using Entity Clone just to expose part of it.


texts: $content: reworded about manipulating this variable

texts:
I see that this:

<body>
  <div id="content-area">
    <?php print $content; ?>
  </div>
  <?php print $page_closure; ?>
  <?php print $closure; ?>
</body>

Will actually render all the content of a page. So all those other variables are only for regions. But, remove that one variable, $content and no matter how much else PHP one has in the template, nothing gets rendered.

I'm trying to specifically call the primary and secondary links in certain areas of a page.tpl.php template.

My attempts moving around a code block within the standard page.tpl.php file haven't worked; wherever I put the secondary, they always appear below the primary.

For instance, this:

<?php
   print theme(array('links__system_main_menu', 'links'), $primary_links,
   array(
      'id' => 'main-menu',
      'class' => 'links clearfix',
       ));
?>

Doesn't matter if it's after the secondary in source order... it always appear on top of my secondary links. Even if I put it below the $footer variable. So how can I get those links to be called in a different area of the page.tpl.php template?

I have no blocks in any region. I realize I can just use CSS to reposition the menus, but that doesn't seem right to move them across/down a page that kind of distance.

What is snippet/way to pull out specific content from the $content variable, specifically the primary and secondary links and place them within the page.tpl.php template where I would like them?


texts:
I have eight pages using this same webform.
My webform have two fields: email and "get current URL".
My Thank you page (when submitted webform) URL link state sid = "88".
I DO NOT want "thank you page" same design, so I decide to get URL sid and search for "get current URL" through database. From the result will base on my design.

Here is my question: I do not know how to retrieve data from database? OR Is there anybetter way to achieve what I want?


texts: Term page doesn't show nodes when terms are added in a field collection?

texts:
I'm using field collection in my content type Recipe.
In my field collection, there is a term reference (ingredient) and a text field.

When I create a Recipe, I add terms (ingredients) with the field collection. But when I visit the term page (ingredient X), no recipes are listed even if this ingredient is used in a recipe.

I think the problem comes from Field collection : the term is linked to the field collection but not to the created content.

How do I display all the recipes linked to an ingredient  when I visit a term page ?

Sorry for my bad English, i'm not sure i'm clear.


texts: How to disable form button on ajax callback?

texts:
I have a button with ajax callback and I want to disable it on button click without page reload. Preferably inside ajax_function but it's not obligatory.

$form['my_button'] = [
  '#type' => 'button',
  '#ajax' => [
    'callback' => '::ajax_function',
    'wrapper' => 'my-button-wrapper',
  ],
  '#attributes' => array(
    'class' => array('glyphicon', 'glyphicon-shopping-cart'),
  ),
  '#submit' => ['::ajaxButtonSubmit'],
];


texts: Update manager fails to move files from tmp

texts:
I've this configuration:

Fedora Core 21 (64bit)
vsftpd: version 3.0.2
Drupal 7.41

I have a unix user called user1 who has home dir /home/user1
and Drupal root is at /home/user1/www

The Drupal temporary directory is at /home/user1/tmp

I'm trying to install the Corporate Clean theme using the update manager but it fails giving this message:

  corporateclean Error installing / updating File Transfer failed,
  reason: Cannot move
  /home/user1/tmp/update-extraction-5345b836/corporateclean/comment-wrapper.tpl.php
  to /www/sites/all/themes/corporateclean/comment-wrapper.tpl.php

I checked ownership and permissions of /home/user1/tmp/update-extraction-5345b836/corporateclean and it's owned by apache and permissions are like so:

  755
  drwxr-xr-x 7    755 apache 4096 Dec  9 07:05 corporateclean

Is this the right permissions / user for the extracted directory by the update manager? The owner / permissions is causing the issue and not allowing the move.


texts: How do I duplicate a menu item properly?

texts:
Say I need to have the same menu item appear in two different menu trees or at two different level of the same menu. How do I properly "duplicate" a menu item using hook_menu()?

To my understanding, if the original item has its path corporate/contact-us, then putting in the hook_menu() the same path will override the original rather than create a copy. Am I right? How do I clone, or should I say: alias, a menu item programmatically?

(And I need to do that for each language defined for my site.)

I have used this piece of code, using hook_menu_alter() which for some reason did not work; once an item has been created it did not change its label and produced buggy, combined paths (/en/polish/path). Hence the attempt to unset the custom item first.

function MYMODULE_menu_alter(&$items) {
  global $language;

  $custom_items = array(
    'pl' => 'firma/kontakt',
    'en' => 'corporate/contact-us',
  );

  foreach($custom_items as $langcode => $path) {
    unset($items[$path]);
  }

  switch ($language->language) {
    case 'en':
      $items['corporate/contact-us'] = array(
        'title' => 'Contact Us',
        'page callback' => 'node_load',
        'page arguments' => array(285),
        'access callback' => TRUE,
        'menu_name' => 'main-menu',
        'type' => MENU_NORMAL_ITEM,
      );
      break;

    case 'pl':
      $items['firma/kontakt'] = array(
        'title' => 'Kontakt',
        'page callback' => 'node_load',
        'page arguments' => array(286),
        'access callback' => TRUE,
        'menu_name' => 'main-menu',
        'type' => MENU_NORMAL_ITEM,
      );
      break;
  }
}

Similarly, the following hook_menu approach did not work for me, with similar problems. This one was even worse in that the 'fake paths' with '2' in the title where visible to the user in the status bar.

function sint_newsnavi_menu() {
  global $language;

  switch($language->language){
  case 'en':
    $items['corporate/contact-us2'] = array(
      'title' => 'Contact Us',
      'page callback' => 'drupal_goto',
      'page arguments' => array('node/285'),
      'access callback' => TRUE,
      'menu_name' => 'main-menu',
      'type' => MENU_NORMAL_ITEM,
    );
    break;
  case 'pl':
    $items['firma/kontakt2'] = array(
      'title' => 'Kontakt',
      'page callback' => 'drupal_goto',
      'page arguments' => array('node/286'),
      'access callback' => TRUE,
      'menu_name' => 'main-menu',
      'type' => MENU_NORMAL_ITEM,
    );
    break;
  }
  return $items;
}


texts:
can you please tell me what is the best way to make default space name in Open Atrium when I login? I need in main menu name of space for example Example01, not Spaces.

Thank you in advanced


texts: How do I set the value of a date and time field with Behat?

texts:
I am trying to test my site with Behat.
On my entity edit form, I have a Datetime field that uses the Date and time widget.  I want to use the Date and time widget because I need to set the time in increments of seconds, which I cannot do with the Select list widget.
I want to set the value of this field with a step like this:
And I assign the date "yesterday" with timezone "Asia/Tokyo" for "edit-field-datetime-MYFIELD-0-value"

To do so, in FeatureContext.php, I wrote the following code.
  /**
   * @Then I assign the date :date with timezone :timezone for :field
   *
   * Assign the specified date to the element with the given CSS.
   */
  public function assertEnterDateForField($field, $timezone, $date_string) {
    $date_field = $field . '-date';
    $time_field = $field . '-time';
    // Drupal stores timezones as UTC so we need the base time in UTC.
    $datetime = new DateTime($date_string, timezone_open('UTC'));
    // We need to convert the UTC time to the user's timezone.
    // This is because when saving the entity,
    // Drupal will convert the value to UTC.
    $datetime->setTimezone(timezone_open($timezone));
    $date_output_string = $datetime->format('mdY');
    $time_output_string = $datetime->format('hisA');
    $datetime_debug_string = $datetime->format('Y-m-d\TH:i:sO');
    $this->fillfield($time_field, $time_output_string);
    $this->fillField($date_field, $date_output_string);
    echo "Datetime $datetime_debug_string
    Field set to
    date: $date_output_string
    time: $time_output_string";
  }

On my local environment (lando, running the Standalone Chrome container), this code works as expected; the date/time is set correctly for the field.
However, on my test server (Pantheon/CircleCI, running the Behat Chrome Extension, it doesn't work.  The debug information is correct; for example:
  │ Datetime 2020-08-13T09:00:00+0900
  │     Field set to
  │     date: 08132020
  │     time: 090000AM

However, the date/time is not actually filled in, so when the entity is saved, the date/time has not been updated.
How can I set the value of a field that uses the Date and time widget with Behat/Mink/Drupal Extension?


texts:
I am working on one already created drupal site. In themes folder it has one tpl.php file, Where theme is done to display the content. Now it is as follows

print $content

And all the fields of cck are displayed properly. But I want to access every field like Title, Body etc. I have tried with $content['title'], But nothing is displayed.

Can anyone please tell me how to access different fields in my tpl file. I am using Drupal 6.

Thanks in advance.


texts: I am trying to use AJAX with Drupal 6. How do I determine the URL I am trying to contact?

texts:
I looked at the documentation here and it left me a bit confused. I don't need to access any files, I am just returning the date that is on the server to my Javascript code. (I don't want the date/time from the user's perspective)

The example gives this in the javascript portion of the example. This example seems to already know where get should call to get the response back. I am not sure what the URL would be on my server to just talk to my php code.

$.get('/photos/get/photos/' + parseInt(this.id, 10), null, imageDetails);
        return false;


texts: Is there a way to run a Drush command using a module? I tried exec("drush ..."); but I have found out it is not recommended. Is there any other command I could use?


texts: Download genarated file from private folder

texts:
Ich wrote my module, that generates and save my file under private://myprivatfolder/myfile.txt
Now, I don't know how to download or make direct-access-url for this file after generation.

$url = url($path);
drupal_goto($url);

is not right way, I would work only with public folder.


texts: How to display a list of the top used taxonomy terms and the recent nodes submitted to them?

texts:
Im on d7. Im trying to make a page on my site that displays the top 5 most used taxonomy terms and the most recent nodes that have been tagged with them. Something like this:

    ---Term a---
      ---Node 1 (title)---
      ---Node 1 (byline)---
      ---Node 1 (teaser)---

      ---Node 2 (title)---
      ---Node 2 (byline)---
      ---Node 2 (teaser)---

      ---Node 3 (title)---
      ---Node 3 (byline)---
      ---Node 3 (teaser)---

    ---Term b---
      ---Node 1 (title)---
      ---Node 1 (byline)---
      ---Node 1 (teaser)---

      ---Node 2 (title)---
      ---Node 2 (byline)---
      ---Node 2 (teaser)---

      ---Node 3 (title)---
      ---Node 3 (byline)---
      ---Node 3 (teaser)---

   ---Term c---
      ---Node 1 (title)---
      ---Node 1 (byline)---
      ---Node 1 (teaser)---

      ---Node 2 (title)---
      ---Node 2 (byline)---
      ---Node 2 (teaser)---

      ---Node 3 (title)---
      ---Node 3 (byline)---
      ---Node 3 (teaser)---

      ---ETC---

Does anyone have any suggestions?


texts: Summary/Trimmed field in view doesn't include Read More link

texts:
I have a view, and the key display points are:

Format: Unformatted List (I'm adjusting the views look through CSS)
Show: Fields

One of the fields to show is Body (so, a textarea.) When I choose to display it as "Summary or Trimmed", and set the trim length to, say, 600, it trims it fine, but it doesn't show a "Read More" link to the content's page. Is there something I'm missing?


texts: Pass Information from Webform Note to Form

texts:
I'm creating a webform and I would like to create a bunch of checkboxes between two dates:

Now I could just use the checkboxes element, but this is going change every year. I would like to generate it from a value on the webform node page.

This would most conveniently be a date range field, but I'm thinking of using jQuery/JS to take the values of the date range field and format it as a value in the default values. However, I don't know how to get the default values and make them output the checkboxes.

I also saw the "days" predefined element in the checkboxes, but unfortunately, that only displays Sunday, Monday, Tuesday....Saturday.

How would I program this?


texts: the article can't show the image in the full mode in drupal 7

texts:
my article can't show images in the full view but only in the teaser view, even go to the article content type setting, in the full mode, it is fine that I allow to show the image.

any idea why?


texts: How do I add a checkbox to the performance page and have it repopulate?

texts:
I would like to add a checkbox of my own to the performance page in the Drupal administration.  I am using hook_form_alter like this:

function nci_assay_depot_form_alter(&$form, &$form_state, $form_id){
    switch($form_id){
        case "system_performance_settings":
            $form["caching"]["nci_assay_depot"] = array(
                "#type" => "checkbox"
                ,"#title" => "Refresh Assay Depot Cache when 'Clear All Caches'"
                ,"#default_value" => 1
                ,"#disabled" => 0
                ,"#description" => null
                ,"#weight" => -2
            ) ;
        break;
    }
}

It will display on the page, but the value will not be saved.  Any thoughts?


texts: Is there any callback hook like hook_node_insert / hook_node_update when saving a bean block?


texts:
While migrating our site, we have put them on 'SSL required'.

How can we best force, when editors save datas containing http link, a conversion to https ( or //).


texts:
I have a dropbutton in an admin view. It's currently got links built using URL::fromRoute

I want one of these links/buttons to work asynchronously.

This is what I currently have:

$dropdownButtons = [
    '#type' => 'dropbutton',
    '#links' => [
      'a' => [
        'title' => $send_verification_link_text,
        'url' => $send_verification_email_url,
      ],
      'b' => [
        'title' => $this->t('Remove person'),
        'url' => $remove_person_url,
      ],
    ],
  ];


texts:
Say a user has a list of  2 favorite books , one with taxonomy term "adventure" and one with taxonomy term "art". (n favorite books, related with m taxonomy terms)

How to automatically display a list of all books with taxonomy term "adventure" or "art" (or m taxonomy terms)

The steps could be :

step 1 : build the list of the user's favorites books (views, flag,
filter : this is OK)
step 2 : get the list of all taxonomy terms referenced by theses nodes,
step 3 : get the list of all books referencing one or several of the taxonomy terms listed at step 2

My question is how to build a view which do these 3 steps.

Thanks


texts: Drupal 7 html.tpl.php vs page.tpl.php variables questions/thoughts

texts:
First off I am very new to Drupal but not very new to other frameworks and CMS's (symfony, cake, codeigniter, wordpress)

So I am trying to make a theme and it seems like I want to put a lot more stuff in html.tpl.php then drupal wants me to?

Like for example $logo, why is that not available in html.tpl.php, I don't want to include that in every variation of the page template, do I?

Or should I be thinking of page.tpl.php more as the wrapper than html.tpl.php.

I basically think the page template should only display content for that page, anything around that (ie, nav, logo, footer) should be in html.tpl.php. but drupal seems to be set up opposite? Why does this feel wrong to me?


texts:
I wanted the error messages from the webform to be customised. So I wrote following piece of code in template.php of my theme.

function sandesh_preprocess_node_webform(&$vars, $hook) {
 if ($vars['node']->nid == "41" && is_array($_SESSION['messages']['error']))   {
 $errors = &$_SESSION['messages']['error'];
 $find = 'email';

 for($idx = 0; $idx < count($errors); $idx++) {
  if (substr($errors[$idx], 0, strlen($find)) == $find) {
  $errors[$idx] = 'Please enter the email field';
  break;
   }
 }

}
}

But this is not working. Is there something wrong in the code? Or is there  any other method to get customized error message in the webforms ? Thank you


texts: It's possible to create constants or similar and use them inside a node description or title in Drupal 7

texts:
Let's say we have a download page in a multilingual Drupal site, and we want to define the download version, for example '1.1.0' and a download URL 'http://myweb.com/setup_1_1_0.exe', to use it on the distinct languages nodes for the download page, inserting them as a tag or similar on the tittle and body of the node.

How could it be done in Drupal 7?


texts: Need a list of third party video services that i can offload the conversion and serving up of my private videos?

texts:
Can anyone help me to narrow down a list of third party video services that i can offload the conversion and serving up of my private videos?

Requirements are:

Already have a Drupal 6 module that integrates the api (Also has a D7 future)
Must allow the video to only be viewed on my Drupal site. Not on their site (e.g. not viewable on YouTube)
HTML 5/Flash fall back (would be nice, but not necessary.


texts: Local server doesn't work, directly web on local server go to www

texts: I have a local host and website designed by drupal, I downloaded a website to local host but when I want to open local web directly go to www not to local, please can help me?


texts: Is there a way to inherit a Drupal installation profile?

texts: I want to create a Drupal installation profile based on an existing one. Is there a way to inherit the parent profile so I don't need to duplicate modules, dependencies, libraries definitions ?


texts: Unwanted  tags inserted before and after a rendered $item

texts:
First time creating a custom template for a field.

I've created the field--field_phone_number.tpl.php and know it's working.

I'm trying to make it so when a user enters a phone number, it displays as a link with the "tel:" prefix so that readers can click the link on their mobile phones to call directly.

Here's what I have:

<div class="<?php print $classes; ?>"<?php print $attributes; ?>>
  <?php if (!$label_hidden): ?>
    <div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>:&nbsp;

  <?php endif; ?>
  <div class="field-items"<?php print $content_attributes; ?>>
    <?php foreach ($items as $delta => $item): ?>
      <div class="field-item <?php print $delta % 2 ? 'odd' : 'even'; ?>"<?php print $item_attributes[$delta]; ?>><a href="tel:<?php print render($item); ?>"><?php print render($item); ?>

    <?php endforeach; ?>

Only problem is that it actually prints out something like

3035551212

Where are those
 tags coming from?

I see many posts around about those tags coming from WYSIWYG editors and the like, but I'm not using one of those. I've also seen a suggestion that this is related to a default line-break converter, which I'd rather not turn off.