texts: I have been trying to embed a location map in a Views Slideshow. The slideshow is made with the Media module and it already contains an embedded youtube video and photos whose view is controlled through a thumbnail pager at the bottom of the slideshow. I want to be able to add a location map as the first slide of my slideshow. Is this possible? Could you please provide me with some information on this topic?


texts: How to show link only to users in specified group

texts:
I have a link and I want to show it only for users which are in group Pracownik. I use https://www.drupal.org/project/og and the Drupal version is 7.

How to make a link visible only to one group of users?


texts: Create a view to show active members in last 7 days

texts:
I want to create a view that shows the number of unique users that posted a node or commented on a node in the last 7 days.

If I create a view of nodes and add "author" and "comments" relationships and then aggregate and show "distinct users" it will only show users that have created a node, not commented on a node.

If I create a view of users I can't add relationship for "nodes" or "comments".


texts: Setting the default value of an entity form radio button using hook_form_FORMID_alter

texts:
I have written a custom Drupal 7 module which needs to set the value of a radio button of an entityform based on a value queried from the database.
I have tested hook and it is working as i am able to set a text field with in the form using:

$form['field_sem_submitter_id']['und'][0]['value']['#value'] = $user->uid;

I have tried, to no avail, to set the radio using the following and various other suggestions:

$form['field_sem_pledge_currency']['und'][0]['value']['#value'] = '2';
$form['field_sem_pledge_currency']['und'][0]['value']['#value'] = 'currency_bitcoin';
v$form['field_sem_pledge_currency']['#default_value'] = 'currency_bitcoin';

I have searched and tried numerous other suggestions on the web with no success.
Any suggestions greatly appreciated.


texts: Module to view node in a grid layout with the ability to quickly change the reference

texts:
I'm looking for a module which allows me to have a grid layout presenting nodes in a certain view mode (like teaser or even a module own one).
In the end it should look something like this:

(The picture shows some node references. I didn't prepend all titles, but all blocks should be rendered the same way, except the first one, which should be rendered bigger)

Now I could do this with either views or panels, but I want to add as many blocks as I want and the first one should be rendered differently as the rest. Note that there are pictures in the node which should also be shown in different size.

I already tried it with Mini Panels, but the problem with Mini Panels is, that I can only append one node - and it is a little tricky for end users who should be able to change the node reference quickly.

Is there a good module which comes with such a solution?


texts: Mapping description imagefield to title imagefield

texts:
Because of imposibility to add a description field to an imagefield in D8, I would to map thecontent of the D6 description field to the D8 title field of the imagefield.

But it actually doesn't work.This is my actual code for my yml:

  field_galerie_image_vdl:
  -
    plugin: sub_process
    source: field_galerie_image_vdl
    process:
      target_id:
        plugin: migration_lookup
        migration: upgrade_d6_file
        source: fid
      alt: alt
      #mappage de la description à la place du titre car pas encore possible dans D8
      title: description
#      description: description
      display: list
  -
    plugin: skip_on_empty
    method: process

If someone knows.
Thanks


texts: Drupal module versioning and compatiblity. How to know what to use?

texts:
Sorry if this is a really stupid question or if I should have been able to find it.

When it comes to module versions, how exactly does it work? Say for example the Openlayers module that has several other sub-modules, modules it integrates with, as well as modules/libraries it depends on.

Lets say open layers has the following available versions:

Reccomended:
 7.x-2.0-beta5

Other Releases:
 7.x-3.0-alpha0

Dev Releases:
 7.x-3.x-dev
 7.x-2.x-dev

Now it's time to install dependencies lets use "views module" for this case. Lets say it has these versions...

Recomended:
 7.x-3.6

Other:
 7.x-2.16

Dev
 7.x-3.x-dev

So my question is do module updates/versions have any correlation on dependency modules? So in this situation if I install the Recommended : 7.x-2.0-beta5  of OPENLAYERS, am I suppose to install the Recommended :  7.x-3.6  of views or should I alternately install the version that has the 7.x-2.16 since both modules would then be in the  same 2.x stage.

From what I've read patches are for minor releases like 7.x-2.{something) and only a major release would make a developer change to the next version 7.x-3.x. Also how does alpha, beta versions fit in with all this??? How is it that a alpha version of something is recomended over a non aplha or beta version?

The versions I've listed above are not real, but just an example. Hoverer, recently I do have issues with Openlayers and another module that required it. Both these modules had several stable versions and dev releases. Sine the sub-module is stable I'd assume it had a release that worked at one point in time with Openlayers. Is there a way to know this. Or is there a way to download using something like drush to chose dependency modules that are tested against openlayers version-whatever without problems.

Sorry for the long and horribly formatted question I hope someone can either answer or point me in the right direction to get some good documentation on this


texts: Remove id alias appending to confirmation page URL

texts:
I have created a basic page in Drupal 7 that acts as a custom confirmation page for a web form. The url needs to be clean and static because it will be tracked by Google Adwords.

The problem is that an id is appended to the url, see example below. http://www.dynasty-autoglass.com/contact-confirmation?sid=230

The URL is supposed to end with only /contact-confirmation

How am I able to remove this id?

Thank you.


texts: Commerce File won't let anyone download files

texts:
I've got a website running Drupal 7.32 with Drupal Commerce. I want to let users download files so I've got the Commerce Licence and Commerce File modules installed and I've them working for a while, and then I updated everything to the latest versions and now I can not download any files that have been licensed - even as the administrator. All I get is an access denied page whenever I try to click the download link, but the link does appear in the View for licensed files.

I have checked the permissions and everything there seems correct - and I've also look at the following issue, which is the issue I am having, with no avail: https://www.drupal.org/node/1288156

Does anyone have a solution to this problem or even a work around?

Thanks in advance


texts: Redirect to custom URL while logging in user through Webform

texts:
I am hoping to register/login a user based on the values entered in Webform and then redirect to a URL based on a user type.

The problem is that everything works but the redirection. Seems like this line is the culprit:-
$form['#submit'][] = 'my_submit_handler_for_registration';

Any help?

Thanks

Here is what I have done:-

function MYMODULE_webform_submission_insert($node, $submission) {

  $submitted_data = $submission->data;
    $full_name = $submitted_data[1][0];
    $user_name = $submitted_data[2][0];
    $password = $submitted_data[7][0];
    $fmno = $submitted_data[3][0];
    $role = $submitted_data[4][0];
    $where = $submitted_data[5][0];
    $when = $submitted_data[6][0];

    // For Redirection
    variable_set("redirect_to", $role);

    // Need to populate following data for registering the user.
    if ( empty($user_name)) {
      echo "
No Username Found.
";

      exit();
    }
    $user_data = array();
    $user_data['init'] = $user_name;
    $user_data['mail'] = $user_name;
    $user_data['name'] = $user_name;

    $user_data['field_full_name']['und'][0]['value'] = $full_name;
    $user_data['field_fmno']['und'][0]['value'] = $fmno;
    $user_data['field_interviewee_role']['und'][0]['value'] = $role;
    $user_data['field_where']['und'][0]['value'] = $where;
    $user_data['field_when']['und'][0]['value'] = $when;
    $user_data['pass'] = $password;
    $user_data['status'] = 1;

    $user_data['roles'] = array(); // You can specify any roles which you need

    $tomorrow_date = time() + (60 * 60 * 24);
    $date_after_two_days = time() + (60 * 60 * 48);

    // Check if any previous user with the same email exists?
    $previous_user = user_load_by_mail($user_name);

    if(!empty($previous_user)) {
      echo "
Another user exists with the same email. Please login or enter another user.
";
    }
    else {

      //It'll add a new user here.
      $user = user_save('', $user_data);

      /*
      $arr = array ('name'=>$user_name,'pass'=>$password);
      // Finalize user login (modify $_SESSION, set login time in db)
      user_login_finalize($arr); */

      $form_state = array();
      $form_state['uid'] = $user->uid;
      //$form_state['redirect'] = 'registration';
      user_login_submit(array(), $form_state);
      //$new_user = user_load_by_mail($user_name);

    }

    return theme('register', array('output' => $submission));

}

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

  if ($form_id == 'webform_client_form_31') {
     $form['#submit'][] = 'my_submit_handler_for_registration';
  }
}

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

  $redirecting_to = variable_get("redirect_to");
  if($redirecting_to == "McKinsey Solutions") {
    $redirecting_to = "frontmso";
  }
  else {
    $redirecting_to = "";
  }
  $form_state['redirect'] =  $redirecting_to;
}


texts: Error Drupal 7 body content missing when adding new content

texts: Hi my drupal 7 creating a new content, suddenly the body field disappear? and i dont know what cause this? is there anyone can help me


texts: How to add field update your password in drupal webform?

texts:
I want to add three fields in webform:

Current password
New password
New Password Again

Current password should be existing password and  last two fields(New password ,New Password Again)should update only if  current password is correct(validated). In short I only wants to add "update your password functionality" in my website using webform .

Any Idea how to do this ?


texts: Adding a custom Token so i can use in Webforms

texts:
I am having the smart-ip module installed. It allows me to get User country, city etc very easily like this:

echo $_SESSION['smart_ip']['location']['country_code'];

I want to use this as a token replacement in webforms field. But I have no idea how to do it.
Got confused after googling. I should do the hooking in template.php? How do i do it? :/


texts: Using Rules and Rules Once per day how can I check when a node's date has expired?

texts:
I have a content type which has an end date field, once the current date is past this end date then I need to change a boolean field to 0 on that particular node.

I am really struggling to get anything close to working (using the Rules module), I am getting values such as this in my Data selectors:

node:field-category:0
node:field-category:1
node:field-category:2
node:field-category:3

I don't know why these delta values are there or how to get rid of them, every video tutorial I watch the persons data selection is working perfectly.

I understand I need to drill down by adding a Rules Condition to check for a particular field on the node type in question. But, like I said, I am just getting these delta values.

Now coming to the loop and I am unable to get the value from the end date for the very reason that it is not there.

Even when I have gotten close to having the loop working, when I look for the boolean field which needs to be altered if the current date > end date, this is also showing me several values with numbers after them.

What am I doing wrong?


