texts: Need help with rules for shipping in drupal commerce

texts:
I need help with rules to set shipping rate depending on weight and address, I have some rules but can't do work properly, shipping rate load but there is no change with different weight, can anyone help me?

Thanks in advance!

My rules looks like this, only change in each rule is the "Province" and the limits weight.

{ "rules_atacama" : {
"LABEL" : "Atacama",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [
  "rules",
  "commerce_physical",
  "commerce_order",
  "commerce_line_item",
  "commerce_shipping"
],
"ON" : { "commerce_shipping_calculate_rate" : [] },
"IF" : [
  { "data_is" : { "data" : [ "commerce-line-item:type" ], "value" : "shipping" } },
  { "data_is" : {
      "data" : [ "commerce-line-item:commerce-shipping-service" ],
      "value" : "costos_envio"
    }
  },
  { "OR" : [
      { "commerce_physical_rules_order_weight_comparison" : {
          "commerce_order" : [ "commerce-line-item:order" ],
          "operator" : "\u003E=",
          "value" : "0",
          "unit" : "g"
        }
      },
      { "commerce_physical_rules_order_weight_comparison" : {
          "commerce_order" : [ "commerce-line-item:order" ],
          "operator" : "\u003C",
          "value" : "1500",
          "unit" : "g"
        }
      }
    ]
  },
  { "entity_has_field" : {
      "entity" : [ "commerce-line-item:order" ],
      "field" : "commerce_customer_shipping"
    }
  },
  { "OR" : [
      { "commerce_order_compare_address" : {
          "commerce_order" : [ "commerce-line-item:order" ],
          "address_field" : "commerce_customer_shipping|commerce_customer_address",
          "address_component" : "administrative_area",
          "value" : "AT"
        }
      }
    ]
  }
],
"DO" : [
  { "commerce_line_item_unit_price_amount" : {
      "commerce_line_item" : [ "commerce_line_item" ],
      "amount" : "3350",
      "component_name" : "flat_rate_costos_envio",
      "round_mode" : "0"
    }
  }
]

}
}


texts: How can I cast a fivestar vote on a different node

texts:
I'm new to drupal and trying to figure out how i can use fivestar to implement a rating system.

I have around 15 products and want my site users to be able to rate & review  them from a page named "User Reviews" and NOT from within each product page/node.

Adding the rating axis in the review node is nice and simple but can't figure out how to select the product node to associate the vote with. I want to create a select list field that would list all my products and where the user will be able to select the item they want to review. Then add their comments and ratings and submit it.

Its straight forward to do this when creating a review as a comment on the product node that is reviewed (i.e. select Parent Node as the Voting Target)  but how can I achieve this from a different node and assosiate the nodeId with the nodeId of a product?

I'm using the latest releases of Drupal, Fivestar and Voting API.


texts: How to use Rules to limit the number of searches to pull data from a remote API?

texts:
I have a custom views query plugin that pull data from a remote API.
I use this plugin to save all information so user don't have to enter all details anymore.

User inputs value to search filter and all mapped data is displayed on the page.

I want to limit the number of attempt allowed to a user of 3 searches every 24 hours. So in a day, user can have 3 attempts to make a successful query of data from the remote api. Then, there might me a warning message that appears on the page after those failure attempts. Each day is equivalent to a calendar date.

$vats is where user input value is set in the view search filter. This value is an integer.

$vats = isset($filters['vat']) ? $filters['vat'] : NULL;
$Vid = $vats[0];

$result = CVRClient::get($Vid, $country, 'Unit Testing');

Here's the path of my view page with arguments:  query/query?vat=12345678, 1st 'query' is the sitename and 2nd is the menu path name.

Can this be achieve by Rules? If yes, I would appreciate if someone can guide me ways to do it.


texts:
I have a function in a controller which shows data in table format. I need pagination and styling for the table. I tried as follow.

MyController.php

public function my_requests() {
        //load the current user details
        $user= User::load(\Drupal::currentUser()->id());
        $user_id = \Drupal::currentUser()->id();

        //Query the database
        $query = \Drupal::entityQuery('node')
           ->tableSort($header)
           ->condition('status', 1)
           ->condition('type', "forward_proxy_request")
           ->condition('uid', $user_id)
           ->sort('nid' , 'ASC');
        $table_sort = $query->extend('Drupal\Core\Database\Query\TableSortExtender')->orderByHeader($header);
        $pager = $table_sort->extend('Drupal\Core\Database\Query\PagerSelectExtender')->limit(10);
        $nids = $pager->execute();

        //creates the table header
        $header = [
                'Node id',
                'title',
                'Name',
                'Ip',
                'SLU',
            ];
        foreach ($nids as $nid) {
            $node = Node::load($nid);
            $row  = [
                'data' => [
                    $node->nid->value,
                    $node->title->value,
                    $node->field_p_name[0]->value,
                    $node->field_ip[0]->value,
                    $node->field_p_slu[0]->value,
                ],
            ];
            $rows[] = $row;
        }
        //Build the table
        $build = [
          'table'           => [
          '#prefix'        => '
My Requests
',
          '#theme'         => 'table',
          '#attributes'    => [
              'data-striping' => 0
          ],
          '#header' => $header,
          '#rows'   => $rows,
      ],
    ];
    //for pagination
    $build['pager'] = array(
        '#type' => 'pager'
    );

     return $build;
}

But it throws an error.

  Error: Call to undefined method Drupal\\Core\\Entity\\Query\\Sql\\Query::extend() in
  /var/www-drupal/modules/ga/src/Controller/MyController.php on line
  196

Without extendQuery, it shows a plain table without any style.

How do I resolve this issue?


texts: Different checkout form based on user or role

texts:
As described, in the docs Checkout Form Builder. This is how you modify the checkout flow. Is it possible to have different checkout flows based on role or user?

For example;

If a teller is logged in. There is no need to collect show account information, or billing.
If a customer is logged in. It will display those panes.


texts: Removing required attribute on user entity fields not working

texts:
I have added fields to user entity and make them required and show on registration page. So the user signing up have to fill all the fields. On the admin side these all fields are coming but i don't want to make them required when admin is creating any user. I thought it will be solved if i hook_form_alter  the user registration form and remove the #required attribute. I did this for admin and dpm($form). I set #required => 0 also unset #required but it keep on showing error of required field. I uncheck the required checkbox in field settings from admin panel and it does not show validation errors on both Admin and Frontend.

What i want is when admin create a user he just enter username and password and leave the rest of custom fields blank and it should register the user. But on the frontend users have to fill the whole form.

Below is the code:

    // If this is admin creating user
     foreach($form as $key => $value){
                if(strpos($key, 'field_') !== false){
                    $value['und']['#required'] = 0;
                    unset($value['und']['#required']); // This isn't working either
                }
            }
    // Endif

Updated Full Code:

/**
 * Implements hook_form_alter()
 */
function paypal_signup_form_alter(&$form, &$form_state, $form_id) {
  if($form_id == 'user_register_form'){
      global $user;
      if(!in_array('administrator', array_values($user->roles))){
        //Submit handler for redirecting user to Paypal.
        $form['#submit'][] = '_paypal_signup_redirect_paypal';
    } else {
        // Remove validation when admin is creating user.
        foreach (element_children($form) as $key) {
            if (strpos($key, 'field_') !== FALSE) {
              $form[$key][LANGUAGE_NONE][0]['#required'] = FALSE;
              $form[$key][LANGUAGE_NONE]['#required'] = FALSE;
            }
         }
        dpm($form);
    }
  }
}


texts: Can I use the feeds module to import csv data to 2 different content type?

texts:
I have 2 content types, account and contact. I have a .csv file which contains the data.

In the Account table we have:

name
street address
postcode
city
province
country
created
lastModified

and in the contact table we have:

initials
lastName
gender
function
officePhone
mobilePhone
otherPhone
email

The csv contains all fields from the table like this:

  “name”,“street address”,“postcode”,“city”,“province”,“country”,“initials”,“last name”,“gender”,“function”,“office phone”,“mobile phone”,“other phone”,“email”

Is it possible to use the Feeds module to import the csv, separate the data from the csv file and either append, replace or merge the data in the 2 different content types at once?


texts: How do I add a file upload field to user profile?

texts: I need to add a file upload field to user profile, and show it on profile page (not during registration). How can I do this?


texts:
Drupal.t('Select a page') is not translated into another language (mobile menu) after clearing cache and translating strings through the translation menu. What should be added or changed to get translation?
Theme Growth Lite (jquery.mobilemenu.js)

var settings = {
    combine: true,  //combine multiple menus into a single
select
    groupPageText: 'Main',  //optgroup's aren't selectable, make an option for it
    nested: true,                   //create optgroups by default
    prependTo: 'body',              //insert at top of page by default
    switchWidth: 480,               //width at which to switch to select, and back again
    topOptionText: Drupal.t('Select a page')    //default "unselected" state
},


texts: Contextual value when the filter is not available and PHP code