texts:
I have a custom block made in the edit-mode of a node, and I would like to have it linked to a confirmation screen. So I figured out that I'll use confirm_form(). After a few days, I'm not able to get this function working.

Is there anyone who can tell me what I do wrong or what I'm supposed to do?

This is the switch statement that defines my actions when hitting the button.

case ACTION_FICHE_OFFLINE :
    if ($form_state['buttons']['5']['#value'] == ACTION_FICHE_ONLINE) {
      $form_state['values']['status'] = '1';
        drupal_set_message('FICHE ONLINE', 'warning', FALSE);
    }
    else {
      confirm_offline($form, 'Are you sure?', 'dashboard', t('This action cannot be undone'), 'Confirm', 'Cancel', 'fiche_offline');
      $form_state['values']['status'] = '0';
      drupal_set_message('FICHE OFFLINE', 'warning', FALSE);
}
    break;

The formal parameters for confirm_offline() are the following ones:

$form
$question
$path
$description = NULL
$yes
$no = NULL
$name = 'confirm'

What code should I use in confirm_offline()?


texts: Block vs Context positioning facet block filter

texts:
I have a Drupal Commerce site with faceted search (Search API + db index + views and facet blocks).
My setup is as follow :
- Catalogue view (based on my search index)
- Facet filters block placed with context when i'm on my catalogue View page

Everything worked fine since a few days when we realized the facet block wouldn't show up in our catalogue page anymore.

BEFORE :
I placed my blocks with context, everything would work fine.
Block appeared with list of filters

NOW :
Nothing changed in my context setup, but my facet block appear with nothing (no filter).
We didn't commit (we use feature) anything related to the Search settings, facet or context.

WORKAROUND (dirty?) :
We managed to correctly display our facet blocks by doing the following :

I set up the block visibility in the Block configuration page by placing them in the right region (the same as the one in my context), and no page / url filter
My Context is activated when I go on my catalogue page, and it works fine.

[edit]
Actually, I just need to make 1 facet block available to any region to have all my context blocks appear correctly. WEIRD !!!

If reset the facet block configuration in the Block configuration page (display them in no region), my context would activate, but display facet with no filter ...

Any idea what's wrong here ?

Thanks


texts: Twig error "Uknown image_style filter", but the filter isn't missing

texts:
I'm migrating a site to a new host.  On the front end, I see...

Twig_Error_Syntax: Unknown "image_style" filter. in Twig_ExpressionParser->getFilterNodeClass() (line 57 of /var/www/prod/web/themes/mytheme/templates/paragraph--paragraph_image_block.html.twig).

However, I checked the filter referenced in the error, and the filter is not missing.  I see the filter at admin/config/media/image-styles and its machine name is spelled correctly in the template.  I have tried rebuilding the cache.  Why is this filter unknown?

Here is line 57 in the template:

{% set img_url = file_url(content.field_paragraph_image['#items'].entity.uri.value | image_style('max_1300x1300')) %}

The 'max_1300x1300' filter isn't missing.


texts: What are costs/benefits of integrating Phing, Jenkins together with Drupal?

texts:
I would like to improve my testing environment automation in order to reduce effort needed for quality assurance tasks.

I heard about Phing and Jenkins and read overview information but still I am not convinced it is worth investing the set up effort currently.

Can you explain the costs and benefits of installing Phing, Jenkins based continous integration environment while I am using Drupal, Drush, Git, Simpletest and bash scripts already in dev, staging, production set up ?


texts: Return to calling page after save button

texts:
I am putting together a simple restaurant menu function for a site. I have a menu content type imaginatively called 'restaurant menu item' I use for each dish. I have created a restauranter's "dashboard" for them to update their site including the menu. With views, I have created a table containing the full menu, a row for each dish and on each row there's an 'edit' and 'delete' button. Their function is pretty obvious I'm sure.

When the edit button is clicked, it goes to the (themed) edit content page. I've used the more buttons module to provide a cancel button. If the cancel button is pressed, then the user is returned to the table page and can continue editing. However, if she clicks on save it simply displays the updated content (and not particularly nicely) and it's not easy for the user to get back to the table and continue their updates.

I was wondering if there's a simple way of returning the user to the table page after the save button? Note if the edit is performed from the more standard drupal content listing admin pages, then it should return to the content listings pages there.


texts:
I have an exposed filter that shows products which have multiple entity references. The user should be able to pick some number of entities and the view should show entities containing all those references. In my mind that should mean changing the in operator on the where clause to an all operator.

function hook_views_query_alter(&$view, &$query) {
  if ($view->vid == 7) {
    dpm ($query);
    if (isset($query->where[1]['conditions'][2]['operator'])) {
      $query->where[1]['conditions'][2]['operator'] = 'all';
    }
    dpm ($query);
  }
}

However this seems to have no effect. the operator is changed from the first dpm to the second and it does break if I enter some other value in the all does not change the results. Do I have the wrong operator? Or am I going about this all wrong?

[edit]
According to Payou the function should look like

function falk_products_query_products_alter($query) {
  $conditions = &$query->conditions();
  $conditions2 = &$conditions[0]['field']->conditions();
  $conditions3 = &$conditions2[0]['field']->conditions();
  $my_query = &$conditions2[0]['field'];
  $my_conditions = &$my_query->conditions();
  dpm ($my_query->conditions());

  if (isset($my_conditions[2])) {
    foreach ($my_conditions[2]['value'] as $target) {
      $my_query->condition($my_conditions[2]['field'], array($target), 'in');
    }
  }
  dpm ($my_query->conditions());
}

Which at the dpm's give me arrays that look good to me but dont work if more than one value is input.


texts: Globally providing title attribute to links

texts:
Recently I've been asked by a SEO-managing person to copy the text of all links within main menu into their title attribute. As my menu is run by OM Maximenu and contains mostly Views, it was relatively easy to add it in corresponding view, but I started to wonder if there's a way to globally alter links in such a way. It would have to be performed in PHP level (template.php or a module). I haven't found a hook though like "drupal_link_alter", except for some old Drupal 5 function?

Any insights?


texts: breadcrumb containing a link to a path that's deeper than the one of the page it's on

texts:
On my site i have the weird problem that for one of the menu pages the breadcrumb shows as one lvl deeper than the page it's on.

So it's showing: Home > Page i'm on > subpage i'm not on
instead of: Home > Page i'm on