texts:
I have block view that should be rendered in the node details page. i.e /node/*. The block should render latest 6 nodes published under the Category category_field that the node has its value.
However, the URL is rewritten and the category id tid is not available. The URL is looks like the following:
http://example.com/Category/world/the-node-title
So the contextual filter is not available in the URL. So, I created the following PHP code, shown in the screen shot, to get the category tid and return it:

In the node.tpl.php when I try to var_dump($node->field_category['und'][0]['tid']); it returns the number of tid of the current node. However, the above demonstrated code seems to be not work in the PHP filter code. When I try to return any available value for an category id such as 19 for example, it works.
In other words, how could I return the current node's category field id to the filter?


texts: What is the best way to stop a node from loading in a node hook?

texts:
I want to use hook_node_view to stop a node from loading if it was not created by the user trying to access it. What should I include in the following code to kill the loading of the node?

function hook_node_view($node, $view_mode, $langcode) {

    global $user;
    $currUser = $user->uid;
    $nodeUser = $node->uid;

    if ($currUser != $nodeUser){
        drupal_set_message('kill page');
  }
}


texts: how disable edit for a certain content type, and a certain role,

texts:
in a drupal 7 site i have been given to maintain, it seems that permissions are not working as expected. I check and uncheck the buttons for a certain user role, but that user role always has the right to edit any node that belongs to this particular type.
1. What could be the cause for this?
2. If this is not working from the gui, how i could achieve something similar with code?
I would appreciate an example


texts: I would like to know if there is a way to make groups or collections of Rules so it is easier to see the types of Rules I have created. Is there a module for this? Is this something where I can/should add a taxonomy term field, assign a term to each Rule and display it in a View?


texts:
What is the benefit of Node Blocks module versus adding content to blocks in body field?

It seems like the functionality is identical?

Either create content, and use it as a block.

Or create a block and add content to it.


texts: Using Rules to create a Comment with multiple fields formatted in the Main Body Text

texts:
I'm trying to create a Rule that will create a comment on another post when a node is created. I would like the comment to contain a number of fields from the original post in a formatted manner.

For example: I have a content type called "Project Status Reports" which has 3 text area fields: field_preparation, field_methods and field_outcomes and a node reference field: field_project_node.

When a Project Status Report is created, the user selects a node to associate it with (in field_project_node) and fills the 3 text areas.

I would like to create a Rule that gets triggers when a Project Status Report is created, which will then make a comment on the node referenced in field_project_node. I would like the body of the comment to look something like this:

Preparation

[node:field_preparation]

Methods

[node:field_methods

Outcomes

[node:field_outcomes]

I have created the Rule successfully and have it triggering however I am unable to work out how to fill the Main Body Text of the comment with formatted text which will do the replacements. All I can seem to do is either add static html or have it post a single field.

Is this possible? Thanks in advance


texts:
I need to erase a custom translation I made for the Addresses Module. The problem is I changed

  Mexico

to

  México

(with accent) and now, logically, the module does not work correctly since it is looking for the previous value so it can autoselect the states.

Is there a way I can erase the translation? I have tried to search for it but so far, I have not found the right entry.

I am able to use PHPMyAdmin, in case this is feasable thru SQL.

Thanx.


texts: Placing a menu based on a page’s taxonomy

texts:
I created a Drupal menu and place the resultant block in the left sidebar. On the block configuration page I went to “Show block on specific pages” > “Show if the following PHP code returns TRUE (PHP-mode, experts only).” and added the following code:

$tid = 0;
$desired_tid = 12;  // Change to the tid you want
$node = menu_get_object();
if ( !empty($node) && !empty($node->taxonomy) ) {
  foreach ( $node->taxonomy as $term ) {
    if ( $term->tid == $desired_tid ) {
       $tid = $term->tid;
       break;
    }
  }
}
return $tid;

The menu still showed up on all pages and not just the page that had the taxonomic term that had ID=12.

I then tried using the code:

$desired_tid = 12;  // Change to the tid you want
$node = menu_get_object();
if ( !empty($node) && !empty($node->taxonomy) ) {
  foreach ( $node->taxonomy as $term ) {
    if ( $term->tid == $desired_tid ) {
      return TRUE;
    }
  }
}

Same effect, the menu still was on all pages. I have disabled caching, flushed the cache, and rebooted the server, all to no affect. Any idea what I might be doing wrong?


texts: What does Drupal do when registering a user?

texts:
I'm relatively new to Drupal.
I like to understand what Drupal does programatically when a user is being created?

More specific I like to know if any file is being created?
Or is it just a database transaction?
Where is the database changed? Which tables?

Because I would like to build a 3rd internal party to create acct from 'behind' so I need to understand what it does so my 3rd party app can mimic the same and at the end the new user login seamless.


texts: drupal_set_message showing twice when called from hook_init

texts:
Basically the issue is that drupal_set_message is showing the message twice on some pages when it is called from hook_init.

Can someone give some advice about this issue, please ?


texts:
Is there a property that is set by the field API once fields have been attached to an entity?

For example

$entity->fields_attached = TRUE

I have been unable to find any information on this, I am looking for a quick and easy way to know if fields have been attached to my own custom entities. If field API does not do something like I have suggested in the question I will handle it myself but I wanted to double check with you fine folks...

If not, I will make a suggestion for this for the Entity API in contrib whenever it attaches fields.

Many thanks in advance :)


texts: CAPTCHA fails every time on some forms (captcha session reuse attack detected)

texts:
I'm using/running the Captcha module 7.x-1.x-dev the latest version for D7 but on some forms I am still getting captcha session reuse attack detected

I have tried 9 patches and it is STILL not working.

i don't know what else to do.


texts: How to get next valid `product_id` value within Rules for drupal commerce product?

texts:
I'm using Rules to create drupal commerce products. The problem is that the product_id is not assigned.

Since the Rules settings page for creating products only gives the following options, I assumed that the product_id would be generated automatically:

Entity type, SKU, Type, Title, Creator, Price, Provided variables.

If the product_id has to be added manually (within Rules) how would I obtain the correct value to use? (Or is there a setting I am missing within Rules?)

Cheers!


texts: How can I overwrite uploaded file via Filefield?

texts:
By default in Drupal 7, if I upload image.jpg via a file field in my node, save the node and then edit that same node and re-upload image.jpg, it will name it image_0.jpg.

I want to replace the image uploaded so I will only ever have image.jpg.  How can I do this?


texts: Show a block on the front page, but only on the first page

texts:
I have a block that I want to show on the front page, but not on every paged page (i.e., don't show it on /front-page?page=1).

How can I achieve this?


texts: How to implement revisioning in my own module?

texts:
In my module I store some node related data in a specific table of the database. Now I want to implement the revisioning system, so I create my_table_revision with the same information and a new column called revision_id.

But, How can I know when a new revsion of the node is created? and how can I know when a node revision is reverted?

It exists something like hook_revert() or hook_revision?


texts: How does Drupal handle non Drupal sub directories?

texts:
I have a question about how Drupal handles requests made to subdirectories of the Drupal root that aren't under Drupal control.

What I mean is lets say I have a Site directory as such:

My main site
     -- an HTML flat site
     -- includes
     -- sites
     -- ... Other drupal necessary files

My concern is: does Drupal load bootstrap on every server request made to its directory? For example, I go straight to mysite/anhtmlflatsite - does Drupal do any type of loading? Or does it just let the web server serve up the sub directory no Drupal love added?

I ask because right now when accessing these flat sites I'm noticing that some files in my includes directory are getting hit (we have them push messages to the error log so that's how I know they're getting loaded when I access these flat sites). Also whenever the Drupal install breaks so do the paths to these flat HTML nothing to do with Drupal sites as well.

Curiouser and curiouser... Anyone have any insight to what's down the rabbit hole?

Oh and I'm using Drupal 7


texts:
I'm using Ubercart module. I want to organize a subscription to a certain type of products in my site. I've tried the uc_recurring module, but it offers subscription to the orders only, and i'm going to make it possible to choose a custom period(recurring) for every product in the cart.

How can I make this issue work?


texts:
I created a new custom block type from /admin/structure/block/block-content/types  having  x and y fields with field types image and textfield respectively.  Then created a block with the same block type  and uploaded image in x and some text in y.  Here  my problem is: how to load this block via code?

More than that how to get values of these block fields x and y  by loading the block?

I tried these:

$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityManager()->getViewBuilder('block_content')->view($block);

but it didn't work.


texts: Add body classes to 404 and 403 error pages

texts:
I need to add a body class to the page when either a 403 or 404 error is served, I'm not sure how to go about this. I'm using logintoboggan which sets the default 403 page to toboggan/denied so don't want to override that and break functionality.

Any pointers would be great.


texts:
I try to administrate a lot of content in Drupal 7.

How may I add a search form at Content administration page (admin/content)?
I need it so that I can easily find a node when there are hundreds of nodes.


texts: Views event listing by date with up/down infinite scroll

texts:
I have a content type called "Event" which contains a "Date" field. What I want to achive:

1) Create a view which can display 5 events sorted by "Date" and displayed as following:

2 events which are previous to the current date
1 event which is of current or the nearest date
2 events which are following current or the nearest date

2) When these things are ready I want to have a possibility to:

scroll up and dynamically load 5 more "previous" events
scroll down and dynamically load 5 more "following" events

I understand how to do it with 2 different views displays (one for current and upcoming events and a block before with past events), but the thing is that I need to create a page slider (where each fullscreen slide is one event) which can be slide both before and forward over all site events (there may be a lot of them, so i can't just load all events at once and need to do it dynamically when sliding over). Will be very thankful for any idea how to create such a display using one view.


texts: How to display search results within the same Panels page

texts: I have front page with exposed filters and search results block on it within panels. In my case search results are displayed on a map. When i specify something in filters  and push "Search", i'm directed on search results page that has no panels and has path of front page's view. I want search results to stay within same panels as before i push "Search". How can i do it?


texts: updating webform submission display by using form

texts:
So, this is what I'm trying to do.
I've got a webform submission filled in and saved to the database. When viewing the submission (node/nid/submission/sid). I want to show a form, which ask the user for a key. When the key is filled in I want to change the display of the submission (not the data in the database) using the webform_submission_load() hook. This is the code right now:

// webform hook
function mymodule_webform_submission_load($submissions) {
   $key_status = mymodule_get_key_status();
   if($key_status) {
      //change the submission display values
   }
}

// return TRUE or FALSE, depending on form submit
function mymodule_get_key_status($setkey = FALSE) {
   $status = &drupal_static(__FUNCTION__);
   if(!isset($status)) {
      $status = $setkey;
      // display form when key is not provided
      if(!$status) {
         $getform = drupal_get_form('mymodule_form');
         $output = drupal_render($getform);
         drupal_set_message($output, 'form', FALSE);
      }
      // key provided in form, so don't display the form
      else {
         $errors = drupal_get_messages('form');
      }
   }
   return $status;
}

// form submit callback
   function mymodule_form_custom_submit($form, &$form_state) {
       if (isset($form_state['values']['form_value'])) {
          $key = $form_state['values']['form_value']);
          drupal_static_reset('mymodule_get_key_status');
          mymodule_get_key_status(TRUE);
       }
    }

When viewing a submission I see the submission and the form. When I submit the form nothing changes and the form is displayed again. When I debug the return value of the mymodule_get_key_status function the following happens. First the function return FALSE, then the form calls the function and the function returns true. After that the function is called again by the webform hook. The function returns false again... Not what I expected. When I call mymodule_get_key_status(); in the form submit callback it returns true. So the drupal_static is set properly.

Why isn't the code working as I expected?


texts: Render updated node data during views render

texts:
I have a view page which display node titles?

I'm also using workbench moderation module. During views rendering I check nodes and on certain condition I'm publishing the node from draft state using workbench_moderation_moderate($node, 'published');.

So is there any views hook Where i can use to set a revision of a node to publish and then views fetch the node's updated data?

I have tried hook_preprocess_views_view(&$vars) but it moderate the node to publish but then display the updated data on 2nd page referesh.


texts: Using nested node content type template files

texts:
Using Drupal 7 I have setup a structure in which a widget_set content type has a node reference field that allows the user to choose nodes of the content_widget content type.

The template files are node--widget_set.tpl.php and node--content_widget.tpl.php

Inside the node--widget_set.tpl.php template, I call print render($content); and was hoping to have the output be formatted as specified in node--content_widget.tpl.php, but I just get output that seems to ignore the content_widget template.

Is that the expected behavior?  I could just pull the code from the content_widget template into the widget_set template but I have a bunch of content_widget types and wanted to keep them all separate.

Thanks.


texts: How do I export and import content types (including fields) between environments?

texts:
I've been trying to find a smart way of exporting content type and all its fields from one installation of Drupal to another.
The core "Configuration synchronization" export only export the content type, but not its fields and configuration.

So far I have not met anything applicable for Drupal 8. All I can find is mentions of this functionality is possible in Drupal 7 module called Bundle Copy, which was never ported properly for 8.

I've also tried this, however I cannot find any good documenation on how the "drupal config:import" or "drupal config:import:single" works.

Is it really so hard to export and import content types between environments or have I missed something essential?


texts:
I have a content-type A which has a reference field to another content-type B. When creating/editing content with type A I let the user create/edit content of type B using the inline_entity_form module.

In this scenario, I like to pre-populate one field in content-type B. Here I'm using the entityreference_prepopulate module, but when I add the field to my URL its not populated? As example, if the field in B has the name field_myfiled , I write in the URL:

example.com/mypage?field_myfield=value1

This has worked before on fields which are rendered "normally". Is there something I'm missing since the filed is rendered by the inline_entity_form module?


texts: Is comment fields data store in render array?

texts: Is render array contain key-value entries that is generated by node module only? or comments fields also included?


texts:
I want to create a search that is able to index panels. The content in my Drupal system is mainly located in Panels (which contain Blocks with the content).

I installed Search API along with Fuzzy Search and i only get results for "normal" nodes/pages, but none for my Panels. Is there any way to add Panels to the search index?


texts: Doing a debug_backtrace() - White Screen when putting it in drupal_set_message()

texts:
I currently have the following code in my drupal_set_message()

1778 function drupal_set_message($message = NULL, $type = 'status', $repeat = TRUE) {
1779   if ($message) {
1780    if ($type == 'error') {
1781        $message .= ' '. print_r(debug_backtrace(), 1) .' ';
1782    }
1783
1784     if (!isset($_SESSION['messages'][$type])) {
1785       $_SESSION['messages'][$type] = array();
1786     }
1787
1788     if ($repeat || !in_array($message, $_SESSION['messages'][$type])) {
1789       $_SESSION['messages'][$type][] = $message;
1790     }
1791
1792     // Mark this page as being uncacheable.
1793     drupal_page_is_cacheable(FALSE);
1794   }
1795
1796   // Messages not set when DB connection fails.
1797   return isset($_SESSION['messages']) ? $_SESSION['messages'] : NULL;
1798 }

I'm trying to do a debug_backtrace on this function to find out which module is causing my error. Whenever i reload the page, I only get a white screen of death.

What could i be doing wrong here? Or what other quick methods like this can I find a module that is causing issues?


texts:
I have a content type in which I used a date field and for the same i have used this field -> https://drupal.org/project/date

My problem is I want to set the date format as  " September 13, 2013 | 3:39 UTC |"  , so I overrode the format and made it 'F j, Y \| H:i e' (refering to http://in3.php.net/manual/en/function.date.php)

but it is only showing the year (e.g. 2013| ), not other things.

Can anyone help me with this?


texts: How do I create a link to a view in Commerce Order listing?

texts:
I want to create a link on an order dropdown menu in commerce order that is attached to a view.  So for example, when you are looking at the list of orders, there is a drop down menu which has Quick Edit, Payment, Delete, etc.  I want to another element to this drop down menu which points to a view that I have created.

I have successfully added a link this dropdown menu using the following code, but it links to a form.

$items['admin/commerce/orders/%commerce_order/cancel'] = array(
    'title' => 'Cancel',
    'page callback' => 'bh_order_handling_ui_order_cancel_form_wrapper',
    'page arguments' => array(3),
    'access callback' => 'bh_order_handling_ui_cancel_access',
    'access arguments' => array(3),
    'type' => MENU_LOCAL_TASK,
    'weight' => 30,
    'context' => MENU_CONTEXT_INLINE,
);

What I want to do is link to a view that I have created at the path admin/commerce/orders/%/takehomeitems.

I have tried the following, using suggestions from http://zufelt.ca/blog/embedding-view-menu-hook-drupal

$items['admin/commerce/orders/%/takehomeitems'] = array(
        'title' => 'Take Home Items',
        'page callback' => 'views_embed_view',
        'page arguments' => array('bh_view_customer_donation_line_item','default',3),
        'access callback' => 'bh_donate_takehomeorder_access',
        'access arguments' => array(3),
        'type' => MENU_LOCAL_TASK,
        'weight' => 10,
        'context' => MENU_CONTEXT_INLINE,
        'file path' => drupal_get_path('module', 'views'),
        'file' => 'views.module',
);


texts: html5-respond.js not rendering CSS3 properties in IE7 and IE8

texts:
I am working on a drupal 7 website. I am using the zen theme as starter theme. But the html5-respond.js not functioning properly.

I have added border radius property for the boxes, but its not rendering in IE7,IE8. But the js is there and its calling properly.

Please advise me.

!DOCTYPE html>
<!--[if IEMobile 7]><html class="iem7"  lang="en" dir="ltr"><![endif]-->
<!--[if lte IE 6]><html class="lt-ie9 lt-ie8 lt-ie7"  lang="en" dir="ltr"><![endif]-->
<!--[if (IE 7)&(!IEMobile)]><html class="lt-ie9 lt-ie8"  lang="en" dir="ltr"><![endif]-->
<!--[if IE 8]><html class="lt-ie9"  lang="en" dir="ltr"><![endif]-->
<!--[if (gte IE 9)|(gt IEMobile 7)]><!--><html  lang="en" dir="ltr"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:dc="http://purl.org/dc/terms/"
  xmlns:foaf="http://xmlns.com/foaf/0.1/"
  xmlns:og="http://ogp.me/ns#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:sioc="http://rdfs.org/sioc/ns#"
  xmlns:sioct="http://rdfs.org/sioc/types#"
  xmlns:skos="http://www.w3.org/2004/02/skos/core#"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema#"><!--<![endif]-->

<head profile="http://www.w3.org/1999/xhtml/vocab">
  <meta charset="utf-8" />
<meta about="/files/clients/etihad/en/index" property="sioc:num_replies" content="0" datatype="xsd:integer" />

............

<!--[if lt IE 9]>
    <script src="html5-respond.js"></script>
    <![endif]-->


texts: How to change to default Localization Client language to translate

texts:
Localization Client allow me only to translate from English to one of others languages.

It is possible to translate from language x to English too?


texts:
I need to translate part of a website.
So I had enabled necessary modules : content translation, i18n + i18n sync.
Then create some translation of 2 differents content type (after setting them to enable translation).

Put the Language switcher block active, and it appear on translatable contents.
But when I want to switch, the link is good but system give me a 404.

In permission level, I see nothing to do .

What is missing in my settings ?

Thanks


texts: Multiple nodes from a single content type?

texts:
I'm trying to create a single content type that displays data across multiple pages for a client. For example:

DOG content type with fields:

List item
Name (Title)
Breed
History (Body)
Age
Weight
Height
Previous Owner Name
Previous Owner State
Previous Owner Gender

and then I would I like these pages created automatically:

/dog/<name> (overview page that includes Name, Breed, History)
/dog/<name>/details (includes age, weight, height)
/dog/<name>/owner (includes previous owner name, state, gender)

Each page would have a submenu that links to the other pages. I can create the first overview page no problem, but how would I create the the second and third pages? Would I look at the URL pattern to find content matching the name?


texts: How do I get the current node's parents (using PathAuto and Custom Tokens)?

texts:
A url for my site looks something like this:

www.mysite.com/best-sellers/mistery/novels/this-is-a-book-title

I want to remove "best-sellers" from that chain. I'm using PathAuto to generate my paths. The pattern I'm using is: [node:menu-link:parents:join-path]/[node:title]

I assume I can use Custom Tokens to create a custom token to use and get my desired url. The plan was to get the parent's for a current node, remove the first item (that uppermost parent), and spit out a url string that would result in this:

www.mysite.com/mistery/novels/this-is-a-book-title

Is this making any sense? Am I going about this the wrong way? Any suggestions on how to get this desired result?


texts: Determine conditions for Rules when changing field value

texts:
I've a Rule with below specification

Events:
After updating an existing user account

Conditions:
???

Actions
Create a Message

But I don't know how can I set a condition on field in rule condition part that return true when the field changed,any body know how can I add condition on specified field that return true when the field changed?


texts: Embed video code from third party providers

texts: I want embed video to my node, module "Embedded Media Field" do this for some third party providers, but I want embed videos from Aparat which not supported by emfield. is there any other solution?


texts:
I'm trying to test SOAP webservices using the webservice client module but I can't edit the datatype parameter which is set by default to arg0.

I've changed it to what is shown in the picture below but still the  soap request has that parameter set as arg0

EDIT:

Looking around I found the function drupal_get_form($form_id) which sets the arguments in the forms_state array, $form_state['build_info']['args'] = $args, using func_get_args() which gets a copy of the current user-defined function's argument list.

Not sure if that's the function which is causing me this problem but I really don't get why that  tag is wrong but the others are all correct.
I really don't know what to do as I've cleared the cache and ran cron already.

EDIT
 I found the class responsible of making the soap call, wsclient_soap.module, I modified the call function so as to have my own arguments but still the problem remains.

  public function call($operation) {
  $client = $this->client();
  $testargs= array(
ModelCRUDRequest => array(
    ModelCRUD=>array(
    serviceType=>"GetProductList",
    TableName=>"",
    RecordID=>"",
    RecordIDVarialbe=>"",
    Filter=>"",
    Action=>"Read",
    DataRow=>array(
      field=>array(
        val=>"",
        lookup=>array(
          lv=>array(
           val=>"",key=>""
                    )//endlv array
                      ),//endlookuup array
        type=>"",
        column=>"",
        lval=>"",
        disp=>"",
        edit=>"",
        error=>"",
        errorval=>""
                  )//end field array

                       )//end data row array

                     ),//end ModelCRUD
ADLoginRequest=> array(
  user=>"GardenUser",
  pass=>"GardenUser",
  lang=>"192",
  ClientID=>"11",
  RoleID=>"103",
  OrgID=>"11",
  WarehouseID=>"103",
  stage =>"0"        )//endADLoginRequest
    )//endModelCrudRequest
    );

try {
  $response = $client->__soapCall($operation, $testargs);
  return $response;
}
catch (SoapFault $e) {
  throw new WSClientException('Error invoking the SOAP service %name, operation %operation: %error', array('%name' => $this->service->label, '%operation' => $operation, '%error' => $e->getMessage()));
}
  }
 }

I think it has to do with the WSDL document

-<wsdl:message name="queryData"><wsdl:part element="tns:ModelCRUDRequest" name="arg0">
-</wsdl:part></wsdl:message>

Can someone please help me out?


texts: Drupal console report that mysql extension needs to be installed

texts:
Hi I am a novice at this stuff so that might explain the following:

During my Drupal 8 install I received the following:

  The libmysqlclient driver version 5.6.26 is less than the minimum
  required version. Upgrade to libmysqlclient version 5.5.3 or up, or
  alternatively switch mysql drivers to MySQLnd version 5.0.9 or up.

So when I tried to install mysqlnd it was conflicting with mysql, so I carried out the following command yum remove mysql and after removal, I installed mysqlnd with yum install php70w-mysqlnd (I have php 7 installed)

I was then able to complete the Drupal install, but when I run Drupal check, in Drupal console, it reports back:

  The extension mysql is recommended to install

Then when I carry out mysql -v the reply is:

  Welcome to the MySQL monitor.  Commands end with ; or \g.
  Your MySQL connection id is 22
  Server version: 5.6.31 MySQL Community Server (GPL).

Any advice would be welcomed, thank you.


texts:
For my use case, this question revolves around the entities node and paragraph.

Fields in my projects are created under the following structure:

content_h2
paragraph_h2
content_p
paragraph_p
...

etc...

For example, I'd like to create field_name on a node, check if it exists in paragraph entity storage and if not create it. And the other way around.

I've had some success but it seems like more coding than needed.

Does a hook exist for node add field?

Example form class: field-ui-field-storage-add-form.


texts:
I have a simple Entityform where the user selects from a list of Profile2 user profiles (internal staff and external staff). In simpler terms, the user selects from a list of entities (ie. pick 3 from a list of 10).

The Profile2 user profiles are being shown on the form via an Entity reference view so you can see the name (from user profile), picture (from user profile), status (from Profile2 staff profile) etc. associated with the selected users.

Unfortunately, the submission confirmation and submission screens only show the entity name (User Profile) instead of the actual user profile details. Basically I see:

Submitted by There, Hello on Thu, 03/05/2015 - 10:53
Person Selection
External Staff
Internal Staff

What I want to show is:

(picture) Joe Schmoe, Washington
(picture) Alex Trebec, Montreal

Does anyone know how to alter the confirmation and submission pages to show more detail about the underlying Entity (and/or associated Entity)?


texts:
Is there any way of finding the role given a list of permissions?

I.E.:

$permissions = array('administer content', 'access content');
$role        = find_related_roles();

// $role = array(4 => 'client')


texts: Does turning off features modules affect what the features modules does?

texts: I have a site that uses the media_vimeo module and I need to turn it off to install another module, but I can't turn it off as its currently being used by a bunch of feature modules. Would turning off these features modules affect the site or it doesnt matter as these features modules has already imported the needed changes to the site?


texts: some fields does not show using Display Suite

texts:
I build a content type and added fields as usual,after that I installed display suite module to control on layout I built a content type and added fields as usual after that I installed display suite module to control on display layout.

I selected "Two column stacked" layout to my content type, then i enabled print module to allow the users to print the nodes of content type.

the important point is i added a views (block display) as a dynamic field to that content type which the views has a Contextual filters (node id) but the problem is when i want to print the node and press the print link the views does not show in the print page.

I think the problem causing by "Contextual filters" because the node url http://localhost/demo/content-title/13 changed to http://localhost/demo/print/13 .

how to make the views block showing when printing ?


texts: session_unset logs out user when viewing the page

texts:
We have an application that we developed in Drupal 7 and I am tasked with migrating this form to Drupal 8.  I have a question about the session behavior which seems to have changed from Drupal 7 to 8.

Our application is a node and whenever that node is navigated to, or refreshed, the session is unset and restarted (for security purposes).

function fu_preprocess_node__application(&$vars) {
    session_unset();
    if(session_id() == ''){
        ini_set('session.gc_maxlifetime','28800');
        session_start();
    }
}

In Drupal 7, if I am logged in as an admin user and working on the form and I navigate to the application node to view it, I am fine.  However, in Drupal 8, when I am logged in to Drupal and I wish to view this page, the session_unset() logs me out and gives access denied errors for contentual/render and history/23/read.

What do I need to change so that we can unset the session for the application form but not get logged out as drupal user?  For the typical user of this form, who does not log in as a drupal user, this is not an issue.  But as an admin working on the form, it is an issue.


texts: Views - getting Title field from other content types via entity reference

texts:
I have two content types: speaker and session. Session has an entity reference field to speaker - when you create a session, you add references to one or more speakers.

I need to create a view of speakers and details from the speaker nodes, but also include the titles of the sessions that they're referenced on. I've added a relationship using the type Entity Reference: Referencing entity - A bridge to the Content entity that is referencing Content via field_speaker, and when I go to add new fields, I can see all of the fields from the session content type EXCEPT Title. The only Content: Title that's available is the one from the speaker nodes.

What do I need to do to get the Content: Title that's on the session node?


texts: How to have a node creation form on a separate node creation form?

texts: I'm on d7 and creating a "how to" site where users create a topic and add individual steps to it. I have a topic content type and a step content type and I connect them together by having an entity reference field on the steps so they reference the topic. I'm looking for a way to have an "add step" form on the topic creation page that will add a step and automatically reference the topic that I am creating. The field collections module gives me some of this functionality, but it makes it all in the one node being created. I need it to be separate content type because I want other users to be able to add steps to the topic after its been created, as well as commenting on specific steps and flagging. Any suggestions? Thanks.


texts:
We have just upgrade our server and now Our drupal 6 sites are not working properly because now the php version has been changed from 5.2 to 5.3.

is there any guide or suggestion about this? how to run a drupal6 with PHP5.3?

Thanks in advance.

Downgrading the php version from 5.3 to 5.2 solves the php problem and apparently the javascript problem as well.


texts: Views- how can I hide one specific value of a series of checkboxes displayed in views?

texts:
On my user profile, I am displaying a field that looks like this:

Choose your favorite fruits:

Apples
Strawberries
Bananas
Grapes
Click to enter your own

Using the Conditional Fields module, clicking "Click to enter your own" displays a text field where the user can input whatever they like.  This all works great.

However, if a user chooses "Apples", "Strawberries", and "Click to enter your own", when I display the user profile in views by adding the "favorite fruits" field, it looks like this:

Fruits I like: Apples, Strawberries, Click to enter your own

Needless to say this is very ugly and I want to hide "Click to enter your own"-- and that's all I want to do, hide that text.  Is there an easy way to do that?

EDIT: I'm attempting to find the values for my site for ($view->field['my-field-name']['my-field-value'].  Using print_r, it appears that the value I want to remove is: [field_purpose]['und'][0]['o']; "o" is the value of the checkbox for other in the field_purpose field.  However, when I use this code: ($view->field['field_purpose']['und'][0]['o'], I get this error: Fatal error: Cannot use object of type views_handler_field_field as array mymodule on line 325

Perhaps I have the value wrong?  When I use dpm instead of print_r (dpm($view->field['field_purpose']); I don't see the values of the checkboxes stored anywhere...

The dpm output is as follows:


texts:
I am using CKEditor for client side text editing.
All works fine. I see the content styled correctly
when node is saved.

The problem begins when the node content is added
to a view. The text styling font boldness is retained but the spacing options like indents are overridden
by the view settings.

What I wish to do is to retain the CKEditor styling
for the entire view display.
Is there are option in Views to achieve this?


texts: Is there a way to order views grouped fields?

texts:
I am using views to group a list of nodes by taxonomy term and display these groups as accordion headers (displayed by the views accordion module).

eg:

  Yellow:

node1
node2

  Green:

node1
node3
node4

  Mauve:

..

I have the nodes sorted by node:title (asc), but with or without the title sort, putting in a sort in for term:title does not seem to order the accordion headers as I had hoped. This might normally be a small niggle, but in this instance the end users are librarians...

I suppose I could go down the custom module route and devise my own block to display the terms/nodes without going through views. I would very much prefer not to do this, as it will be another maintenance demand for a quite complicated site.

The best I have found in looking for a solution is this discussion, but no solution is proposed, and I just have a nagging feeling that there must be a way to do this.

I would be really grateful for any suggestions.


texts: Create description for taxonomy term view

texts:
I am after a description which is similar for all taxonomy terms based on a schools location.

So I've created a few views based on continents at http://www.explorefreediving.com/freediving-schools-in-africa and then just added a description for that view and will be doing the same for the other continents.

"Improve your snorkeling, spearfishing and freediving with one of the many schools and freediving training courses held by apnea instructors across Africa."

I am now after a similar description for every country taxonomy term which is what I use to categorise the freedive schools.

So if you click on Egypt to the right when you are looking at Africa http://www.explorefreediving.com/school-location/africa/egypt you get sent to a taxonomy term and the same with other locations too

I want to be able to insert a description for the hundreds of taxonomy term school locations (countries) without having to manually do it? The most I know I could do is set up a description in each header and use tokens but is this the right approach? If it is, how do I do that exactly? I usually have problems with tokens and using the right ones.

If it is the right approach, doesn't that mean I will have that description across all taxonomy terms because the same view is used?


texts: entity_print module -> file_unmanaged_save_data writes a pdf with 0 bytes

texts: We have a custom written module (not by me), that uses entity_print to create PDF documents. It was working fine until I upgraded drush from 9.0-beta4 to 9.5 (had to update drush commands). The functions all look like they are working the same as before, but the PDF written to the public:// directory is a file with 0 bytes. When I look at the /tmp/ files created in the process, they have the correct data written to them. Any ideas or hints as to how to debug this?


texts: How to allow users change theme for specific pages

texts:
A page has been created with panels which list all the contents of each user.
I want to allow each user to be able to change the theme used for his own panel page.  Whenever anyone visits the user panel page,  they should see the theme of that user.

I have tried themekey but it only allows for sitewide theme.

What else can i do?


texts: How to implement a user profile attribute to indicate "Where did you hear about us"?

texts:
I want to add a "Where did you hear about us?" checkbox list to user profiles. There will be 6 radio buttons and an "Other" textfield.

There's no need for a taxonomy vocabulary, which was my first thought. I also thought about using Webform, but that feels like overkill and I think I'd have to do more work to link the form to the user.

Really, I just want to view the user profile and say "Oh look, they found out about us from twitter ...". So what are good techniques/approaches to implement this?


texts: I use drupal 7 for creating a site for patient remote treatment. I have used profile2 and i create to profile types patient and doctors. finally i installed OG groups(treatment). I want to add patients and doctors to this group. Every patients should be assigned by administrator to a doctor. Patient could ask his/her question from his/her doctor and only doctor and patient could see this documents. Is it possible to have private permission for some users?


texts:
How can i use block regions in my node.html.twig in drupal 8 ?

i tried this :

block_get_blocks_by_region

but function not found


texts: How to ensure CiviCRM checksum / cid are valid in custom Drupal module

texts:
Follow up to an earlier question:

I am writing a simple custom Drupal module to display information about a contact's related organizations (see above for more background if interested).

One use case is that a logged in user sees this info, in which case determining whether to show the info is easy (I just use the Drupal contact ID to pull information from CiviCRM).

However, if someone visits the page from a checksum link sent via CiviMail, Drupal considers the user to be anonymous. I can pull the cid (CiviCRM contact ID) from the URL easily enough, but I need to be able to also verify the checksum in order to display information without a possibility of an information leak. How do I do that?

I found this function:
CRM_Contact_BAO_Contact_Utils::generateChecksum($contactId) but this generates the checksum. I just need to verify an existing checksum (from the URL), not create a new one.


texts:
I have my local site running on my Win 7 machine using Acquia Dev Desktop.

I also have a "live" version of the site.

In both environments I cannot upload an image for an article. I must have messed something up because it was working several days ago.

This link https://www.drupal.org/documentation/modules/image was useful, but the suggestions on Troubleshooting/The image doesn't show up didn't fix the problem. I'm sure it's because I don't really understand what I'm doing.

I'm wondering if a disable of the image module then a re-enable would solve the problem?


texts: Why can't I disable or enable the block cache?

texts: In the admin/settings/performance page, I (the administrator) cannot enable or disable the block cache. Why?


texts:
I have an ecommerce site using the module views isotope to display the product grid. After a recent upgrade, It looks like my view is broken and I'm getting this warning:

  "Warning: in_array() expects parameter 2 to be array, string given in
  ...(my theme directory)".

The warning can be viewed here: http://biltriteinc.com/?q=supports

What is causing the error?


texts: Migrating multivalue link fields from CSV

texts:
I am trying to migrate data from D7 to D8 using Drupal Migrate with source CSV. I am able to import all the data except multivalue link field. With the help of examples from Migrate Plus, I am able to import single value to it. But its not happening with multiple value.
The CSV file is like this
title,related_links_title,related_links_url
"Node 1","Link Title 1, Link Title 2, Link Title 3","http://www.google.com, http://www.google.com, http://www.google.com"
"Node 2","Link Title 1, Link Title 2, Link Title 3, Link Title 4","http://www.google.com, http://www.google.com, http://www.google.com, http://www.google.com"

And the migration file looks like this:
process:
  field_related_links/uri: related_links_url
  field_related_links/title: related_links_title

When I run this migration, I am not getting any errors but all the data is coming in a single field rather than splitting it to multiple fields. Do I need to create a subprocess to handle this?


texts: Argument 1 must be an instance of Drupal\tcdev\Controller\UserAuth, instance of Drupal\user\UserAuth given

texts:
I want to programmatically log in a user with a custom controller. I want to pass my data with $_POST to the route (I pass data from a mobile application); if username and password are correct, the method/function should return TRUE.

The route is the following one.

tcdev.login:
  path: '/tclogin'
  defaults:
    _controller: 'Drupal\tcdev\Controller\MYCenterController::login'
    _title: 'Login call back'
  requirements:
    _permission: 'access content'

The code for the controller is the following one.

namespace  Drupal\tcdev\Controller;

use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\DependencyInjection\ContainerInterface;

class MyController extends ControllerBase {

    /**
     * \Drupal\user\UserAuth definition.
     *
     * @var \Drupal\user\UserAuth
     */
    protected $userAuth;

    /**
     * {@inheritdoc}
     */
    public function __construct(UserAuth $user_auth) {
        $this->userAuth = $user_auth;
    }

    /**
     * {@inheritdoc}
     */
    public static function create(ContainerInterface $container) {
        return new static($container->get('user.auth'));
    }
    }

    public function login() {
        $uid = $this->userAuth->authenticate($_POST['user'], $_POST['pass']);
        $acc = User::load($uid);

        //return new Response('Hi ' . $uid);
    }

}