In addition, contrary to other pages i have, the bottom level of the breadcrumb is clickable which makes no sense, as that's supposed to be the page i'm on (wel it's not due to the above described error, but anywho).

I've no breadcrumb-modules installed.  I do have a hook to modify the breadcrumbs like so:

function mytheme_breadcrumb(&$variables) {
  if (isset($variables['breadcrumb']) && !empty($variables['breadcrumb'])) {
    $crumbs = '
';
    $breadcrumb = $variables['breadcrumb'];
    $array_size = count($breadcrumb);
    $i = 0;
    while ( $i < $array_size) {
     $crumbs .= '
' . $breadcrumb[$i] . '
';
     $i++;
    }
    $crumbs .= '
';
    return $crumbs;
  }
}

Doesn't look like the theme_breadcrumb function is responsible, as it uses the values it's getting from drupal by standard.

Anybody any ideas as to what might be causing this?


texts: Printer: Is it possible to show print PDF and ePub url link for each node on Views?

texts: I have Printer module installed on Drupal 7. Let's say I have a view that lists all the articles in table format. I would like to have the PDF and ePub url link next to each article as a field. Is it possible?


texts:
I am looking for a module or a method in Drupal 7 that can achieve the following:

I have a field in a content type called e.g. "Is the Ladder Attached".
It has a select list, YES or NO.

When a user selects YES then I want it to populate another field next to it saying "No Hazard".

When a user selects NO then I want it to populate another field next to it saying "Hazard".

How can this be done?  I tried the conditional field module and it doesn't seem to be the right solution.

Thanks


texts: pass php page to page callback with hook_menu

texts:
I'm developing a module where I use hook_menu.

I know that I can pass to 'page callback' a function that return string with HTML/PHP code.

function mymodule_menu(){
    $items = array();

    $items['test'] = array(
        'title' => 'page test',
        'description' => 'my test',
        'page callback' => 'my_page',
        'access arguments' => array('access content'),
        'type' => MENU_NORMAL_ITEM,
        'menu_name' => 'main-menu',
    );

    return $items;
}

function my_page(){
    return '
hello
';
}

How can I pass a whole PHP/HTML page as an argument to 'page callback' => '[my_page.php]' instead of creating a string inside my_page() function ?


texts: Send Commit message on Acquia Hook by Slack

texts:
Based on Automating with Cloud Hooks I've implemented  Slack notification based on Simple Slack Notification Bash Script

site="$1"
target_env="$2"
source_branch="$3"
deployed_tag="$4"
repo_url="$5"
repo_type="$6"

FILE=$HOME/slack_settings

if [ -f $FILE ]; then
  # Load the Slack webhook URL (which is not stored in this repo).
  . $HOME/slack_settings

  # Post deployment notice to Slack

  if [ "$source_branch" != "$deployed_tag" ]; then
    curl -X POST --data-urlencode "payload={\"username\": \"Acquia Cloud\", \"text\": \"An updated deployment has been made to *$site.$target_env* using branch *$source_branch* as *$deployed_tag*.\", \"icon_emoji\": \":acquiacloud:\"}" $SLACK_WEBHOOK_URL
  else
    curl -X POST --data-urlencode "payload={\"username\": \"Acquia Cloud\", \"text\": \"An updated deployment has been made to *$site.$target_env* using tag *$deployed_tag*.\", \"icon_emoji\": \":acquiacloud:\"}" $SLACK_WEBHOOK_URL
  fi
else
  echo "File $FILE does not exist."
fi

It works correctly, it sends the message,

  An updated deployment has been made to mysitexxxx.dev using tag dev.

But What I need is the commit's message,How can I get commit message on Acquia post-code-update?


texts: I'm new to object oriented php. Trying to query database but not getting any results

texts:
I am trying to query a table in my DB and am not able to get any results back.  Here is the code I am using:

function get_agent_info($agent) {
        $query = db_query("SELECT * FROM tls_connect_stage_timer WHERE '".$agent."' IN ('start_processing_agent' || 'end_processing_agent')");
        $rows = array();
        foreach ($query as $result) {
            $rows[] = array(
                $result     -> applicant_id,
                $result     -> stage,
                $result     -> event_start,
                $result -> event_end,
                $result     -> start_processing_agent,
                $result     -> end_processing_agent,
                $result     -> start_request_ip,
                $result     -> end_request_ip,
                $result     -> gwf,
            );
        }
        print_r($rows);

    }

I have already used a method like this to get info:

$results = db_query("SELECT * FROM tls_active_applicants WHERE `".$searchParams."`='".$input."'");
$rows = array();
                 foreach($results as $result){
                    $rows[] = array(
                        $result -> first_name,
                        $result -> last_name,
                        $result -> gwf,
                        $result -> visa_type,
                        $result -> current_stage,
                    );
                 }

The second one works fine, where with the first one, if I print_r($rows) it returns an empty array.  Why is the foreach loop starting in the first example but not the second?  I've tested the query, and it works fine. Also any links that could help me understand how the foreach loop is working would be greatly appreciated.  I assumed that since it's saying $query as $result, I would be able to pull a single value saying something like $query->stage but that didn't work.  I'm assuming because there are several entries I would need to do something like $query[0]->stage but I don't really know how that works when it comes to calling properties..


texts: I just today decided to try out using Search API instead of just the regular exposed filters within views. However, even with the Search API Views module enabled, my indexes don't appear to be exposed to Views as filters. Documentation on integrating Search API and Views is relatively non-existent, so I can't really go to that for help. In fact, the documentation for the integration module states that "Most features should be clear to users of Views." Well apparently not. Any help would be appreciated.


texts: General Content Search of Content type Exposed form

texts: Is there a method of giving a user the ability to search any term within all content of a particular node through an exposed form. For example you have the content type of, say - Business, with the fields of - CEO and Base of Operations. Could you give them a simple search that looks for a match in both those fields?


texts: How to specify the latest album in a images view?

texts:
I am using node galleries. I've created a view where I display all the images that are of type "gallery_image". The problem is, I need to now get it to only show me the values for a specific album, where the specific album is whatever is the most recently created album.

So in this image:

First prize would've been if I could say:

operator : is equal to : value

And make the value something like [[LATEST_ALBUM]] and have that somehow magically figure it out. It would be easy to do if I could add PHP there.

Any ideas how to get around this?


texts: Display Node or Entity Reference Content

texts:
I can't seem to figure this one out.

Goal: To allow the back end user to select from a list of "leasing contacts" when creating a "property." And have the view show the full content of the "leasing contacts" selected.

So far I have a Content Type for "leasing contacts" with several contacts in there.
I have a Content Type for "properties" which has an Entity Reference field that references the "leasing contacts."
This works great on the back end, the user can select from the numerous "leasing contacts" when creating the "property".
HOWEVER, I can't seem to understand how to get a view to show the full "leasing contact" content. The view only displays the "leasing contact" name in plain text. How can I get the view to show not only the "leasing contact" name, but all of the other field content that's in the entity.

Any pointers would be much appreciated!


texts:
For a site I am working on I am using the address field. Each node can have multiple addresses and at least one is required. All the addresses are in the US so I set the default to the US.

When the user enters and address a new field shows up with the default country address. Whenever the go to edit the page a new one with just the country is also their. They save and soon there is a bunch of addresses with only a country. This causes other parts of the site to break.

I need a way to either make the default in the form none or to delete addresses that have only a country when the node is saved/updated.

I didn't have luck with either but admitably I am new to using hooks. Below is my most recent attempt by using the node presave hook.

function postal_default_node_presave($node) {
  if ($node->type == 'micro_property') {
    foreach($node->field_micro_address[LANGUAGE_NONE] as $address){
        dpm($address);
        unset($address['country']);
        unset($address['element_key']);
        $found = false;
        // Cycles all submitted address field components for the country to see if any have been filled
        foreach ($address as $value) {
            if (!empty($value) > 0) { $found = true; }
        }
        // Empty the address and location arrays if the fields were blank
        if (!$found) {
            dpm('not found reseting');
            $node->field_address = array();
            $node->field_location = array();
        }
    }
    return $node;
  }
}

The dpm messages are posting what I would expect but the node being saved is not.


texts: Is there a module for automatic menu translation?

texts:
I need to automatically translate menu items into all enabled languages when created.
Is there a module for that or how can I do it programmatically ?


texts: what variable can i use to identify a specific pages

texts:
i need to load a diff stylesheet depending upon which page the user is on.

when using:
     themename_preprocess_page(){kpr(&$variables;)}

i thought i'd see a pageId or pageTitle in which i could use for a conditional statement but i'm not seeing those variables. am i overlooking something? what can i use to uniquely identify a page so i can the use drupal_add_css()?

i guess i could do at the node level? but the stylesheet i need to load is really a page level thing.

can someone advise on the best way to do? big thanks in advance


texts: What's the difference between the 2 different Rules pages in admin?

texts:
What's the difference between the Rules shown under Structure > Content Types > My type > Rules and Config > Workflow > Rules? The first one is from Entity Rules (= "Instead of adding entity related events to Reaction Rules you are able to select which Rules will fire from the bundle management page").

These pages don't look the same. When do I use one instead of the other (to send emails when nodes are added/edited)?


texts: How do I restrain domain names of e-mails in the Drupal registration form?

texts:
On the registration page, I want to restrict the domain of the e-mail adress only between a few choices (to limit the use of the site to internal company use only) through a list of choices. The user, upon registration, would therefore only have to write the characters before the @ sign ; and then choose the correct domain name he uses (for instance yahoo.fr).
The final value of the email registered by Drupal (and thus registered in the database) should be like this one: [User_entry]+[@]+[chosen_domain_name].
I found some functions to verify the e-mail spelling, but I really want users only to have the choice between shown domain names.

I've read some answers talking about hook_form_user_login_alter(), but I still don't get how I could make it...

Thks for your replies !


texts: Can a group of fields be added to $form in buildForm()?

texts:
I am defining a custom form to be added to the $build array of a specific node, using form elements as defined here.

Is it possible to add a field collection to the $form array, like '#type' => 'field_collection' or something similar?


texts: How do I get translated label for a base field definition?

texts:
As mentioned here and here, there is a (complicated) way, to get can get a translated labels for bundle fields.

use Drupal\field\Entity\FieldConfig;

// Override language before loading field configuration.
$language = \Drupal::languageManager()->getLanguage('fr');
\Drupal::languageManager()->setConfigOverrideLanguage($language);

// $entity_type, $bundle, $field.
$field_info = FieldConfig::loadByName('entity_type', 'bundle', 'myField');

$label = $field_info->getLabel();

I however cannot find a way, how to achieve this for base fields. A hack like supplying a(any) bundle also leads to no success.


texts: What does the computed code do for a computed field in content type

texts:
I have content type field called 'field_p_bo' and it have the computed code as follows

it causes some problem since it affect the saving of this content type , This code is there for some other fields too . What will happen when i remove the computed code ? will it affect any other part of the content type ?


texts: Custom panels page not showing page title

texts:
I have some custom panels pages I have created and have added the Page Title pane to page content.

However, the Page Title pane is only rendering when the page is in a menu and we're on the url in the menu.   If the page is being viewed but the url is not on a menu then the page title doesn't show.

I would have expected the page title to show regards if it was part of a menu or not.


texts: I am new to drupal but long time programmer. I'm trying to figure out how to create a directory similar to the one here (http://studentunion.okstate.edu/directory). Using feeds i can get the info to import but every entry goes into its own node. So question is using feeds how do i get all the entries to display on a single page.


texts: How to cache url aliases properly in Drupal 7

texts: I have heard Drupal 7 caches url aliases per page. This is not useful if you are caching pages in Varnish for example. The D6 module Pathcache was effectively for this purpose however it does not have a proper D7 port. I'm wondering what others are using for this purpose. How are you caching url_aliases?


texts: Self-hosted development and deployment control panel - does this exist?

texts:
My company requires a dev/staging/production environment for a new Drupal project. Plus some kind of control panel for managing development workflow and testing, upgrades and backups of code and content.

An obvious choice would be a platform like Acquia Cloud or Pantheon; their control panels do exactly this. But we are unable to use a hosted service; industry regulation means we must host on our own LAMP environment.

I'm familiar with Drush, Features and GIT, but wondered whether there is any distribution, project or commercial package that provides a management backend that pulls these elements together? I guess one of the reasons why Acquia exist is because the answer is no.

Any tips would be appreciated.


texts: Local json migration: how to set the value of the urls variable?

texts:
I'm currently really busy to get the migration work on my desk.
I want to import (migrate) a local json file into drupal8 using Migrate_Plus, Migrate tools.
For that I have the following migration yml configuration file

# Migration configuration for products.
id: product
label: 'Product'
migration_group: Products
# Here we define the migration source
source:
  plugin: url
  data_fetcher_plugin: file
  data_parser_plugin: json
  urls: /modules/custom/migrate_products/data/data.json
  item_selector: /data
  fields:
    -
      name: uuid
      label: 'uuid'
      selector: uuid/value

    -
     name: name
     label: 'Produkt Name'
     selector: name/value

    -
      name: supplierName
      label: 'Anbietername'
      selector: supplierName/value

  ids:
    uuid:
     type: string

destination:
    plugin: entity:node

process:
  type:
    plugin: default_value
    default_value: produkt

  title: name
  field_uuid: uuid
  field_suppliername: supplierName

  sticky:
    plugin: default_value
    default_value: 0
  uid:
    plugin: default_value
    default_value: 0

migration_dependencies:
  required: {}
  optional: {}

dependencies:
  enforced:
    module:
      - migrate_products

Like you can see, the json file is located inside the custom module directory.

The json file looks like this:

{
  "data": [
    {
      "uuid": {
        "value": "7d51-4406-a7ef-3a7916b977a9",
        "patient": false
      },
      "name": {
        "value": "Product1",
        "patient": false
      },
      "supplierName": {
        "value": "User1",
        "patient": false
      },
.....

After enbaling the required migration module, when running:
drush ms
I get the following output:

file parser plugin: could not retrieve data from /modules/custom/migrate_products/data/data.json
 Group: Products (Products)  Status  Total  Imported  Unprocessed  Last imported
 product                     Idle    n. v.  0         n. v.


texts:
Is it possible to set a product to have as price "price on application"?
Also the Add to cart link should be changed to contact us or something like that.


texts: Create View That Overlays The Theme When Field Clicked

texts:
Hello i like the feature that ive seen on a few themes where it lets you have an overlay button top left and when you click it it overlays the whole screen with a grid or in my case a picture. Here;s a video explaining more if you dont mind. Its just brief.
http://www.youtube.com/watch?v=cwXV20VJAr8&feature=youtu.be

I would like to create a View and let the items on it have the same function as this overlay button. Im sure it would be possible. I could do most of it barr the action of clicking a view title (button) and making html overlay.

Actually there sounds like there will be a module to do this. I would rather avoid if i could. Maybe some jquery or something wuld be easier?

Thanks


texts: How to create sub menu in Drupal 8 using views result for specific item of the menu?

texts:
I have one menu link available in the Main Menu. It is called as "Video".

In my system, there is vocabulary called as "Video Taxonomies". It have following taxonomies entries.

Entertainment
Comedy
Friction

I have created one block for listing all this category.

Now, I want this block result would appear under "Video" link of the Main Menu.

So, I want following output when we will hover on the Video Link of the Main menu.

Video Link

Entertainment
Comedy
Friction

I have used https://www.drupal.org/project/menu_views for Drupal 7.

Please suggest.


texts: ajax form element sometimes triggers submit

texts:
I have found some strange behaviour of form ajax elements.

I have added #ajax to my form elements:

['#ajax'] = array(
  'callback' => 'mymodule_ajax_callback',
  'event' => 'change',
  'progress' => array('type' => 'none'),
);

and due to some other issues, i had to add ajax to my submit:

$form['actions']['submit']['#ajax'] = array(
  'callback' => 'mymodule_node_form_submit',
);

The issue is, when the form element ajax is triggered for "checkboxes" and "select" form field type at the same time, then submit callback is triggered but i never clicked submit.

Does anybody have any idea?


texts: How do I translate strings in Twig templates?

texts:
I am working on a (my first) Drupal 8 project witch is a multilingual site. Drupal 8 really delivers in terms of native support for content translation.
However, I have a few strings set directly in some if the theme .Twig template files printed out like ex.

{{ 'Read more'|trans }}

I am really stuck on where to handle the translation for strings like these within the Drupal 8 installation.

What steps do I need to take to be able to translate these strings into the language currently selected for on the site? Do I need any additional modules other than the ones included in Drupal 8 core?

Steps I have taken:

Activated the Content Translation & Interface Translation modules
Added Twig strings like {{ 'Read more'|trans }}
Flushed cache and refreshed pages containing the strings
Checked admin/config/regional/translate for the strings with no result


texts: Errors when attempting to load Salesforce object from mapping admin page

texts:
We are attempting to push a content type from our Drupal site to a Salesforce object. We have successfully authorized the link between them. When we attempt to start the mapping, we get an AJAX error. I believe the AJAX error is just a symptom of the real error that occurs within the Salesforce module so I am not providing much about it.

In the logs after the error has been triggered, the drupal log shows 2 errors:

Notice: Undefined offset: 8 in salesforce_mapping_form_validate() (line 590 of /.../sites/all/modules/contrib/salesforce/modules/salesforce_mapping/includes/salesforce_mapping.admin.inc).

and

Warning: Invalid argument supplied for foreach() in form_type_checkboxes_value() (line 2394 of /home/tim/projects/lca/includes/form.inc).

I have attempted to use xdebug to watch this process as it works its way through the salesforce_mapping.admin.inc processes, but nothing has jumped out at me. In the end, phpStorm runs out of memory and stops processing the request. The next page load of drupal crashes the browser window as well leading me to believe there is some sort of recursive error happening.

I have searched this modules issue queue and the interwebs extensively, but nothing fits our situation. Please let me know if I can provide further information for you or can otherwise assist.


texts:
function ajax_register_form_user_login_alter(&$form, &$form_state, $form_id) {
   $form['fbuser'] = array(
      '#type' => 'item',
      '#markup' => 'You have a facebook account?',
      '#weight' => -10,
    );
   $form['login_link'] = array(
      '#type' => 'item',
      '#markup' => '
',
      '#weight' => -6,
    );
   }

How can I add a class to this div's?


texts: How to hide the label of a entity referenced image field

texts:
I am using drupal core 8.4.2 and lightning 8.x-2.23. I have a entity referenced image field that I am printing out like this {{ content.field_main_image_2.0 }}. I think there was a change starting in drupal 8.4 that now the image label is displayed above the image even if you set it to hidden in the media image bundle. Looking at the source for theme template suggestions it says this.

name fish

I want to remove the label "name fish" from appearing above the photo.
My entity referenced field name is: field_main_image_2
My content type is called: person
How should I rename the template named field.html.twig? I tried renaming it to
field--field_main_image_2.html.twig and field--field-main-image-2.html.twig, but this didn't work. It says to use this method field--field-foo.html.twig. For now I placed the file field.html.twig in my template folder and it is being used but I dont see where I can remove the label. The template says Available variables: label_hidden: Whether to show the field label or not.


texts:
After a Debian update my Drupal 8 installation can not show single nodes and spits the following error.

  Error: Class 'DOMDocument' not found in Drupal\Component\Utility\Html::load() (line 286 of core/lib/Drupal/Component/Utility/Html.php).

I have no clue what to do and have installed all required php extensions, following some other issues with the same error.

I already removed all suspicious contrib modules and I am lost now with a broken project.

Any suggestions would be very helpful.
ENV: Drupal 8.5 | PHP 7.2.9


texts: How to add custom column in-between people/users admin page table?

texts:
I have created a custom column to display last user changed time, but I need this field to be inserted before OPERATIONS column. Below is my code which appends my custom field at the end.

function meme_user_update_form_user_admin_account_alter(&$form, &$form_state, $form_id) {
  $changed_column = array('changed' => array(
    'data'  => 'LAST CHANGED',
    'field' => 'u.changed'
  ));
  $form['accounts']['#header'] = $form['accounts']['#header'] + $changed_column;
  foreach ($form['accounts']['#options'] as $key => $row) {
    $user_object = user_load($key);
    $user_language = ($user_object->language) ? $user_object->language : LANGUAGE_NONE;
    $form['accounts']['#options'][$key]['changed'] = $user_object->field_user_changed[$user_language][0]['value'];
  }
}


texts: How do I make a list of Users and their total number of posts in a given date?

texts:
I have D7 and I can already display a list of users with their total number of nodes with Views but how can I make it so that I can choose the date range?
Its like analytics to see if a User has any posts in a given month.


texts: what does hook_field_is_empty actually mean?

texts:
I feel like I'm retarded but when I read the page at api.drupal.org I'm still wondering what the point is of the function. It says 'Define what constitutes an empty item for a field type'. I'd expect that this function would put NULL there if a value wouldn't be present, but it doesn't look like this is happening.
Also: is it required to write this function in my .module file to get a fieldname in my drop-down list of the Manage Fields page (you know, as a babystep)


texts: Disable pathauto for nodes created with migrate module

texts:
I'm using migrate to import a bunch of nodes and I want to set the path alias during the migration. I am able to import the path alias just fine like so:

$this->addFieldMapping('path', 'url_alias');

When I look at the imported nodes I see the correct path in the path field, but the Generate automatic URL alias checkbox is still checked which means the setting is getting ignored.

How do I disable that setting on the node during migration?


texts: one view show nodes and their referenced nodes - both only published

texts:
I have 2 content types. Question and Answer. Answers hava a entity reference field and contain reference to certain questions.
Now, I want to build a view with listing of questions and number of answers to each question.

So, my view has one field title. Another field title with set up relationship (to show related answers). Filter is set up to show only published nodes and node types of Question and Answer. Query setings - distinct.

Result: I get all questions with all answers. Like this:
Q1 (published)
-someanswer1 (published)
-someanswer2 (unpublished)
Q2 (published)
-someanswer3 (unpublished)
-someanswer4 (unpublished)

Problem: Only Questions get filtered by using filter - published nodes. The referenced nodes - answers are not filtered and are shown all published as well as unpublished.

What would be the best approach to show ONLY published both answers and questions? Thank you


texts: My Aquia Dev Desktop is insanely slow. What could be the problem?

texts:
I'm running Drupal 7 with the latest version of Aquia Dev Desktop and the site is REALLY slow on local host. I mean something like one minute to load a node  to edit it, and three minutes to load the modules page.

I tried the Boost module, and I have all the performance settings maxed out.   What could the problem be (a port, the PHP version, too many installs)? I have about seven sites in there.

The site on the live server (in the USA) is faster and I'm connecting from Thailand; that is twice as fast as localhost.


texts: What are the best e-commerce modules/setups?

texts:
Googling for "Drupal E-commerce" brings up a ton of old results, and I wanted to weed out all the garbage. I'm a regular on SO but I thought that I might get better insight/advice here.

Running Drupal 7.9 (multiple sites will be installed but running their own Drupal install), what e-commerce packages should I install (shopping cart and payment options)?
What are the pitfalls to look out for?
What theme do you suggest, that is geared towards E-commerce?


texts: Acquia Dev Desktop and Drush broken with syntax is incorrect

texts:
I did a clean install of Acquia Dev Desktop (Build Nov 13th, 2017) under Windows 10. I can clone my site (Drupal 8) and then click to open my local Drush console. It opens a DOS prompt into the docroot directory. When I execute any drush commands I get "The filename, directory name, or volume label syntax is incorrect."

Here is a sample:

  C:\DevDesktop\website-dev\docroot>drush -d -d  version

  Loading drushrc "C:\Program Files (x86)\DevDesktop\tools\vendor\drush\drush\drushrc.php" into "drush" scope.   [bootstrap]

  [0.78 sec, 2.48 MB]
  Cache HIT cid: 8.1.15-commandfiles-0-61c5476a3a04a40d4bdadfd521f0641f [0.84 sec, 2.52 MB]                          [debug]

  Begin redispatch via drush_invoke_process(). [1.16 sec, 6.43 MB]                                                  [notice]

  Backend invoke: "C:\DevDesktop\website-dev\docroot\vendor\bin\drush.launcher"                            [command]
  --root="C:\DevDesktop\website-dev\docroot" --debug --verbose  version 2>&1 [1.21 sec, 6.45 MB]

  Calling proc_open("C:\DevDesktop\website-dev\docroot\vendor\bin\drush.launcher"  --root="C:\DevDesktop\website-dev\docroot" --debug --verbose  version 2>&1);

  The filename, directory name, or volume label syntax is incorrect.
  End redispatch via drush_invoke_process(). [1.24 sec, 6.44 MB]                                                    [notice]


texts: How to create a block view that displays content one year ago from from the post date of the current node

texts:
We have a surf report running on D6. One of the features that we'd like to add is a block on the node page of a surf report content-type that shows the surf report from one year ago.

I know how to create a filter that sets the date to one year from the current date/time, but I want to make this block display the report from one year from the post date of the current node (as opposed to current date/time).

Any ideas on this? I've racked my brain and can't think of any solutions.

Any help is appreciated!


texts:
I have configured the smtp for drupal , as said in this link https://www.drupal.org/project/smtp and my smtp module folder lies in /sites/all/modules/smtp and phpmailer library lies in /sites/all/libraries/phpmailer .
But am getting the following error on sending the test mail from the drupal admin SMTP authentication support .

2015-07-09 14:37:30 Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array ( ) 2015-07-09 14:41:45 SMTP ERROR: Failed to connect to server: Network is unreachable (101) 2015-07-09 14:41:45 Connection: opening to ssl://:465, timeout=300, options=array ( ) 2015-07-09 14:41:45 SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: Name or service not known (0) 2015-07-09 14:41:45 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

And these are my smtp parameters ,

Any help is appreciated . Thanks .


texts: Administrator's approval required after published node has been edited

texts: After editing, any published node needs administrator's approval like comments. How can I do this with Drupal 6?


texts: Is image_get_info cheap or expensive to call?

texts:
I'm using Drupal 7, and I have a content type that always has one image associated with it (from an image upload field), and I'm wanting to consistently display the width and height of the image when someone views the node.

My question is this: is image_get_info a cheap enough function call that I should just go ahead and call it every single time I display one of these nodes... or should I call image_get_info just once when the node is saved, and then store the width and height values in a field somewhere, and grab the values on node_load?


texts: Change the Order of Fields on Teaser node.tpl

texts:
Hello i am struggling here a bit to change the display of my node teasers. I was hoping to take the title and submitted part and put it on top of my body field to the right of my teaser image. Ive tried Panelizer (looks great but the image field stays there if there is an image or not), Entity View Modes (dont know if this is really what i need) and even tried what could be the best way just simply editting the node.tpl and changing the fields about.

I think i'll just go with the last way as i did almost have it but due to a lack of knowledge and trouble finding out more ive had to ask you guys for some help.

I think i need to add

    <?php if ($teaser): ?>
        something in here
        <?php endif; ?>

but either it just not working (soz ive been up 24hs and im at the end of the line i think. Just hoping for some help either before bed or for when i get up) or else i get 2 body texts and titles appearing. I was just wanting my image on the left then to the right my title nd submitted fields above the body text.

I hate folks that do this but im gonna give it a go as im too tired to think now im sorry. here is my node.tpl Even just a good suggestion of what to do would be great. even better would be reworked code and i wont learn anything at all but i have tried. Tried for the past 4 hours

    <article class="node-<?php print $node->nid; ?> <?php print $classes; ?> clearfix"<?   php print $attributes; ?>>

      <?php if ($title_prefix || $title_suffix || $display_submitted || $unpublished ||   !$page && $title): ?>

          <?php print render($title_prefix); ?>
          <?php if (!$page && $title): ?>
            <h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?>

          <?php endif; ?>
          <?php print render($title_suffix); ?>

          <?php if ($display_submitted): ?>

              <?php print $user_picture; ?>
              <?php print $submitted; ?>

          <?php endif; ?>

          <?php if ($unpublished): ?>

<?php print t('Unpublished'); ?>

          <?php endif; ?>

      <?php endif; ?>

      <?php
        // We hide the comments and links now so that we can render them later.
        hide($content['comments']);
        hide($content['links']);
        print render($content);
      ?>

      <?php print render($content['links']); ?>

      <?php print render($content['comments']); ?>

Thanks in advanced. Ive got to the stage where even posting code on stackexchange is hard work for me :(


texts: How to programmatically create a large taxonomy in Drupal 7?

texts:
I need to create a taxonomy with an entry for every living language in the world (nearly 7,000, using ISO 639-3 codes: http://en.wikipedia.org/wiki/List_of_ISO_639-3_codes). Note that the ISO 639-3 code is stored as a custom field.

In light of this: what is the easiest way to create this list directly via MySQL using a PHP (or other) script?

I have attempted to directly create entries by inserting values directly into MySQL:

INSERT INTO taxonomy_term_data (vid, name, description, format) VALUES (2,"Ghotuo","
Africa
","filtered_html");

INSERT INTO field_data_field_iso_639_3 (entity_type, bundle, entity_id, revision_id, language, delta, field_iso_639_3_value) VALUES ("taxonomy_term", "language", 3, 3, "und", 0, "aaa");

INSERT INTO url_alias (source, alias, language) VALUES ("taxonomy/term/3", "language/ghotuo", "und");

I am obviously missing something, because this entry is not seen by Drupal in the "Languages" taxonomy.

I have looked at this question but am unsure how to set this up as a stand-alone PHP script (not incorporated into the site itself).

Any ideas how to programmatically create this taxonomy? TIA.


texts: I've installed Drupal Commerce module, I got show cart block in header. If I click on it takes to cart page. I need a pop up of cart page on clicking show cart.


texts:
I would love some help to think here, I need to create one or several views (I'm hoping one)

I have a site that will present different groups and they will each have their own page/view with:
- a slideshow
- some nodes
- a contact form
- a block with Facebook posts from their Facebook pages
- some social links (like google+, Facebook like etc.)

I will start with a few but I want it to be easy to add more in the future, hopefully without creating a new view for each group. Note that this is not a social site, the content will be added by one person and the page will simply be a presentation of these groups in a standardized way.

I'm thinking views with EVA and maybe I could use taxonomy to "group" them? I don't want to put a specific term if I don't have to as that would exclude any new groups and also would force me to make a separate view for each group. How would I go about to set it up in such a way that it recognizes what to show in one view?

Thankful for any insight and suggestion!

Drupal 7
(Multilingual site)

I will try to explain better.

Let's say I have several products that I want to present in a standardized way: a slideshow, text with images, a contact form, content from a specific Facebook page, content from a specific twitter feed etc.
This will be presented in a view.
I have several products and I want to easily be able to add more, preferably without having to create a new view each time.

How do I go about it? If I use taxonomy to mark what belongs together I will still have to create a new view every time I add a new product. If I use content types I have to create a new content type for each product (which would be even more work).


texts: Webform 8 - How can I make a text field value be A if a select value is 1?

texts:
In Webform 8 I am trying to figure out how to populate a text field with a value based on what is chosen on a drop down.

For example:
Select Value are states
If user selects Deleware then the value for the text field Ratified is equal to 1.

How can I achieve this in Webform 8x?

In Webform 7x I am able to do this with the Conditionals tab but can't seem to be able to figure out how to do this in Webform 8.


texts: How to hook into "visiting the website"?

texts:
My main problem is very similar to How to grant userpoints to users who perform a login 5 days consecutively?. As Mike correctly notices in his answer on that question, his solution will not work for users who leave their browser logged in. Therefore, I do not want to hook into a login, but into "visiting the website" (i.e. accessing any page).

I am fine with both Rules and custom code. In the first case, which Rules event can I use? For performance reasons, it is in both cases desirable that the hooking takes place as few times as possible (in the best case once a day per visiting user). Is restricting the visited page to a particular one, say, the homepage the only way to achieve that?


texts: Possible to theme the form's elements with own twig?

texts:
I was thinking to get twig outputs so I could use these twig variables on a form.html.twig such as below:

            {{ form.name }}
            {{ form.mail }}
            {{ form.subject }}

            {{ form.body }}

            {{ form.submit }}

Any idea how to get the similar variables via hooks on MYTHEME.theme?


texts: Skip to webform page from a webform submission view

texts:
I'm using Drupal 8 and I have a webform with lots of pages. After submitting the user can see the submission in the webform submission view, but I would like to be able to add an 'edit' button on each page sections in the submiton view so the user to be able to go back and edit one page of the webform but without having to click through all the pages.
I have had a look at programmatically skip pages and Jump to Wizard-Page from Preview Page and can add buttons to the webform submission view using the hook:
function theme_preprocess_webform_container_base_html(&$variables) {
//get page
$webform_page = $variables['element']['#title'];

//add button
$variables['value']['#children']['edit_wizard_page'] = [
      '#type' => 'submit',
      '#value' => t('Take Action 2'),
      '#name' => 'Take Action 2',
   ];
}

But how do you update the $form_state->set('current_page','webform-page-to-load') from the button and trigger a redirect to the page?


texts: How to theme date combo input side-by-side?

texts:
I'd like to theme a date combo field on a node edit form to be side by side, rather than stacked vertically, as shown below. Dates are popups, if that makes a difference.

I'm working with the admin theme Seven, which I've sub-themed, in order to override theme functions or CSS as needed. What is the approach should I take for this kind of customization? Moving the "to" label isn't strictly necessary, but would be nice if possible.

Before

After

Also wondering if there is some good reason why the to and from fields are arranged this way?

Edit: instructions for creating a subtheme are here: https://drupal.org/node/225125 This is an easy way to customize an Admin theme if needed.


texts:
In the content page, there is a filter that shows the page, and other types of content.

Is there a way for me that will allow me to show only certain types of items in the content type.

Thank you,
Kevin


texts: how can i see recurring payment details on my website?

texts:
Currently i am using ubercart for recurring payment everything is working fine i can see status of mine recurring payment on paypal account

But how can i see recurring payment details on my website i have searched so many times on google but not got any relative article.

When i go to /admin/store/orders/39/recurring that page always shows blank details  .


texts:
How do I prevent a user from re-using the same password within a certain period of time?

I have configured a number of password restriction modules {Password policy, Generate Password and Flood control} which I have configured to do things like "Password must not match any of the user's previous 10 passwords" but I can't configure them to prevent the same password from being reused within a certain period of time like a year.

I am using Drupal 7.


texts: If you start now a Drupal project. Which way should you go for image files. Is it safe to use the module Media now. Can you upgrade to Drupal 8.3 with parts of Media in core?


texts:
At the moment, the module fboauth imports the photo of the person from facebook and adds it as his/her profile picture, when configured to do so. Later on, when the person changes his/her profile picture, the photo will not be updated at the site because subsequent logins only imports fbuid.

How can the user re-import the photo (or any profile data for that matter) at a later point of time, and update it at the profile here?

Please consider guiding me in the right direction and I will try to come up with some code. Will the hook fboauth_user_update() work for this? Or should I do the trouble of fetching, saving to server, and editing the db, etc? Please help.


texts: Views regex: exclude alphabetical strings as well as those with spaces

texts:
I used the following regular expression on the Taxonomy term name field to exclude strings consisting solely of alphabetical names:

[^a-zA-Z]

Now I want to exclude those strings plus any string with a space.

What I want to do:

Hello (no)
Hi how are you (no)
ハロー (ok)

I tried this:

[^a-zA-Z\s]

This excludes alphabetical strings but not alphabetical strings with a space:

Hello (no)
Hi how are you (yes-> should be no)
ハロー(ok)

What am I doing wrong?


texts: How to migrate D6 node reference to D7 organic group membership?

texts:
I have created migrations for most of my D6 site to a new D7 site.  In the D6 site I have users with profile nodes.  Those profile nodes are linked to another type of node via node reference.  In D7 the other node will be an organic group.

I would like to be able to transfer the node reference relationship in D6 to organic group membership in D7.  Has anyone done this?

Thanks in advance for any help given.


texts: Adding indexed field to Search API query in code

texts:
I want to add an indexed field to a Search API query in code. My query currently looks like this:

$index = search_api_index_load("default_node_index");
$query=new SearchApiQuery($index);
$query->condition('type', 'answers_question', '=');
$filter = $query->createFilter('OR');
$filter->condition('title', $text, '=');
$filter->condition('body:value', $text, '=');
$query->sort('search_api_relevance', DESC);
$query->fields(array('title'));
$query->filter($filter);
$query->keys($text);
$data=$query->execute();

This returns the correct results, however the result set is composed of an array of arrays with an 'id' and a 'score'. I want the indexed node title to be returned as well. I cannot do a join to the node table as ->join is not available on SearchApiQuery.

The statement:

$query->fields(array('title'));

does not seem to do anything.

I have this same query set up in a view where it is working properly. When I inspect the query at hook_search_api_query_alter I cannot see where or how the title is added.

How do I add the indexed title as a field to be returned in the result set?


texts: How to change the site logo in a preprocess function?

texts:
I want to set my site logo programmatically, so that I can change the logo based on URL args.

I am able to set the $variables['logo_img']['#uri'] with the following code in MYTHEME.theme but still the logo displayed does not change.

I have cleared registry.

I have tried setting my own logo and using default logo settings in theme settings UI:

function THEME_preprocess_page(&$variables) {
  $variables['logo_img']['#uri'] = 'http://newlogo.jpg'; }

I have also tried this:

function THEME_preprocess_page(&$variables) {
  global $base_url, $base_path;
  $variables['logo'] = $base_url . $base_path . drupal_get_path('theme','THEME') . '/images/logos/newlogo.svg';
}

Any help?


texts:
I have a parent child entity relationship which is driven by a REST API. The payload contains data for both the parent and the child. The parent can have many children.
When the (child) payload is posted the API first checks if the parent exists (based solely on an ID value in the payload). If it does exist, that parent entity is assigned to an entityref field when the child entity is created. If the parent doesn't exist; it is created and the newly created parent is assigned to the child.
This works great.. until. It seems now that the API user is publishing multiple children with the same parent at the same time (I assume some sort of multi-threaded process). So the breakdown occurs when the first 2 children are created (at the "same time") and they both determine there is no existing parent; and then create duplicate parents.
Is there some Drupal db method that allows me to lock creation of a certain entity type; triggered by the first spot in the API code where the parent is to be created? I assume they are not exactly the same time; but they are within 1 second of each other and more precisely they are within the time it takes to create the first parent. Perhaps even a REST function to handle threaded calls?


texts: i need to one role like 'domainAdmin' in a domain can edit only users of the assigned domain not another domains. is this possible with domain access itself or another modules?


texts: How to create pop up window for login page

texts:
I want something like if i click on the login then pop window should open where in i should able to enter my Id and password to login, as as of now i tried with modules like

Fancy Login

Ajax Register

Modal Forms

above module i just installed and enabled.

But no luck can anyone tell me how to achieve this?


texts: How to render a template in a module controller?

texts: I want to render a custom template in a module controller but I don't know how. How do I achieve this?


texts: Content Type with Add comment, Post New Article, Share Links

texts: I have created a drupal page, I want to add comment,share link to the post I have tried using view to create it it does not work out.


texts: Where should twitter embed javascript go in a ctools plugin

texts: I have a ctools plugin with the twitter embed javasacript in there, but where should the javascript go? Should it be in the template file, or should be be outputted into the block in the plugin file?


texts: How to show available drush commands per module with a drush command?

texts:
For example I would like to see all the commands provided by the features module, I know I can do

drush help | grep features

But I don't feel safe doing this with all modules present there (you never know when you miss a command). And it often looses important "second lines" such as the shortcut for features-revert-all.
Do you know any command / technique to make sure you get it all safely?


texts: How to load a user field value using AJAX

texts:
I want show my users phone number in node.html.twig and I want that robot spammers can't access that. In other words, the phone number should not show up in the page in the initial page load.

When a user clicks a show link/button the phone number should show up.

How can I do that?


texts: How to trigger some action on specified time of node

texts: I have a node of custom content type and one custom field for flag of specified time. How to check time is over and perform some action when time is over.


texts:
On 404 pages, no user menu is displayed.

I have tryed to use the 404 Navigation module but it does not help.

I also tried this code in template.php, but it doesn't work.

function bartik_user_menu() {
   $items['page-not-found'] = array(
     'title' => '',
     'page callback' => 'bartik_page_not_found',
     'access callback' => TRUE,
   );
   return $items;
 }

 function bartik_page_not_found() {
   drupal_set_title('Page not found');
   $cust_err = "";
   $cust_err = $cust_err . "The requested page " . request_uri() . " could not be found";
   return $cust_err;
 }


texts: How do you add custom help text to content entry/edit screens unrelated to field?

texts: I use field groups to break my fields into "tabbed" areas for my content editors. I would like to be able to put some kind of help text at the beginning of each of those blocks to explain the entire section of entry. Each of the fields already have their own help text, this would be above all the fields.


texts: Do not show content in view for specific field value and current site language

texts:
I have a multilingual D7 site. I have a fairly complex language hierarchy setup with 10 languages set up besides the default English. We are using the Language Hierarchy module so that we can specify fallback languages if content is not translated or doesn't need to be translated. That way pages will still show up in all languages and will default all the way back to the English version if need be. This all works great and is doing exactly what we want.

Now it's time to create a view to display certain content and I am having an issue where I do not want to show certain content in the view to certain languages, but to complicate things it is also based on if a field value is a certain value.

So this is a custom content type I am talking about called "Case Studies". Each case study has an "Industry" field which denotes which industry the case study is for. There is a requirement that we not show certain industry case studies to certain countries/languages, as they do not apply. So, for example, we have a language/country code for "nl-BE" which is Dutch as spoken in Belgium. So if that language code is in the URL, they get the Belgium version of the site and they would get the translated into Dutch case studies on the case study listing page (the view). That is all working correctly. But now we do not want certain industry case studies to show up for the Belgium language code. Basically, "If the industry is X, do not display the case study on the case study listing page for the nl-BE language code." I've been looking at the filters and I just don't see any way to do this since it is based on the value of a field AND the language code in the URL. I can't really use the "Language the content is in" filter because we are using the language hierarchy module, so that might not be accurate. It should be based off what the current users language selection is on the site as a whole. In other words the code in the URL.

Any help?


texts: In Drupal 8.5.X I see that the session cookie is only HTTPOnly and not secure. Any idea how to enforce the session cookie to be always secured?


texts: Redirect (or show the node) taxonomy term page to node, if there's only one node associated with that term

texts: So I'd like to redirect taxonomy term page or show the full content of the node on taxonomy page if there's only one node associated with that term.


texts:
I have a Drupal Website and a few Drop Down Menus in there which comprise of a list of products.
However , the list of products does not appear in alphabetic order.
I tired "reset to alphabetical" for setting them in alphabetical order, but it did not work .
Can anyone help ? !
Thanks !


texts: Problem with using ksm($entity) in hook_entity_insert()

texts:
As the title states, I've encountered a weird problem with hook_entity_insert():

Array ( [:db_update_placeholder_0] => 1 [:db_update_placeholder_1] => 127.0.0.1 [:db_update_placeholder_2] =>

I get a error screen, and this is what's displayed when I attempt to use ksm($entity).

I also checked the logs:

Warning: Error while sending QUERY packet. PID=18801 in Drupal\Core\Database\Statement->execute()....

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: CREATE TABLE {cache_config}....

This is troubling, as the custom module I'm developing heavily relies on nodes.

I thought maybe this was an issue with the DB, and so I used a new one, but the problem persist. I'll be attempting to create a new Drupal project using the same modules.

Therefore I'm asking if anyone else have encountered anything similar to this and found a solution?


texts: Module to convert Drupal site to Static Html Site

texts:
I need some module which can convert drupal 7 site into static HTML site.
I tried with html export dev version but it wont work.
please help me if there is any other way to create static site from Drupal 7.


texts: How to inject a new variable into a menu template

texts:
I have a menu with a machine name of menu-principal, which in turn has a theme hook of menu__menu_principal and a template of menu--menu-principal.html.twig. I'm trying to inject another menu into the template in a variable so that I can render it in this menu template but so far have been unsuccessful.

I tried to add a preprocess function to my MY_THEME.theme but this doesn't seem to work. My code is as follows:

/**
 * Implements hook_preprocess_HOOK().
 */
function MYTHEME_preprocess_menu__menu_principal(&$variables) {
  $menu_tree_service = \Drupal::service('menu.link_tree');
  $menu_name = 'menu-quicklinks';
  $menu_parameters = new \Drupal\Core\Menu\MenuTreeParameters();
  $tree = $menu_tree_service->load($menu_name, $menu_parameters);
  $variables['quicklinks'] = $tree;
}

When I go to to the template and use {{ kint() }} to dump out the defined variables, I don't see the variable. I only see the following:

I then found this answer and tried the following, using the example from the answer there:

/**
 * Implements hook_theme_registry_alter().
 */
function MY_THEME_theme_registry_alter(&$theme_registry) {
  $theme_registry['menu__menu_principal']['variables']['quicklinks'] = [];
}

I used dd() to verify that $theme_registry['menu__menu_principal']['variables'] existed and that the variables were definitely being set in the theme registry, but it still didn't work.


texts: With Drush, what's the correct procedure to install Commerce Kickstart, Drupal, and the sample store data as a new site?

texts:
In my opinion, the install documentation is a bit lacking when answering this question.

http://www.drupalcommerce.org/commerce-kickstart-2/install

I want to avoid the browser all together and install commerce_kickstart and configure the sample store all via the command line with Drush.

What's the correct way to do this? Download Drupal; Download commerce_kickstart which creates a profile directory, and then 'drush si commerce_kickstart ... ' ?


texts:
I have a Drupal multisite website, with Apache Solr Search Integration, which is up and running very well in the live server. I am trying to replicate the same website, on another server to use it as a development environment. I have copied all the code and replicated the DB and changed the settings.php file accordingly, but I am getting the following errors.

Memeber profile is not completed.
Apache solr is not integrated on to the server.

Can anyone help me with the steps which I have to follow during the process?


texts: Trigger Authcache Reload on Field Change for Drupal Commerce Products

texts:
I activated authcache and the cache system is working well.
When i change the price for a product the page is read from the cache.
How can i trigger to reload the page from database if one specific field (price field for example) is changed?

Information on my installation:

I have installed Drupal Core 7.37 , Commerce 7.x-1.11. and AuthCache 7.x-2.0-beta5.


texts: Print field content as div attribute in views template

texts:
Using Drupal 8

I have a view:

Unformatted List
Two fields, Title and an Image with Image URL formatter via the module Image Url Formatter

I need to print out that URL such that:

The problem lies in the fact that I have TWIG DEBUGGING enabled , so the output of the field also includes all the debug mumbo-jumbo that I don't need. I don't want to have to be turning on/off debugging to make sure this works, I want a way to print the content without that mumbo jumbo.

I thought this post would help. It explains that field.content contains the rendered field, and what I am looking for is the field data from the database.

When trying this out with views-view-fields.html.twig , the code row._entity.field_art_image.value works great but it returns the information about the image itself (alt, title, width, height..) but not its URL.

Is there a way for me to access either the image url that points to the Image Style applied to the filed? (For example /sites/default/files/styles/large/public/2016-11/feature-javelin-throw.jpg?itok=UJugCoqn .

Trying file_url(row._entity.field_art_image.entity.uri.value) works, but it returns the URL to the uploaded image, not the one that results from the Image Style applied.


texts: What is the equivalent of user_set_authmaps()?

texts:
I need the equivalent function for user_set_authmaps(), in Drupal 8.

What function/method replaced it?


texts: Allowing only certain roles to see certain content within a view

texts: I am trying to make a martial arts site, where there is a feature allowing a member to log in, and view the techniques of his specific belt. If he is a black belt, he can view all of the techniques, but people of a lower belt can only view techniques of their belt or lower. I am trying to do this by using roles, and viewing permissions of those specific roles. The problem is that the modules I am using don't seem to work (or maybe I'm just not using them correctly, I am new to this aspect of druple. I have so far tried "Content Access", "Node access node reference", and "Node access user reference"). I was hoping to be able to restrict view access to a node completely by using some kind of reference field, so that it would also not show up in a view. Any Ideas on how to do either of these?


texts: How to register or track the views of a node per user?

texts:
I'm looking for a way to count the number of times each user has viewed a particular node. I have many nodes but I need that number to give user points to the viewing user if he or she has accessed that node X number of times over a time span of 24 hours and this on a daily basis.

Is there anything that can do (track) this or is there a way that I could create this feature "without" writing my own module and without writing php code? I'm no Drupal Ninja ...

I've been looking at the node view count module but that doesn't allow the users themselves to see their view count.
The best way of displaying that number would be through Views (obviously).
I've been thinking about creating an integer field on the user account settings page but that wouldn't actually not show me which node that user has accessed.

Any ideas?

Update: The Node View Count module (suggested in one of the answers) is unstable (throws errors, breaks the site), has no documentation and simply does NOT provide a count of how many times 1 particular user has viewed each node (of a certain content type).


texts: How can I add a save button in my page variant?

texts:
I have created two variants of user edit page, one displays the entire form and other displays only a couple of fields of that form.

I have created a selection rule so that one triggers when is needed and other runs as default form mode.

But the problem is the first variant, which only have two fields doesn't have any save button.

This is what my panels look like:

This is what I did with that variant:


texts: D8: Multilingual configuration and dynamic content

texts:
I'm currently working on a multilingual Drupal 8 project that also takes advantage of D8's new CMI system (Buzzwords: Content Manangement Initiative). Is there some sort of best practice here?

I would like editors to be free to translate different languages without reverting back to what is said in .yml files when doing an import.
It is possible to run drush cim --partial and simply skip "deleted" files which would be the case if you were to gitignore the config/sync/language directory but I'm not too keen about this idea since it would have an effect on so much more (all deleted config files in the future would be skipped).


texts: Wrong value when using PHP with the Views module

texts:
I have a float field, and I just want to print this field in a PHP field. I am using this code.

print $row->title; // It prints the same value.
print $row->field_pa_total; // It prints the wrong value; the field value is 5000, but the printed value is 40.

How do I print the field value?


texts: I am new to Search API and Facet API, any clue how to change the default Facet filter block title?


texts: How to use the Rules module to award userpoints to referring users?

texts:
I am creating a referral program on Drupal. I have almost everything working right except awarding userpoints to users. I want to award userpoints to users after the person they refer to the site becomes a paid member. I have tried severally with Rules but no success.

I am using these modules:

User Referral module to capture referrals.
User Points to award userpoints.
Membership Entity to create paid members.

What I want is to create a rule using Rules that automatically awards userpoints to a user once the person that a user refers to the site becomes a paid member of the site.

Anyone with better knowledge able to help me out here?


texts: in teaser view, truncated body is displayed instead of summary

texts:
My content type has the following settings for body field in "Manage display" tab, for "Teaser" display mode:
Label: Hidden; Format: Summary or Trimmed, Trim length: 2000

However, the summary is never actually displayed in Teaser mode, only trimmed body.

For example, in node edit form, after clicking Preview, the Teaser preview clearly displays an automatically truncated beginning of the body. The summary was entered, but is not displayed in preview.

The same in a View, the format is set to show Content, Teaser. Again, the summary is not taken into account, only the body field.

What to check, how to fix this??


texts: Vimeo Video Embed Field with Colorbox Formatter not opening up after update to 8.9.3

texts:
I was running Drupal 8.8.2. I created a view which pulled the video embed field from a custom content type, formatted it as a colorbox, and opened up the video when clicked on.
After the update to Drupal 8.9.3, clicking on the video no longer opens up a colorbox (it doesn't do anything).
Has anyone experienced this issue?


texts: Google keeps indexing /comment/reply URL

texts:
With the new update of Google algorithm called Penguin, I think my site was being penalized due to webspam. But of course I don't create post which seems to be spam to Google. It is just I think how Google index my site.

I found out that Google index the URL of my site like:

http://www.example.com/comment/reply/3866/26556

So there are so many comment/reply URL index by Google. I have already added:

Disallow: /comment/reply/
Disallow: /?q=comment/reply/

but still Google still index this URL.

Any idea how to prevent Google from indexing comments?

Here's my .htaccess:

<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$">
  Order allow,deny
</FilesMatch>

Options -Indexes
Options +FollowSymLinks
ErrorDocument 404 /index.php
DirectoryIndex index.php index.html index.htm

<IfModule mod_php5.c>
  php_flag magic_quotes_gpc                 off
  php_flag magic_quotes_sybase              off
  php_flag register_globals                 off
  php_flag session.auto_start               off
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_flag mbstring.encoding_translation    off
</IfModule>

<IfModule mod_expires.c>
  ExpiresActive On

  ExpiresDefault A1209600

  <FilesMatch \.php$>
    ExpiresActive Off
  </FilesMatch>
</IfModule>

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule "(^|/)\." - [F]
  RewriteCond %{HTTP_HOST} !^www\. [NC]
  RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^ index.php [L]

  <IfModule mod_headers.c>
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}\.gz -s
    RewriteRule ^(.*)\.css $1\.css\.gz [QSA]

    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}\.gz -s
    RewriteRule ^(.*)\.js $1\.js\.gz [QSA]

    RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
    RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]

    <FilesMatch "(\.js\.gz|\.css\.gz)$">
      Header set Content-Encoding gzip
      Header append Vary Accept-Encoding
    </FilesMatch>
  </IfModule>
</IfModule>


texts: How to get entity id of newly created entity using entity_get_controller

texts:
I am crating the new entity in drupal a below,

$entity = new stdClass();
$entity->type = 'entity_type';
$entity->id = 0;
$entity->title = 'Entity Title';

//Add data to fields
$entity->field_introduction = array
            (
                'und' => array
                (
                    "0" => array
                    (
                        'value' => $strIntroduction
                    )
                )
            );

     .
     .
     .
     .

    //After adding all the fields, I am saving entity as follows,

entity_get_controller('summary_report')->save($entity);

Entity get saved successfully. After this I want entity id for the further manipulations.
How I get this newly created entity id.


texts: Decoupled Drupal - Security: files structure

texts:
I am running a Drupal 8.9.2 site as a content repository accessed via an Angular 8 app. So there is one administrator who uses the Drupal interface to write content / upload files eccc.... and anonymous users view that content via the Angular app.
I have set up some views with REST Export display and have been able to pull the content in my Angular app running both backend and frontend on localhost, but when I deployed to the server problems have arisen...
all my calls fail or get canceled, this was the configuration on localhost: the Drupal website was in a folder in XAMPP/htdocs/example the views rest endpoints were like: http://localhost/example/web/api/content the Angular app was in a folder on the desktop and was served at http://localhost:4200/home
now I put all the files for both backend and frontend on the root folder on the server, I also have commented this line ErrorDocument 404 /index.php in the htaccess file found in the web folder so that non existent urls are managed by the Angular app.
So the question is: What is the correct files structure in order to have the frontend at example.com/home and my Drupal site at example.com/web/admin/eccc..... (if it is possible, otherwise please suggest a better option).


texts: Display node through panels but limit/deny access directly

texts:
I have a panel that displays a webform node depending on the fulfillment of certain selection rules (visibility rules) within the panel.  However, I want to be able to prevent access to the webform directly.  I have tried to unpublish the node, but this affects the display in the panel as well.

Edit: I'd also like to avoid adding code into template files etc.


texts:
I've created a module that has a 'form builder' on the admin side.  Once the form has been created, I store the form array in the database.  Then on the front end I've created a custom field that pulls the form array from the database and displays it as part of a node.  Here is the pseudo-code to show my thinking:

- Create form via admin side and store form array in database
- Create node with custom field, choose which form you wish to display
- Set url alias on the node
- When user views url, display the form as part of the node

The problem I have is that when I complete the form on the front end and press submit, nothing happens.  Looking at the html, it doesn't have a <form> tag, presumably because it's part of a node and not a hook_form.

So, I'm wondering if it's possible to display a submittable form as a custom field?  Or do I need to find another way around this?

Edit:  I'm using the following code to display the form:

function mantis_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {

    $element = array();

    switch($display['type']) {
        case 'mantisform_default': {

            // Retrieve the form from the database
            $form_data = mantis_retrieve_form_data($items[0]['mantis_form_id'], 'display');

            $element[]['#markup'] = drupal_render($form_data);

        }
    }
    return $element;
}

Edit:  $form_data structure can be seen here http://pastebin.com/JfeNGBGA  and $element is here http://pastebin.com/HU5NSHd5


texts:
How do I get the server side directory of the filesystem path?

For example, my files are in http://mydomain.local/myfiles; this is the root of my drupal filesystem. I am searching for a function that will give me d:\xampp\htdocs\drupal\myfiles.


texts: Upgrading to 7.26 - Internal Server Error

texts:
I recently upgraded from Drupal 7.25 to 7.26 in maintenance mode.  The upgrading did not have any errors.

Now when I go to the homepage I get an Internal Server Error.

I added an echo statement to verify that bootstrap.inc was executing.

I haven't been able to log any PHP errors.

This is the first part of my .htaccess file (the other part that includes rewrites isn't allowed by Stackexchange due to links)

    # Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$">
  Order allow,deny
</FilesMatch>

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Multiviews creates problems with aliased URLs and is not needed for Drupal.
Options -Multiviews

# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php

# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
  # There is no end quote below, for compatibility with Apache 1.3.
  ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>

# Set the default handler.
DirectoryIndex index.php index.html index.htm

# Override PHP settings that cannot be changed at runtime. See
# sites/default/default.settings.php and drupal_initialize_variables() in
# includes/bootstrap.inc for settings that can be changed at runtime.

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_flag magic_quotes_gpc                 off
  php_flag magic_quotes_sybase              off
  php_flag register_globals                 off
  php_flag session.auto_start               off
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_flag mbstring.encoding_translation    off
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On

  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600

  <FilesMatch \.php$>
    # Do not allow PHP scripts to be cached unless they explicitly send cache
    # headers themselves. Otherwise all scripts would have to overwrite the
    # headers set by mod_expires if they want another caching behavior. This may
    # fail if an error occurs early in the bootstrap process, and it may cause
    # problems if a non-Drupal PHP file is installed in a subdirectory.
    ExpiresActive Off
  </FilesMatch>
</IfModule>


texts:
I'm having problem with display option, of Product variation field as "Add to Cart form":

With that option it should show variation switcher, whenever there is one or more product variations.

But it does not:

Simply looks like "Show attribute widgets even if the Add to Cart form only represents one product." option doesn't change anything.

The above display shows teasers on the front page (I have trying manipulating default view in Manage Display as well).

I have trying clearing cache, running cron and changing my customized node--product--type.tpl.php and node--product--type--product--list.tpl.php  to oryginal ones and it does not help as well.


texts: How do I include a twig file in a custom block type module?

texts: I've created a custom module that creates a jumbotron custom block type. The module has an empty .module file and a dir config/install with many .yml files. This works great when I install and create blocks. I can even place my block--bundle--jumbotron.html.twig in the templates folder of the theme and styling works great! I would like this twig file included in the module and many tutorials explain how to do this if you have a build function in your module, I do not. The module is just creating a block type for me.


texts: Serve a different admin theme for a user role

texts:
I am making a news website. I want the administrator to have the default drupal 7 theme Seven. But I want to give the editor a custom theme that is more usable and streamlined for the task they do.

I have seen this module called ThemeKey. As far as I read it gives a lot of functions. For me as now only thing I want is when the user of the role editor login, they should be served with different admin theme. Thats all. Is there any hooks or something? Are there any examples or recommendations for achieving this?


texts: How do I add a private file to node's file field from Base64 in code

texts:
I'm struggling to add file to node in code. I know about File::create() but I want to add file to node based on field configuration of the file field on that particular node's content type, and file's data comes as Base64, not URL or form post.

How do you do it? I'm asking as I want to add file via custom REST call as Base64.

I am using the following code.

$node = Node::load($data['case_id']);
$files = $node->field_file;  // unlimited files
/* @var $df \Drupal\field\Entity\FieldConfig */
$df = $node->getFieldDefinition('field_file'); // ??? can i get this config for saving new file?
$file =  file_save_data(base64_decode($data['data']), ??path??);
$files->appendItem($file)->validate();
$node->save();

Am I on the valid course? I have no clue how to set config from $df and before save. How do I use the configuration of that file field during save?

Yurii


texts:
When I turn on Drupal 7 css and js compression in the performance part, it is aggregating too much files.(5 css files and 5js files). Why?

The page:

Is there any way to force drupal to aggregate more the files?


texts: How do I attached language specific css in Drupal 8?

texts: As the question states - how do I include a stylesheet based on a language? It has nothing to do with right to left reading, but for different colours etc.


texts:
I have a taxonomy view with table list and I insert my code into a global php field and use enable click sort: sort numerically, but when I click the label to sort numerically I always get the error below.

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /stocks/views/ajax
StatusText: OK
ResponseText:
Fatal error:  Function name must be a string in C:\xampp\htdocs\stocks\sites\all\modules\views_php\plugins\views\views_php_handler_field.inc on line 185

Whats causing this and is there a way to fix it? Im trying to have the field sort by highest number to lowest.

This is the code I am using in the php field.

<?php
$currentMonth = date('n');
    $currentMonth = $currentMonth - 1;
    $prevcurrentMonth = date('n');
    $prevcurrentMonth = $prevcurrentMonth - 2;
    $currentDay = date('j');
    $lastDay = $currentDay - 6;
    $currentYear = date('Y');

    $file = file_get_contents("http://ichart.finance.yahoo.com/table.csv?s=$row->name&a=$prevcurrentMonth&b=$lastDay&c=$currentYear&d=$currentMonth&e=$currentDay&f=$currentYear&g=d&ignore=.csv");

    $stockcontent = str_replace('Date,Open,High,Low,Close,Volume,Adj Close', '',  $file);
    $stockcontent = trim($stockcontent);

    $stockcontentex = str_getcsv($stockcontent, "\n");

    $stockex = explode(',',$stockcontentex[0]);

    print $stockex[2];
?>


texts:
what are the options (all possible ways) to open a page through ajax in D7?, also can ctools module be useful in this?

if yes then can anyone provide an example hint using ctools.


texts: Openlayers3 - Tiles not Loading - Failed to load resource: net::ERR_NAME_NOT_RESOLVED

texts:
I setup a Drupal Website with Openlayers3.

Openlayers Module: 7.x-3.1         -  2016-Jan-03
Openlayers Library: 3.11.2
Drupal Version: 7.56

The settings are the default. I'm just trying to show a Geofield through a widget Openlayers with a setup like this:

Openlayers map: Openlayers Geofield: Formatter Map
Openlayers layer: openlayers_geofield_layer_formatter
Data options: Use full geometry

The map is there, controls and marker are ok, but either on the preview and on the field display I see no tiles, they are being loaded from the wrong place. This is the screenshot of the error I get:

Errors are like this:

GET https://otile1-s.mqcdn.com/tiles/1.0.0/osm/3/3/3.jpg:1 GET https://otile1-s.mqcdn.com/tiles/1.0.0/osm/3/3/3.jpg net::ERR_NAME_NOT_RESOLVED
Image (async)
Mz @ ol.js?ov6n8a:756
l.load @ ol.js?ov6n8a:688
Lk @ ol.js?ov6n8a:190
l.Qk @ ol.js?ov6n8a:439
c.port1.onmessage @ ol.js?ov6n8a:139
[...]

JQuery Update is Installed and I tried many jquery versions combination (default, 1.7, 1.10...)

I can't get it work... I just want to show a geofield as a map. Any other workiaround in order to achieve that?