It returns me the following error:

  TypeError: Argument 1 passed to Drupal\tcdev\Controller\MyController::__construct() must be an instance of Drupal\tcdev\Controller\UserAuth, instance of Drupal\user\UserAuth given, called in /Users/yms/Sites/devdesktop/gttc/modules/tcdev/src/Controller/MyController.php on line 32 in Drupal\tcdev\Controller\MyController::__construct() (line 23 of modules/tcdev/src/Controller/MyController.php)

Where is my mistake?


texts: How to clear CSS and Javascript with a bookmark?

texts:
I would like to clear the CSS and javascript in D7 with the help of a bookmark.

Currently this is:

<domein>/admin_menu/flush-cache/assets?token=<tokenid>

This is working however the tokenid is changing all the time. It there a easy solution for this so I don't have to change the tokenid in the bookmark every time?


texts:
What would be the best way to show the nodes from a view in a lightbox, triggered by a single image?
The idea would be that a nice photo is shown on a frontpage. When users click on it, a view is opened in a lightbox/thickbox/colorbox/*box. This then shows all nodes in the view.

I currently manage to do this for only images with colorbox, but that's not sufficient as I would like to show captions etc.
I would like to use the full colorbox functionality, rather than just the image. I tried using an iframe, however this meant every node is shown with the full site theme (header, logo, footer etc) which is not what I want to do.


texts:
On a Drupal 7 site I have a view with a bunch of exposed filters (using Views + BEF) for taxonomies. Some of these taxonomies have terms with different depths. Is there a way I can dynamically show only the values of a specific depth? For example, one filter would have the depth 0 terms, another would have just the depth 1 terms.

I know that I can use "Limit list to selected items" and manually do it, but that feels clunky and requires more maintenance as terms are added. I also tried playing around with simple hierarchical select without success.

Is there some way of achieving this without manually adding terms to the exposed filter option list?


texts: Is updating the composer.json file & consequently composer.lock in Drupal 8 considered a good practice or hacking the core?

texts:
I have been working with another developers on a scaffolding tool for Drupal8 based on Symfony Console component.

The current setup process includes updating composer.json using composer CLI:

COMPOSER_BIN_DIR=bin php composer.phar require hechoendrupal/drupal-app-console:dev-master

Maybe writing to core/vendors is not the best practice any suggestions


texts: Looking for something similar to "Views selective filters", just with "inactive" instead of "removed"

texts:
The Views Selective Filter module reduces the filter items in a views exposed filter to only those having actually results.

I'm searching something similar, but I don't want to hide the options with no results, instead I want to make them inactive (shown greyed out).

The exposed filter list I have is just a vocabulary with some category terms.

Is there a module for this somewhere out there? Or how can I achieve that?


texts: Are "files[]" from custom_module.info not included on form submits?

texts:
I have a module that I am porting to Drupal 7 (specifically, Taxonomy Views Integrator) and there are 2 include files tvi.admin.inc which were included via the module's .info file:

files[] = includes/tvi.admin.inc

The tvi.admin.inc houses the functions that the tvi.module's hook_form_alter() uses, including the validation & submit functions

Although alterations made using the hook_form_alter() work properly, after submit the validation & submit functions in tvi.admin.inc are not available and throw an undeclared function error.

p.s.

I've checked the initial issue for the extended .info module registry via:
http://drupal.org/node/224333#registry and it does say the following which may provide us with an answer:

  Files containing only functions need
  not be listed in the .info file.

As a Workaround,

I now use module_load_include() to load the tvi.admin.inc at the top of the tvi.module which, on form submit, still includes the inc and thus the validation / submit functions.


texts:
How do I get machine name by entity type and its ID?

The code I am using is the following.

$block = \Drupal\block_content\Entity\BlockContent::load(2);
$render = \Drupal::entityTypeManager()->
getViewBuilder('block_content')->view($block);


texts: Can't find custom block php code in the database

texts:
I've created a custom block in Drupal 7, to display, in the upper right corner on every page, a menu that is context sensitive.  Based on certain user attributes some functionalities are enabled or disabled.  This block displays a list of available functionality to the user.

small example:

write new article

<?php
    if (og_is_member('node', 12, 'user')){
        print('
Board of directors
');
        print('
statistics
');
    }
?>
<?php
  global $user;

  // Check to see if $user has the administrator role.
  if (in_array('content_manager', array_values($user->roles))) {
            print('
Manage comments
');
  }
?>
Log out

I've noticed that when I make an SQL dump on the live site and put it on my laptop's local database for backup, this context sensitive menu is not there, while on the production site it displays just fine.
first I thought I just had to readjust the visibility settings of this new block on the backup site.  But when I visited admin/structure/blocks the block wasn't even there.  So I figures something must have gone wrong with the sql dump.  So I tried again, still no block in the list.
This new block's name is 'nav_menu_block', so I did a text search on the sql dump from the production site.  Nothing....
So I googled a bit to find out where the data for custom blocks is stored.  Found a few web pages stating this is stored in the table "block_custom".  But when I go there with phpMyAdmin, this table is empty.

So now I have this problem:  if I ever have to put the backup version up again it will not contain this new block, and who knows what else will be missing....

Can anyone PLEASE tell me where to find the data for this custom block with PHP code in the database?

many thanks


texts: Howto update content author in bulk from feeds importer?

texts:
I am using Feeds and 2 importers to:
- Import content
- Import users

Now I want to link the users to their content. The type of content I am importing has an owner how needs to be able to edit his content. Therefore it is necessary that the user is linked to the content as an Author.

What is the best way of doing this?

I have a primary key of the content which I can save on the user of necessary.


texts: How do I filter a view with a contextual filters on a custom date field?

texts:
I am using the Quicktabs module to filter out posted that have a field value that in the date range specified. If you have a better solution in mind, please let me know. I am running Views 3.5 and Drupal 7.16

QuickTabs layout
I should be able to pass arguments to it to generate the new date sorted views using a contextual filter on the view.
Contextual Filters
I was able to query with the other contextual filters just fine but the date doesn't want to work at all.
What I would like to do is have a tab 4 date ranges (see first image) and clicking on the tab would load the content items with a that take place in a the range of specified dates. How can I get this to work? Is there a url query that I can pass as the argument for the start date field?


texts:
I have a problem on saving a specific node. When I try to save it the overlay doesn't disappear, but the node is correctly saved and updated.
If I change node title everything works good.

I attach an image below:


texts:
I am using the Userpoints module. Using that, when I click the "My Score" link I am viewing a table with list of points.

There are 6 headers and 6 rows displaying. In that table, I need only 3 headers and 3 rows to display.

As of now, the module shows the following headers:

Points
Approved
Date
Operation
Category
Description

What I need to display is the following headers:

Points
Date
Description

How can I achieve this?


texts: Allow authenticated user to create an article

texts: hey im fairly new to D7 and ive noticed that there isn't really a way to create an article without the admin toolbar, but i would like users of my websites to be able to create articles. How would i do this without giving them access to the toolbar?


texts: I have added french language in Drupal, also added french product with MC trademark, every places are coming fine but in breadcrumbs it is not come. How to fix french trademark with MC to breadcrumb?


texts: Multiple Views filters criteria : query with LEFTJOIN instead of INNERJOIN?

texts:
I created a view with 2 FILTER CRITERIA (Content: Has taxonomy term) exposed to visitors.

For testing purpose, I have 2 vocabularies with 2 terms inside :

Vocabulary 1

T1
T2

Vocabulary 2

T3
T4

I have 2 articles. Article 1 is only PART of T1.

If I select T1 and Any, I have no results but I should have result because I use OR operator(see screen shot).

Is the view filter criteria correct ?

If this article is T1 and T3 and i select T1 and T3, it works. If I select any and any, it works and i see my 2 articles.

See 2 cases :

1)

2)

How can I have a query with LEFTJOIN instead of INNERJOIN ?


texts:
I'm trying to recommend a good payment gateway for a client. We'll be using ubercart, and one of the main requirements is recurring automatic orders (recurring/subscription model I guess).

Also important is the ability to not store the credit card data on the server.

What options are there for this? The main one I see is an authorize.net cim module. Is this the option I should recommend? What other options are there?


texts: This is probably a simple question, but how do you ensure a page view sites above a block on a page? Currently I have a page view which displays some content and then have a block view which holds some other content.This block view was added to the page view via the blocks page. Problem is the block appears before the page view content, any ideas on how to reorder this?


texts:
I updated my Drupal 8 website from 8.2 to 8.3. I have a module that has a block and includes a configuration form which has various data form fields.
The block of the module appears to work fine.
But when I try to update any of the configuration data it simply doesn't change anything! Something to do with not updating the database, maybe?

Example: I want to change the modules block name.
The old name is "oldname" and I want it to be "newname". After typing in the new name on the configuration page and clicking save the name will still remain "oldname".

There is not a single error within Drupal or my servers log file that would explain this.
Is there anywhere else I can look to find what the problem is?

What's changed with the new version of Drupal that might cause this?

After searching for awhile and cleaning out some old modules from the database I've finally come across an error relating to forms. It' quite long but here's the first part:
Warning: strip_tags() expects parameter 1 to be string, array given in Drupal\favorites\Form\AddForm->buildForm()


texts: Export hidden fields to CSV with Views Bulk Operations (VBO) module

texts:
I use Views Bulk Operations (VBO) module and VBO export module. I have a Table display with a couple of fields. Is there a solution to export also fields which are Exclude from display (hidden)?

So they will be exported, but not visible in the view?


texts: Is there a way to change views_slide show "image 1 of 3" to be 3 circles, where the active one is black and the rest are grey? I tried doing that in CSS but does not look like its the right approach for doing this.


texts: Show a webform input if user selects certain option from select list?

texts:
Im making a webform with a select list. If you chose a certain option in the select list I need a text input field be be revealed.

Can this be done by Drupal or should I write some jQuery to show / hide the input?


texts: Related Content View with multiple Entity Reference Fields

texts:
I am trying to create a View to display related content based on shared taxonomy terms from multiple vocabularies.

For example:

I have two content types called Car and Parts.

I have two vocabularies called Type and Country.

Content Types:

Car

Entity Reference: Type
Entity Reference: Country

Parts

Entity Reference: Type
Entity Reference: Country

Vocabularies

Type: sedan, convertible, coupe, van, suv
Country: usa, japan, germany

I would like to display a view of related Parts when viewing a Car node.  Furthermore, I only want to display if both Type and Country match.

I’m able to get either Type or Country matches to display by adding the following relationships.

Content: Taxonomy terms on node
(term) Entity Reference: Referencing entity (type)
(term) Entity Reference: Referencing entity (country)

and a contextual filter of:

(Content referencing Taxonomy term from field_country) Content: Nid

Basically, switching the relationship on the contextual filter determines whether or not Type or Country matches should be displayed.  I am having trouble figuring out how to display Parts that match both the Type and Country of the Car.


texts: Adding another date using the date repeat API

texts:
I'm using the Date Repeat API in Drupal 7 to create an interface for a user to add in a recurring event. As it comes out of the box, it only allows for one date, then you have to save the node and re-edit. I've commented out the date_form_field_ui_field_edit_form_alter() in date.module which hides the multiples values option which I thought would allow the associated API to show the 'Add another item'  button. When I go into the 'manage fields' form in the Content Type, I've set the form to 'unlimited' values and saved it. However when I load the content type, the normal date which still has the 'Add another item ' button but the recurring date time does not.

I'm trying to add this since the event that it is attached to might well have a second recurring time for that event, for example it happens every Monday and every second Wednesday. Whilst I am aware that you can do this through saving and re-editing, from a UI perspective it would easier to allow a user to add more than one form of recurring event if needs require.

I'd be grateful for any guidance in solving this issue. Thanks.

Update: I've been doing some more digging and it appears that the 'repeat' code is a form linked off the date_request_api, but I cannot see why the field created in the Content Type admin UI does not appear to pick up on the multiple values setting.


texts: How to set default value in entity form?

texts:
Created an entity form with base field definition,

$fields['options'] = BaseFieldDefinition::create('text_long')
      ->setLabel(t('Answer choices per line'))
      ->setDescription(t('Multiple answer options will be seprated by next line.'))
      ->setDisplayOptions('view', array(
        'label' => 'hidden',
        'type' => 'text_default',
        'weight' => -1,
      ))
      ->setDisplayOptions('form', array(
        'type' => 'text_textfield',
        'weight' => -1,
      ))
      ->setDisplayConfigurable('form', TRUE)
      ->setDisplayConfigurable('view', TRUE);

while saving this value to database, I serialized its content and then save. But during form edit, I want unserialized data. How can I set default value in this form?

class MyForm extends ContentEntityForm {

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {

    $form = parent::buildForm($form, $form_state);
    $entity = $this->getEntity();
    $choose = $entity->get('options')->getValue();
    foreach ($choose as $key => $value) {
      $defaultValue = unserialize($value['value']);
    }

    $form['options'] = array(
      '#default_value' => isset($defaultValue) ? $defaultValue : '',
    );
    $entity = $this->entity;
    return $form;
  }


texts: How can I display multiple images of single image field each in a different row?

texts:
I need to render multiple images that belongs to single image field, each on its own views row.

While on a view single field setting, inside "Multiple field settings", uncheck " "Display all values in the same row", But all values are still displayed on same views row.

How can it be done in Drupal 8?


texts: Dealing with files when file system is set to private download

texts:
I am working on a site where the file system security is a bit important. So we have it configured to use a private directory with the private download method is enabled. And this works great for the most part.

However, the Avatar Crop module is having a problem. Specifically during the cropping process it is trying to send the system path on the server to the image "src" parameter and not a path that will display it through the private download method. Another person reported this bug, but the maintainers just ignored it. So now I have this problem too and I am trying to fix the module (and submit the fix to the community).

To fix it I am exploring other modules like ImageCache and the CCK filefield module. So far I am not having much luck in recognizing how to work with this private download method. Can anyone explain how the file is supposed to be retrieved through the private download method?


texts:
I am experiencing an error when creating some nodes of a particular content type on my site: It triggers a 500 error when users try to save the node. When I look into the log error this is the message displayed:

  Notice: Trying to get property of non-object in _MO_events_is_event_page() (line 461 of /var/www/Server_Name/htdocs/MO/sites/all/modules/features/MO_events/MO_events.module).

Does anyone have any ideas as to what may be the cause?

Here is the Code on line 461

function _MO_events_is_event_page() {
  $is_event = &drupal_static(__FUNCTION__);

  if (NULL === $is_event) {
    $menu_item = menu_get_item();
// If the current menu router is a node of type event or virtual_conference we're on an event page

     //Line 461:
    $is_event = (TRUE === isset($menu_item['page_arguments'][0]) && TRUE === isset($menu_item['page_arguments'][0]->type) && ('event' == $menu_item['page_arguments'][0]->type) || 'virtual_conference' == $menu_item['page_arguments'][0]->type);
          }

          return $is_event;
        }


texts: How does Acquia Dev Desktop create the connection to the database?

texts:
I am using Acquia Dev Desktop 2 on my windows 10 PC in order to develop Drupal 8 websites.

As far as I know, every Drupal website requires a connection between its files and the database
which is accomplished by using the following code in the setting.php file.

$databases = array(
  'default' => array(
    'default' => array(
      'database' => 'databasename',
      'username' => 'sqlusername',
      'password' => 'sqlpassword',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
    ),
  ),
);

I downloaded Drupal 8 and I imported it in Acquia Dev Desktop 2 using the
Import local Drupal site option.

The site is correctly imported and installed; a new database has been created.

I cannot see the above database connection code anywhere in the settings.php file.

I noticed, however, that the following code is added to the bottom of the setting.php file.

// <DDSETTINGS>

// Please don't edit anything between <DDSETTINGS> tags.

// This section is autogenerated by Acquia Dev Desktop.

if (isset($_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR']) && file_exists($_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR'] . '/loc_sitename_dd.inc')) {
   require $_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR'] . '/loc_sitename_dd.inc';
}

// </DDSETTINGS>

How does Acquia Dev Desktop 2 create the connection between the site's files and the database without using the common database connection code shown above?

When moving my website from the local development server (Acquia Dev Desktop) to a remote server, I must create a connection to the database. Is it safe to delete the code between the <DDSETTINGS> tags added by Acquia Dev Desktop 2*?


texts: How to read JSON data from external URL and display it in a node

texts: I want to read json data from external url and display those data in a node. After that I would like to add filters in the result using views. I have created a view using external url(query settings) and display result in a block.. But I cant add filters for that. How to add Filters for that data.. I am new to this.. Please help me..


texts: Number of paragraph items and translation

texts:
I know that Paragraph field itself are not translatable for some reasons. I wanted to know if we could still have separate number of paragraph items between two translations of a node.

Example:

Node 1 FR

Paragraph 1
Paragraph 2

Node 1 EN

Paragraph 1
Paragraph 2
Paragraph 3

I found no clear explanations on that.


texts: In Views admin, is there a section to insert CSS to style the view? i.e. how to style view without editing theme code or other drupal PHP?

texts:
In the Views admin (i.e. admin/structure/views ), is there a section in the settings to insert CSS to style the view? i.e. how do I style a view without editing theme code or other drupal PHP?

I am able to find out which class identifiers that I need to style - see question/answer at:
Which html div classes are relevant when styling Views in Drupal 7 (for CSS)?

But I don't know where to put the CSS code to actually style the view.

I assume that it is possible to style a view within the drupal views admin pages, without having to resort to editing/creating themes, PHP and HTML code via FTP (?). Obviously one can do those things too but I'd rather try to find a (non-theme specific) solution within the views admin first.


texts:
Drupal is fast at develop, but the performance is so poor.
It is hard to reach 50 request per second.

And there are so many SQL queries in a simple web page.
If you test the request time of a form submit in Drupal.org it will always take seconds to finish.

How do you improve the speed of your web site?


texts: Set number of values for a field in an entityform type based on a fixed value

texts:
I'm working with an entityform type that has a field with unlimited input values, so with the default button "Add another" I can add multple values for a field.

I'd like to fix this number of values, maybe with a get or post value, so I can preselect a specific number of values and then limit user to fill a specific number of fields.

Example:
first select how many items to order --> user selects 4 items --> user must fill 4 values of the same field and user can't add more or less then 4 items.

Do you think it's possible with drupal modules?


texts: Views filter group "or" operator not working

texts:
I'm having an issue with the "or" operator in a view acting like an "and" operator (at least, I think that's what it's doing).
The view is meant to display articles with either "Primary Feature" checked, or one of the "Secondary Feature" options selected. The "Secondary Feature" is a list of radio options with three values: Secondary Feature 1, Secondary Feature 2, Secondary Feature 3. I've tried setting up the view a couple ways, first with a single "Secondary Feature" filter using the "is one of" operator with all three values selected (first screenshot), and second with three "Secondary Feature" filters, each using the "is one of" operator with only one value selected (second screenshot).

There are only four articles these filters apply to, one with each type of feature selected (1 Primary Feature, 1 Secondary Feature 1, 1 Secondary Feature 2, and 1 Secondary Feature 3).
From the Googling I've done it seems that checking "reduce duplicates" fixes this issue for some folks but it doesn't here. When I check "reduce duplicates" on the Primary Feature and Secondary Feature filters, it displays the article with "Primary Feature" checked, but none of the articles with "Secondary Feature" checked.
Any ideas on how to fix this?
Edited to add: This is on Drupal 7.


texts: Are there any custom block type template naming conventions?

texts:
With our ability to create custom block types and manually add additional fields in Drupal 8, is there a simple naming convention to create block--custom_block_type.html.twig to handle the layout of additional fields?

Example: using theme hook suggestions for content types: node--content_type.html.twig

Are custom block types able to be handled this way without going the module route?


texts:
Why can't Drush find the Drupal core module?

root@hostname:/var/www/html/sites/example.org# drush pm-update core

...
Wysiwyg (wysiwyg)                        7.x-2.2         7.x-2.2         Up to date
core                                     Unknown         Unknown         Specified project not found

So then I tried:

root@hostname:/var/www/html/sites/example.org# drush -r /var/www/html -l example.org pm-update core
...
Wysiwyg (wysiwyg)                        7.x-2.2         7.x-2.2         Up to date
core                                     Unknown         Unknown         Specified project not found

I have used both these commands in the past to update other Drupal modules and it has always worked, until I have to update the Drupal core module.  Can Drush not handle this or is this a bug?


texts:
Right now I have images above each menu item (added in my CSS as background images assigned to a class in each list item) in my main menu. I would love to be able to have the image also as a link rather then just the text below it. To do so I need to have my entire list item as the link. I am pretty sure CSS can't do this and that I need to adjust my template.php, but I don't know enough about php just yet to be moving things around. Any help would be appreciated!

An example of what I would like:

About Us

Example of what I have:

      About Us

And this is what I have in my template.php

<?php
function motg_menu_link(array $variables) {
  $element = $variables['element'];
  $sub_menu = '';
  $element['#localized_options']['html'] = TRUE;
$element['#attributes']['class'][] = 'menu-' . $element['#original_link']     ['mlid'];

  if ($element['#below']) {
$sub_menu = drupal_render($element['#below']);
 }

 if ($element['#original_link']['menu_name'] == "main-menu"){

$element['#title'] .= ''.$element['#localized_options']['attributes']['title'].'';
}

$output = l($element['#title'], $element['#href'], $element['#localized_options']);
return '
' . $output . $sub_menu . "
\n";
}


texts: What is the right place for Product Image

texts: We can take image of product through Product Type or Product Display content type, I just want to know what is the right place for product images fields ?


texts:
On a Drupal website I want to redirect the visitor to a landing page based on the users location. I need this to be more specific than just the users country, but rather I need the province inside the country. When the user does not allow to be located, the user will go to the standard landing page...

Is there an (easy) way to achieve this? I am fairly new to the world of Drupal.


texts:
I facing issue with OG 7.2x and image.

I create a group content type and add new field with image. After that i upload some picture, and view with colorbox working fine.

After that, i create normal view all things is workings well. if i add contextual(OG member:group id) and relationship(member from og node), the picture disappeared and nothing display under OG view.

Would you please tell me that how to do this?

Many thanks.


texts: How to perform bulk operations on a view when the view is displayed but without the need to select rows?

texts:
I would like to execute certain Rules based bulk operations on a view (using the VBO module). But not the way they are normally done when using VBO, i.e selecting the rows in the view and then clicking the operation to execute.

Instead I want VBOs to get executed when the view page is displayed. So that I dont need to select the rows and execute VBO operations on them.

Any suggestions?


texts: Multiple values in creating a new field instance

texts:
This is the code I actually have:

$instance = array(
    'field_name' => FIELD_PROJECT_TAGS,
    'entity_type' => 'node',
    'label' => $vocabulary->name,
    'bundle' => 'portfolio_project',
    'required' => true,
    'widget' => array(
        'type' => 'taxonomy_autocomplete',
        'behaviors' => array(
            'multiple values' => FIELD_CARDINALITY_UNLIMITED,
        ),
    ),
    'display' => array(
        'default' => array(
            'type' => 'taxonomy_term_reference_link',
            'weight' => 10,
        ),
        'teaser' => array(
            'type' => 'taxonomy_term_reference_link',
            'weight' => 10,
        ),
    )
);
field_create_instance($instance);

What's wrong with this? Why does the portfolio module allways install this field with allowing only one value?

Hope somebody can help. I'm bit frustrated.


texts: How should I file an issue on drupal.org that affects multiple modules?

texts:
I have an issue that is caused only when three modules are enabled together (logintoboggan, pathauto, and entity).  When I upgrade entity from rc1 to rc3, one of the functions of logintoboggan breaks if pathauto is enabled.  I have attempted to determine which module is interfering with logintoboggan, or if it in fact is logintoboggan itself that is at fault, but this exceeds my debugging ability.

So, in cases where one has an issue where a specific combination of modules causes an error, where should the issue be filed?  Should only one issue be filed, or should multiple issues be filed and linked to one another?


texts: Strange "Anonymous" user events showing up after node edit, diff, or save

texts:
So I'm not sure how to even ask this question or debug it, but it's causing quite an issue on our production and dev servers.  Normally we send out emails with diff information on them whenever a node is updated, saved, or new.  All of this is happening using Rules and the Diff module and helps let our team know when a node is getting new info added to it.

The strange part is that every time a node is changed we get one email from the user that changed it and then another email immediately after that has Anonymous set as posting a change.  Similarly if you go and check Diff on the live site it will show that Anonymous has logged a change even though nothing on the node has actually changed by Anonymous.

Permissions all are set correctly and I haven't seen any other information out there in the drupal world that is similar to this.  Does anyone konw why drupal would be logging Anonymous randomly on node changes?  Thanks, just stumped at where to begin.


texts: My custom page.tpl.php file is not picked up

texts:
I have a site running in a subdir of my main site, like www.mysite.com/drupal.

I want to use a separate page.tpl.php file for my about page www.mysite.com/drupal/about.

I have tried naming the file page--about.tpl.php and page--drupal--about.tpl.php but neither is working. It just loads the regular page.tpl.php file.

This seems really straightforward and one of those should be correct. Is this buggy because Drupal is in a subdir or am I doing something wrong?

(And yes, I've cleared the cache.)


texts: How to redirect from node view to node edit page in a view?

texts:
I need on of the views in my Drupal design, which is using node title linked to the node content view, just redirect form node content view page to that node edit page.

How would it be possible? If it needs coding please write the code. Thanks

(My Drupal version is 7.x)


texts: Add Secondary Sort To Commerce Kickstart Facet Search Product Display

texts:
I have a field in each Product called 'Search-Rank'.

Using the default /Products view, with Facet Sorts by Title and Latest.  When the visitor sorts on Title or Latest I want the view to sort by Title and -then- this Search-Rank.

How can I add a fixed -secondary- sort by another field?

I don't need Search-Rank to be visible as a Sort Option. I just want it to be a secondary term in the SQL Query. Eg.

SELECT fields WHERE <facet_filter_fields> ORDER BY <facet_sort_field>, search_rank ASC

Adding a Sort to the View disables the Facet Sort. So where does one 'hook' into the SQL Query to add that secondary sort term?

What am I missing?


texts: How to change the text in the revision log message?

texts:
I would like to change the bottom text, "Provide an explanation of the changes you are making. This will help other authors understand your motivations.", in the revision log message section.  See attached screenshot.

How should I go about changing the text?


texts: Manually invoking Ajax Commands when an ajax callback is not an #ajax form callback

texts:
My original post caused some confusion, so I'm re-writing it for clarity.

In Drupal, if you have an #ajax callback in a form, you can do something like this:

function my_ajax_callback(array &$form, FormStateInterface $form_state)
{
  $response = new AjaxResponse();
  $response->addCommand(new AlertCommand(t('This is from an ajax callback'));
  return $response;
}

This in turn triggers Drupal.ajaxCommands.prototype.alert(), which is located in ajax.js.

Alternatively, I can create an ajax callback of my own, that has nothing to do with a form. example.routing.yml:

mymodule.ajax
  path: '/mymodule/ajax'
  defaults:
    _controller: 'Drupal\my_module\Controller::ajaxCallback'
  # (remainder not shown)

I can create an AjaxResponse in this callback:

class Controller extends ControllerBase
{
  public function ajaxCallback()
  {
    $response = new AjaxResponse();
    $response->addCommand(new AlertCommand(t('This is from an ajax callback'));
    return $response;
  }
}

In this case, debugging has shown me that the AjaxResponse returns my command to the browser, but Drupal.ajaxCommands.prototype.alert() is not triggered.

Further debugging has shown me that ajax commands are only triggered if the AjaxResponse comes from an #ajax callback in a form, not if it's from a non-form ajax callback.

So my question is, does anyone know how to invoke ajax commands when the commands are returned from non-form ajax callback?


texts: How could the contextual filter "Content: Nid" return the TNID instead of NID?

texts:
I am using the contextual filter "Content: Nid" in Views3, and I want it returns the TNID instead of the NID When the filter value is NOT available.

I tried the following code.

$node = node_load($argument);
$argument = $node->tnid;
return $argument;

I also tried the following code.

$node = node_load(arg(1));
$argument = $node->tnid; // bzw. $argument(1) = $node->tnid;
return $argument;

I used that code in Provide default value:PHP Code Field, but nothing worked.

I solved the problem by adding this code to the page.tpl.php.

$imagemenuview = views_get_view('projectimagemenu');
echo $imagemenuview->preview('block', array($node->tnid));

I am still interested in the solution using the contextual filter "Content: Nid" returning the TNID instead of the NID When the filter value is NOT available.


texts: How can I export all users in a CSV format?

texts: A site we have over 8000+ users with Views, Ctools and VBO installed. Is it possible to export all users data into 1 CSV file? We tired Views Data Export with no luck(memory limit), even we increase the memory to 128MB. Please help.


texts: How to manage reservations with a 2 hours duration without duplicate bookings?

texts:
I want to make a calendar view that will show when music teachers are available, so that students can register online and attend a lesson. The courses have all the same duration which is 2 hours. For this, I created a content type called "Lessons" (Fields: title, description, teacher name, teacher email, date/time) and a content type using node reference module for registrations to each specific lesson. In that way students can register online for music lessons.

There are 2 problems with this:

How can I have a fixed 2 hour duration in the day of the calendar view that won't let students register for more or less time than the two hours? I can not just hide the time fileds because the system must show them the time that the lesson takes place?
I want to allow just one user register for each lesson and then the system must show that lesson as booked. To be more specific, I want the calendar to show the whole day seperated in 2-hour periods and which periods are free. When a user registers for a lesson, the lesson changes color (I can do this with css) and is marked as reserved so that the "next" user can only register for another of the open lessons and so on.

Any ideas?


texts:
I would like to implement a Region selector in a Drupal 7 website. Not the default i18n where you have 1 language for multiple countries but English content for the USA and different English content for the UK.

For configuration I would like to select the applicable regions on my node (maybe with taxonomy items?) so when the content is the same for multiple region's we don't need to duplicate it in all region's/languages.

Is there a solid solution for my needs?

THANKS!


texts: Bootstrap theme: editing the registration page

texts: I am new to Drupal and wondering how to edit the look and feel of the registration page form? For what it's worth, I'm using the Bootstrap theme. I'd usually do this via CSS; however, with Drupal this is somewhat tricky. The problem is the form fields are expanding to fill their container, and, as you can imagine, it looks pretty ridiculous having a username field filling 3/4 of the screen. Looking at the elements class shows no clues as it is not a standard Bootstrap class (must be Drupal generated I imagine). I have edited the basic page content type in an attempt to make it work - but as I have learnt: the registration page is not styled from basic page. Any help would be great, thanks!


texts:
I have a form using AJAX that will be used by many users at once, authenticated and anonymous users as well.

What precautions should I take to prevent data leaking between users (especially anonymous)?

I disabled the cache on route level via no_cache option. Is that sufficient or should I use \Drupal\Core\Form\FormStateInterface::disableCache() or maybe something else as well?


texts: Rebuild in Features tripping HTTP 500 Error

texts:
I am trying to rebuild some features in Drupal 7.37 in preparation for migration and upgrade on a local dev environment using MAMP but I get an HTTP 500 error when attempting to view overrides. Watchdog reports errors with "undefined offset" in schemaorg.features.inc.

Thanks for any help pointing me in the right direction on this one.


texts: ViewsJSON module not working with Google Store Locator

texts:
I was wondering if anyone came with a solution for this. The Google Store Locator module is not working with ViewsJSON module. There seems to be an issue

I've installed the ViewJSON Alpha 4 and applied the patch but it doesn't work on my end.

Any suggestions?


texts:
I've enabled SimpleTest module and simpletest_example module in the Examples module

I've cleared all caches and i do not see anything about simpletest_example in this page : admin/config/development/testing

SimpleTest Tutorial (Drupal 7) : something i've missed ?


texts: How to create menu link to an individual field within a node in Drupal 7

texts:
Assume a content type with two user fields, being a description and a file.  Assume that a few content items, or nodes, have been created that are based on this content type.

Description                                    Image
Joe Brown                                      www.images.com/picture_of_JoeBrown
Joanna White                                   www.images.com/picture_of_JoannaWhite
Jeremy Green                                   www.images.com/picture_of_JeremyGreen
etc

Easy enough to create a menu item that points at the node.  Once the user has opened the node they can click on the image's URL and retrieve the image.

Easy enough to create an "external link" that points directly at the image and jumps straight to it.  However the external link's address is static.

How does one create a menu item the jumps directly to the image that is currently stored in the Drupal node/content without an intermediate step?

In this example, I need to append the name of the field that contains the image url to the menu node address so that the system will show the person's current image with a single click from the menu without an intervening node/content display.

This seems like it should be easy, but I can't see it......


texts: Drupal Commerce: Calculating a shipping rate: Custom Shipping Price

texts: I have a variety of products that have different fixed shipping prices. Each product has a custom field associated with it that contains a decimal price for shipping. Using Flat Rate Shipping, on the event "Calculating a shipping rate", how may I go about bringing in the custom field (scoping) to calculate that shipping price?


texts: View or module that shows which nodes are linking to the current node?

texts:
Has anyone found a way to show which pages (nodes) have internal links to another page (node)? This could be a view that shows a listing for each node of a particular content type and then all the nodes that have a link to it, or perhaps a block that shows on each page (when logged in) which shows all the other nodes that link to the currently viewed node.

This would be most valuable if it not only showed links found in a "body" field or even the actual node content type fields, but rather the entire page display including blocks, etc.

For SEO reasons its nice to know what pages you have linking to each other (as well as link text would be helpful). (Its good to know other external pages linking to your website, but that's not what I'm referring to in this question - only internal links.)

Curious if anyone else ever came up with a way to do something like this.

Thanks!