texts: Using Commerce Funds module, how to charge user each time that user withdraws money?

texts:
I have a problem which I am struggling with regarding payment using commerce funds.

I am building a website (for personal use) where users can transfer money amongst each other. Commerce funds allows me to do this exceptionally well. A normal workflow which is possible with commerce funds looks like this:

Let’s consider two authenticated users UserA and UserB, UserA wants to transfer money  to UserB. UserA’s account balance at the moment is $100, UserB’s account balance is $0.00.
UserA deposits $400 from his/her bank into his account (website) using payment gateways
UserA’s Account balance: $500
UserA transfers $300 to UserB’s account
UserB’s account balance: $300.
UserB withdraws $300 into his Bank Account. This needs to be approved by admin

My problem:

Now in step 6 when UserB withdraws $300, I would like a percentage of that amount (10% = $30) to be deposited into admin’s account and UserB thus would withdraw the remaining amount ($300-$30 = $270). UserB would know about the amount deducted. (Note: UserB has not yet been directed to payment gateway. This is similar to how you get discounts, the discount is applied at or after the checkout step and the payable amount is reduced by discounted amount, in our case the discounted amount is the charge and will be added to admin’s account)

I have looked at some options like Paypal Adaptive Payments, commerce Payback but this are more or less doing things for specific sites like paypal or are not yet ready for usage on sites. Also what I want would be done before the user is directed to payment gateway, so any payment gateway could be used afterwards.

Commerce funds looks like a good solution but lacks this part of a functionality that I need. Any help or guidance in how to achieve this would be greatly appreciated.

I am not a drupal developer, just starting with drupal so writing modules is out of scope for me currently.


texts:
I have a website, where I have been trying to build a form with server side and client side validitations of the input fields. More or less I have been achieving progress. Then I put my code from my testing enviroment to the drupal based website, to see how many tweaks do I need to make. Needless to stay lot of things fell apart. Most important at the moment is that my javascript checks if the input field has the correct information, if it does, it colors the input field and changes the helper thex accordingly. This got fully broken on the site. I read a lot and I assumed this may be cause drupal uses an older JQuery that which I was testing with. So with a little help in another question here I invoked the noConcflict and I used the newer jquery with my code. Sadly this did not fix my problem.

The html of the site is located here:
http://www.htconsulting.hu/test/form
The javascript:
http://www.htconsulting.hu/form/validation.js

Ps.: After the noconflict, my popup Jquery UI broke as well, so I hope to find a possible solution outside using noConflict, or solving the popup window now...


texts: How to create a preconfigured block/view.

texts:
I am looking for a way to create a view/block that is styled with CSS by myself, that can have content uploaded by an administrator, that will automatically use the same styles.

So it is easy for the admin to add content repeatedly that will automatically through my preconfiguration layout with the CSS as I have styled it.

I thought maybe I could create a content type then run it through a view and place that view on the page that I need it. I this case it is an Image/Icon with a link and text description, so the admin can upload the content easily and it will layout as I have styled it without them needing to write any CSS.

Thanks

Ant:-)


texts:
I have a view, where I use grouping to display publications by year.
Format: HTML List -> Settings -> Grouping field Nr.1: Year

This is what I get:

Is there a possibility, to expose this grouping to the website user? So that the user can group for example by publications type or author? So the same functionality like exposing filters?


texts: How to create a page showing certain roles?

texts: I want to create a page that shows the organisation of the group behind the website. To do this, I would like to render a list of certain Drupal roles, along with every user that has that role. However, I have no idea how to do this without writing a custom module. Is there a way?


texts: How do I retrieve values of a taxonomy field inside a field collection of a profile2 node?

texts:
Can someone tell me how can I retrieve values of a taxonomy field inside a field collection of a profile2 node?

Thanks


texts: In hook_user_presave how to check if account is being activated and account is new?

texts:
Currently in Drupal 7 I have two conditions in hook_user_presave,
1. Is account is being activated
2. Is account new

function hook_user_presave(&$edit, $account, $category) {
    if (isset($account->is_new) && !empty($account->is_new)) {
        //If account is new then execute my code here
    }

    if ((isset($account->uid)) && (isset($account->status)) && ($account->status == 0) && ($edit['status'] == 1)) {
        //If account is being activated for the first time then execute my code here
    }
}

I want to convert this code to Drupal 8, What should be the conditions?

function hook_user_presave($account) {

    //Condition 1

    //Condition 2
}

Is there any other way to achieve this?
Any help would be appreciated. Thanks.


texts: Can anyone tell me how I can use 2 Views exposed filters to filter nodes published between the two selected dates?


texts: Add class that surrounds all tables (or any other node,field etc...) using preprocess template?

texts:
I have been able to find information on adding classes to tables and other items in my pages, however, I cannot find any information on wrapping the entire table for example in a div through the preprocess function.

I added this for example:

function bootstrap_preprocess_views_view_table(&$vars) {
    $vars['classes_array'][] = 'table table-striped';
}

My tables are stripped which is what I was after, however, I would like to wrap the entire table itself in
{TABLE}
, but am not finding where / how to add the class to show before the table?

Adding a picture of where it could be added:


texts: How can I conditionally insert extra header data on Drupal 6 pages?

texts:
I'm using Drupal 6 with the WebForms module, and my entire site uses https.

I need to insert some cache-control statements in the page headers of only certain pages (ones with forms on them). Is this something I can do by modifying my theme? Any clues about how to do it?

If you're curious, the problem I want to solve occurs when an anonymous user A fills out a form on the site and submits it and gets to the confirmation page and then walks away without closing the browser. User B then walks up to the computer, hits the "back" command on the browser, and sees everything User A filled out on the form. This user-typed data is not being re-sent by the server, it is just remembered by the local web browser app. I believe if I send some cache-control statements in the header I can prevent that behavior.

Thanks! -Steve


texts: Using date and rules to publish and unpublish content

texts:
I have two scenarios:

I have a meditation content type that need to show in a view when the date field = today's date. I want a view to show a meditation every year on the same date.
I need to create a new node of a certain content type every week where the date field has a start date of today's date and a relative end date of + 13 days.

How to create those two scenarios using rules? I am trying to understand rules scheduler. I think it can solve both scenarios.


texts: Creating one view for taxonomy page teasers so I don't have a ton of views

texts:
this seems like a simple problem but I can't seem to find a straight forward answer for Drupal 7.  I have a ton of taxonomy vocabulary pages and I just want to configure them the same all the way through the site. So I just want one view that formats them all.
Can someone point me in the right direction?
Thanks!


texts: EntityFieldQuery get total of paged results

texts: I have added a pager to my query with $query->pager(6); but I also want to display a total number of results. For example, if there are 8 results I want to display Search results (8) with 6 per page but I don't know how to get the total number of results, the query only ever returns an array of up to 6 elements so I can't add them all up.


texts: Migration has spun ubercart into checkout redirects

texts:
I just migrated Drupal from my development site to my production site. This included a full database migration as well as a file migration.

Now, after adding products to my shopping cart and then clicking the checkout button all that happens is that the shopping cart refreshes. This happens whether or not I'm logged in.


texts:
When I go to my site on command line and run a drush command I get the following error:

PHP Fatal error:  Cannot redeclare class Drush in /var/www/xmd8/www/vendor/drush/drush/lib/Drush.php on line 36

If I run which drush I get:

/usr/local/bin/drush

I have the Lightning Distribution installed via composer and they are adding Drush.

Any ideas on how to fix this?


texts: Submit form to 3rd party site, receive response to update original form

texts:
What I want to do

We have a simple form that people fill out to attach documents for review.  We want to monetize it, using a specific vendor we currently use for non Drupal sites.

What we want to add is when someone saves their form, go to a confirm page, stating the price, then submit this to the 3rd party site.  They process the payment and post a response back to our site, which we then modify the node to update the status to paid.  We currently do this using Google app scripts on many other sites.  We want to keep this site in Drupal for other reasons.

I'm very new to drupal, and am having some trouble with how to submit the form, and especially how to receive the post from the 3rd party vendor.  I feel this isn't a crazy way to do this, but the lack of modules that

We've looked at Drupal Commerce and Ubercart, etc, but they seem pretty large for our needs.


texts: How to attach external library in twig file with parameters?

texts:
I have below code to share on LINE messenger

How to include JS using attach_library?

{{ attach_library('https://d.line-scdn.net/r/web/social-plugin/js/thirdparty/loader.min.js') }}

How to attach async="async" defer="defer" ?

Tried using

{{ attach_library('https://d.line-scdn.net/r/web/social-plugin/js/thirdparty/loader.min.js', { 'async' : 'async', 'defer' : 'defer'}) }}

But not working :(


texts: On D.O., where to file reports for spam users?

texts:
On drupal.org, where does one file reports for a suspected spam account?

My google searches have turned out results about a spam module and such.


texts:
just wanted to scope peoples thoughts on the best way to do this: I have a node which surfaces taxonomy terms. I need to pass them to a custom block (templated with block.tpl.php).

The terms can be see within the node using devel, but i'm unclear as to how best pass them into the custom block.

any thoughts would be greatly appreciated


texts: Why does my drupal 7 redirect me to the home page from any link?

texts:
I have just enabled clean URLs via admin panel, but now...

it doesn't matter what I click, all my urls redirect me to my home page.

you can try for yourselves by clicking any of the links: http://www.gelpalhano.org/drupal/

and none of the admin links work either, so I can't even disable clean URLs to make sure that is the problem. logout also does not work.

any light you can shed on this will be much appreciated.


texts: Getting password hashes and salts from Drupal 7

texts: I need to get user accounts' password hashes and salts from a Drupal 7 app, so as to migrate these accounts into Stormpath. Could you please help me to figure out where this data is stored and how to get it from the DB?


texts: Need to force #default_value for AJAX tableselect checkboxes

texts:
I built a drop-down ajax pager that replaces a tableselect with the requested page of rows. The array of selected item IDs is stored in a hidden field and that logic is working across entity load/save and AJAX replacements.

When the form initially loads, my tableselect #default_value operates correctly and checks the selected rows on the first page. But after AJAX paging through the big list to a different page and back, the checkboxes aren't checked again.

I think this has to do with #default_value only working before the form has been submitted. How can I reset the state so that my updated tableselect #default_value is used after AJAX?


texts: What cause my 404 error for my user_picture thumbnail in template file?

texts:
I want to print user_picture thumbnail in my page template. I am using the following code in hook_preprocess_html() in my .theme file.

$user = user_load(\Drupal::currentUser()->id());
$style = entity_load('image_style', 'thumbnail');
$variables['user_picture'] = $style->buildUrl($user->get('user_picture')->entity->url());

It's generating a URl but it is showing 404, what could be wrong here?


texts: How can I render an HTML table in a block?

texts:
i have created a module for showing third party API data

here is some data returned from that API

{"ObjectId":43,"ObjectName":"MEGA MELA","ObjectTitle":"Event Created by API","ObjectDescription":"NEW EVENT BY API","ObjectLabel":"","ObjectTypeId":33,"MaxFieldsExpected":5,"ObjectValueType":null,"ObjectControlType":"","IsDeleted":true,"CreatedDate":"2019-05-22T07:56:03.767","CreatedBy":null,"EditedDate":null,"EditedBy":null,"DeletedDate":null},{"ObjectId":44,"ObjectName":"Event x11","ObjectTitle":"Event Created by API","ObjectDescription":"NEW EVENT BY API","ObjectLabel":"","ObjectTypeId":33,"MaxFieldsExpected":5,"ObjectValueType":null,"ObjectControlType":"","IsDeleted":true,"CreatedDate":"2019-05-23T00:33:50.7","CreatedBy":null,"EditedDate":null,"EditedBy":null,"DeletedDate":null}]}

i have created a custom module to show some of  this data in a block

this is my module directory hierarchy , module directory name is apihtml

 -apihtml
    -src
      -Plugin
        -Block
          -rest.php

    -apihtml.info.yml

as you can see there are just two files
  apihtml.info.yml and rest.php

here is apihtml.info.yml content

 name: Third Party Api Data with html
    type: module
    description: 'This is for showing rest data in ui with html'
    package: Custom
    version: 8.x
    core: 8.x
    dependencies:
      - node
      - block

and here is rest.php content

   <?php

/**
 * @file
 */
namespace Drupal\apihtml\Plugin\Block;
use Drupal\Core\Access\AccessResult;

use Drupal\Core\Block\BlockBase;
use Drupal\Component\Serialization\Json;

/**
 * Creates a 'Foobar' Block
 * @Block(
 * id = "AntShow with html formatting",
 * admin_label = @Translation("Ant Show & HTML"),
 * )
 */
class rest extends BlockBase {
 public function build() {
    /** @var \GuzzleHttp\Client $client */
    $client = \Drupal::service('http_client_factory')->fromOptions([
      'base_uri' => 'http://myApiPath',
    ]);

       $response = $client->get('objects/events');

    $dec = Json::decode($response->getBody());

    $items = [];

foreach ($dec as $d) {
    foreach ($d as $ins) {
  $items[] = $ins['ObjectName'] ;

    }
}

         return [
      '#theme' => 'item_list',
      '#items' => $items,

    ];

  }
}

here by using array  Key ObjecName i am able to show object name in block

here is the block OutPut

MEGA MELA
Event x11

but i want something more
i want to show this API returned data in the tabular form   means the array key should be the header  of the data value data will be in rows

like this

   ObjectId  | ObjectName | ObjectTitle           | ObjectDescription | ObjectLabel | ObjectTypeId | MaxFieldsExpected | ObjectValueType | ObjectControlType | IsDeleted | CreatedDate | CreatedBy | EditedDate |  EditedBy
    43        |  MEGA MELA |  Event Created by API | NEW EVENT BY API | ..............................................................................

in this Drupal block all the data displayed has to be returned  in build function in rest.php file

this is the code which shows data returned by api in tabular format

     foreach ($dec as $d) {
  ?>

<?php foreach ($d as $ins) { ?>

<?php
 foreach ($ins as $key=>$value) {
   echo "
".$key."
	";
 } ?>

<?php
 foreach ($ins as $key=>$value) {
   echo "
".$value."
	";
 } ?>

<?php
} ?>

 <?php
}

But i am not getting how can i put this code in build function of rest.php to show tabular data  in the block


texts: Database::RETURN_AFFECTED not working with a select query

texts:
I am trying to run a database query and all I want to know is how many rows were found. Trying to use rowCount() throws an error because the query is a select query, but it also says to set the return option to Database::RETURN_AFFECTED in the options, yet this does not seem to do anything to the return on execute().

Here is the query:

  // top of file
  use Drupal\Core\Database\Database;

  $query = \Drupal::database()->select('file_managed', 'f', ['return' => Database::RETURN_AFFECTED]);
  $query->fields('f', ['fid', 'filename', 'status']);
  $query->condition('f.filename', $result->filename);
  $query->condition('f.fid', $result->fid, '!=');
  $rows_found = $query->execute();

Looks like when I inspect the query object, the return option is being set to 1, when it should be set to 2 which is what the RETURN_AFFECTED constant represents. Am I setting the option wrong?

How can I just get a count of the rows returned?


texts: Why can't I save a Send HTML Email action?

texts:
I have a rule component set up that currently sends an HTML email. I need to change the body of the email to include a new field, but when I do and press Save, it doesn't return to the Rule page, it just goes to the top of the page and loses the changes I've made.
If I overwrite the HTML with a simple piece of text or a small piece of HTML, it works OK.
I'm wondering if there's some validation going on, but there are no error messages displayed or in the logs. I've validated the html through the W3C Validation Service and cleaned it up so there are only a couple of warnings.
My other thought is that maybe there's some limit that I've hit? The HTML is quite long, as it was generated by an online generator.
I can't include an export of the rule as it's too big for this message.
Any help?
I am using Drupal 7.59 and Rules v7.x-2.10; MimeMail v7.x-1.0. Have tried the latest dev version MimeMail too, but made no difference.


texts: How do I display user picture from profile fields?

texts:
Possible Duplicate:
  How can I display a picture from a field as the user picture rather than the drupal default with user-picture.tpl.php?

I would like to display the user pictures in message list and message view. The images are uploaded through a user profile field, and not the default Drupal account picture field.

How do I do this in Drupal 7?


texts: DPM simpleXMLElement returns just the object but echo returns its value

texts:
When I DPM the simpleXMLElementObject it returns

  (Object) SimpleXMLElement

print_r returns the following:

SimpleXMLElement Object ( [0] => c1e1c959-c99d-42f0-8a44-2998b )

Although when I echo I can see the value for my object. Thus what is the best way to get its value in a string format?

This way then I can process that information.

Thanks.


texts: How to set context by url argument for node preprocess

texts:
I have a View of nodes, rendered using a Display Suite view mode.  I need for users to either view the page with or without an argument in the path.  If they don't enter an argument, I want the nodes in the View to render normally, but if they do, like someview/10, I simply want to add a CSS class for that node in preprocess.  I have the Context module installed, so I'd like to be able to use that, but it doesn't seem like I can specify path arguments that I maybe set a context for that I can check for in the node preprocess.  Or if I can do it in Views somehow, that would be great, but I can't seem to figure that out.

This functionality is for a nojs user.  For js users, I just send the ajax commands back and set the CSS, but for nojs, I need to route them (I guess with drupal_goto())  to the View with the nid as an argument.


texts: Is there an alternative for hook_views_ajax_data_alter in drupal 8?

texts:
As the title says, is there a similar behavior like hook_views_ajax_data_alter in Drupal 8 like in 7?
If not has anyone achived the same result programatically?


texts: Overlay and jQuery don't work, what should I do?

texts:
I have installed Drupal 7 on a local computer on stack called Denwer (similar to WAMP) and Windows 7; I see that all pages load without Overlay module (it is on, on modules page).
I guess that  jQuery does not work at all: Views slideshow doesn't work, when I add node all parameters load in a list instead of paging-listing mode.

I cleared all caches, reinstalled Drupal 7 using the development snapshot, clean-installed Denwer: all this doesn't work.

I remember I didn't have such problems on Windows XP.


texts: Trying to make mass webforms more efficient

texts:
I have an application that we're migrating in to Drupal 8. Its a system that allows the creation of forms for our clients and then allows the submissions by their clients.

We create base forms with default questions, they choose their base form and add their own additional questions to it. The form is live for up to 6 months. Each client may add 10+ forms over the course of a year.

When I migrated the legacy data in, which contained 970 forms plus submissions, we started running into massive problems.

The error is a fatal memory error in Statement.php. Despite PHP having 4GB. When I dug in to the problem, it is maxing out memory when the config table is queried. Each one of these webforms is in the config table.

Here's a snip of the query;

SELECT cid, data, created, expire, serialized, tags, checksum
  FROM cache_config
 WHERE cid IN ( :cids__0, :cids__1, :cids__2, :cids__3,
                :cids__4, :cids__5 <snip>, :cids__969 )

As we're expecting another 200 - 300 forms to be created this year this is potentially a very large problem for us.

Here is the method;

public function execute($args = [], $options = []) {
  if (isset($options['fetch'])) {
    if (is_string($options['fetch'])) {
      // \PDO::FETCH_PROPS_LATE tells __construct() to run before properties
      // are added to the object.
      $this->setFetchMode(\PDO::FETCH_CLASS | \PDO::FETCH_PROPS_LATE, $options['fetch']);
    }
    else {
      $this->setFetchMode($options['fetch']);
    }
  }

  $logger = $this->dbh->getLogger();
  if (!empty($logger)) {
    $query_start = microtime(TRUE);
  }
  // Error occurs here.
  $return = parent::execute($args);

  if (!empty($logger)) {
    $query_end = microtime(TRUE);
    $logger->log($this, $args, $query_end - $query_start);
  }

  return $return;
}

Off the top of my head, I can see a potential solution if we could get the webforms to be treated as content and not config.

I'd love any other approach I can make also.


texts: How do I use a different node template on taxonomy term node listing pages?

texts:
For a node listing on a taxonomy term page, like:

  taxonomy/term/4

It's currently using the node template I set up just for when you are looking at a node:

  node--spot.tpl.php

I added this code to hook_preprocess_node:

if(arg(0) == 'taxonomy') {
  array_push($vars['theme_hook_suggestions'], 'node_taxonomy');
}

The node template file name I want to use is:

  node-taxonomy.tpl.php

I confirmed the hook is running but it's still using:

  node--spot.tpl.php

What am I doing wrong?

Update 1: According to the source code theme_hook_suggestions are listed in reverse priority order, so I changed array_unshift to array_push.

Update 2: I am correctly seeing in Devel themer that my template should be used first, even when it isn't:

  node_taxonomy < node_14 < node_spot < sites/all/themes/hotness/templates/node--spot.tpl.php


texts: Search API autocomplete for custom search

texts:
Rephrased question:
I want to add autocomplete to a form using the Search API autocomplete module.

I have Search API + Search API SOLR running but without Search API Views or Search API Pages.
The submit function of my form has the following code:

<?php
$index = search_api_index_load("node_index");
$query=new SearchApiQuery($index);
$query->condition('type', 'product', '=');
$filter = $query->createFilter('OR');
$filter->condition('field_category', 'book', '=');
$filter->condition('field_category', 'magazine', '=');
$query->filter($filter);
$data=$query->execute();
$results=$data['results'];
print_r($results);
?>

I can't find any documentation on how to add autocomplete of the Search API autcomplete module on my form, so any help is welcome.


texts: Using states in Drupal 7 form to provide 'select all' functionality

texts:
I'm trying to use this to achieve the functionality of having a checkbox that, when selected, causes a range of checkboxes to all be selected. I made the selectall box a separate form field, and it looks like this, and works not a lick:

$form['report_group']['selectall'] = array(
  '#type' => 'checkbox',
  '#default_value' => 0,
);

$form['report_group']['boxes'] = array(
  '#type' => 'checkboxes',
  '#options' => $boxes,
  '#states' => array(
    'checked' => array(
      ':input[name="report_group[selectall]"]' => array('checked' => TRUE),
    ),
  ),


texts:
I want to send an email to the site admin whenever a user changes any of their Profile fields.

The tokens Rules offers are Updated Profile and Unchanged Entity, however I can't seem to figure out how to show ONLY changed items.

When I use any of the Updated tokens it merely just outputs what is there, which isn't much use in this case.

Can anybody help?


texts: Create a block with a list of all pages tagged with a taxonomy vocabulary

texts:
I'm new to drupal, so please be gentle with your answers, and I apologize in advance if this is something I could have found elsewhere, but I've been searching for several hours now...

I'm using Drupal 7.

I want to create a block (based on a view, I am assuming) that will display all of the pages that are tagged with a particular taxonomy vocabulary. Here's what my taxonomy looks like right now:

Main Menu
-Fruit
--Apples
--Oranges
--Bananas

I want a block that displays all the stories tagged with "Apples." I thought this would be easy, but for the life of me I cannot figure out how.

I've been trying to create a view, based on Taxonomy Terms, that filters to "people" but when I set the filter criteria, what I get is the word "apple," which when clicked, leads me to the page that shows all the pages (nodes?) tagged with "apple" I want that in a block format to begin with!

In other words, I want the information on the page that right now I can get to by going to /taxonomy/term/# to display as a block, showing only the title fields in a list. HOW?

Thanks for your help on this. I'm sure I'm missing something simple.


texts:
mymodule is in modules/custom directory.

$block['content']['#attached']['css'][] = drupal_get_path('module',
                                          'mymodule' . '/mymodule.css');

mymodule.css exists.

However file is not attached.


texts:
Install Drupal 7.37

Download Ctools, Entity, Libraries, CKeditor, Quickedit, Navbar, Quickedit Tab

Add libraries: Backbone, Underscore, CKeditor, Modernizr

(enable downloaded modules)

Permission for "Access edit in place" enabled

===HOWEVER===

I don't see any Quick Edit options anywhere. Not in context menus, not in a deactivated block.

I tried just ctools/entity/libraries/quickedit at first. Then I tried with CKeditor but without Navbar and Quickedit Tab (and Modernizr). Then I added that set because it appears to create a shortcut button any time you're viewing an edit-in-place-able node.

There don't seem to be any module settings. But I'm not able to edit any fields in place. What am I missing?


texts:
I am using feeds to import content to my custom content type, Clients.

After the Import, the mapping comes up fine, the Content Title displays in the Page View Node, however, when I go to edit the content, the Title comes empty & also does not save the updated title.

It was working fine a few days back. I haven't made any changes or updates to any modules.

Please advice.

Thanks


texts: Returning an entity from a custom Rules action

texts:
I'm new to writing modules and back end dev. I'm trying to write a custom Rules action that takes a list and returns one item from that list to use as a relationship end point.

I've declared the rule here and got it working as far as I can extract one item from the list and put it as a message on screen:

function rules_additions_rules_action_info() {
$actions = array(
    'rules_additions_action_get_next_list_item' => array(
        'label' => t('Get next list item'),
        'group' => t('Data'),
        'parameter' => array(
            'list' => array(
                'type' => 'list',
                'label' => t('Select the current list'),
                ),
            ),
        ),
    );

return $actions;
}

And can do something like this, for example:

function rules_additions_action_get_next_list_item($list) {
    drupal_set_message(t('The item is ' . print_r($list[0], TRUE)), 'status');
}

What I want to be able to do is return that list item as an entity so at the next step in my rule set I can do "Add an item to a list" and select it in the rules UI.

I hope this makes sense.

Thanks in advance.


texts: How to easily display a 12 by 12 matrix of input field for integers?

texts:
I am still very new to Drupal. I need to let users create nodes to enter 12 by 12 matrix of numbers on one screen block. I don't really know where to start regarding displaying those fields (i.e. layout).

Is there a module/functionality helping defining the layout of those 144 input field in a square shape in Drupal? Some kind of WYSIWIG layout editor? Or, should I try to position those input fields with Javascript within a block?

Thanks.


texts:
I created a select/dropdown list and it works:
function hook_form_hook_ID_alter(&$form){
  $term_data = array(....) //array of key => values

  $form['elements']['location']['medical_name'] = array(
    '#type' => 'select',
    '#title' => t('Medical Area'),
    '#options' => $term_data,
    '#empty_option' => t('-None-'),
  );
}

but when I submit the webform, the field is not submitted. What I mean by submitted, when I go to results of the webform, there does not exist a medical_name field, thus the field is not registered. This is an alter function, so yes I am creating medical_name field on alter. I checked the formState->getValue and it is there. So I am wondering what may be the problem? I want to add the field programmatically.


texts: Expose only a specific content type to Views

texts:
I've been playing with Views in trying to expose only a certain content type to the View, but I cannot find a way to do so.

For example:

I have a content type called Regions and I have 3 nodes of type Regions.

When I create my View, is there a way to only expose the 3 nodes of type Regions?

Currently, it displays all the entries in my node table, which is not what I want.


texts:
In Drupal 7, comment form can be rendered using the following code.

drupal_get_form("comment_node_{$node->type}_form", (object) array('nid' => $node->nid));

How can I achieve the same in Drupal 8?


texts:
I'm using Commerce module and I have a line item with a computed field that's calculating a date. This field finally shows a date.
Then during the checkout process I have a form with a Date field (part of the Order). I'm running some Rules and finally I have to copy one of the calculated dates to this field but i couldn't by rules.
I tried with a simple rule "set a data value" trying to copy the Computed field value to the other field. I put a "has field" with the CF. Then in actions, the field doesn't appear in the data selector.
This is normal? Is there another method to do it?


texts: Fixing configuration inspector missing schema errors

texts:
I'm using the configuration inspector to fix schema issues before I put a module live as a full release.

I'm finding the following error, but I'm unclear on how to fix it.

The module provides a new entity type, private_message. In config/install, I have the file:

core.entity_form_display.private_message.private_message.default.yml

This file has the following contents (trimmed):

content:
  message:
    type: string_textarea
    label: hidden
    settings:
      placeholder: Message
      rows: 5
    region: content
    third_party_settings: {  }
    weight: null

The configuration inspector for core.entity_form_display.private_message.private_message.default is telling me that the schema for content.message.label has a missing schema:

  content.message.label     Undefined   undefined   hidden  missing schema

In the raw data for the inspection, I see:

'core.entity_form_display.private_message.private_message.default:content.message.label' => 'missing schema',

Does anyone know how I can fix this error?


texts: Module that adds &nbsp after one letter words

texts:
I'm Polish. In my language leaving one letter words at the end of the line is a mistake. I know i can deal with it adding &nbsp; after such words. Is there a module which takes care of it (eg. while saving the content to db)?
RtL


texts: Use drupal for user authentication in javascript application

texts:
I have a Javascript application that I start from a drupal website. I need to save data from the Javascript application to the server, only logged in users can save data.

So I have made a custom php webservice that handles request from the Javascript application. Within this webservice I call drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION) and then inspect the $user object. Like this:

drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);
global $user;
$userid = isset($user) && isset($user->uid) ? $user->uid : 0;
return $userid

When I receive a valid userid I allow the user to save specific data for his account.

Is this a save way to do it? Are there any security considerations I overlooked?

Extra background information:

I want a minimal solution, so the services module is not what I am
looking for.
I don't need to access drupal content or functionality, just my own
php functions to exchange data between the client and the server.
I don't need user login/authentication functionality in the
javascript application. Login is done on the drupal website. If the
user is not logged in when using the js application, he may still use
it but cannot save data. This is enforced by the PHP code.


texts:
I've created a custom block type.

I want to create a block with 19 translations programmatically.
I've seen that you can use Block::create() method...for which I can neither find proper documentation nor examples.
Could anyone provide an example?

Fyi my code is:

Block::create([
  'id' => 'my_header_dk',
  'settings' => [
    'id' => 'my_header',
    'label' => 'My header',
    'label_display' => FALSE,
    'provider' => 'my_block',
    'status' => TRUE,
    'langcode' = 'da',
    'icon' => [
      33,
     ],
    'header' => 'This is the header text',
    'link_text' => 'Click here',
    'visibility' => [],
    'region' => 'header',
    'plugin' => 'my_header',
    'theme' => 'my_theme',
    'status' => TRUE,
 ])->save();


texts: Node creation PHP – menu item under proper parent

texts:
while I create node by PHP, I use this:

$node->menu['enabled'] = true;
$node->menu['link_title'] = $node->title;

but it puts link in 0 depth of the menu. It doesn't care for "Default parent" selected for content type. Neither this works:

$node->menu['parent'] = "menu-global-menu:961";

How to select parent then?


texts: Twig template name for field when content type is viewed in particular view mode

texts:
Based on twig template naming conventions I have created twig for any field type of given content:

field--node--myContentType.html.twig

Is it possible to use different twig when myContentType is visible in "full" view mode? I've already tried:

field--node--myContentType--full.html.twig

But it does not triggers. I can use node--myContentType.html.twig and node--myContentType--full.html.twig for full view of the node, but it doesn't work for field twig.


texts: drupal 7 views structure: Different nodes should collect different (term) lists

texts:
I think I can solve this with views, but can't find a good solution.

I have the nodes: vegetable, fruits..(one content type).
Then I have different nodes of vegetables and fruits: carrot sort 1, carrot sort 2.../ salad sort 1, salad sort2.../ apple sort 1, apple sort 2...

The goal is this structure:

node vegetable:
-text-
-headline 1: carrots-
-list of different carrots-

-headline 2 salad -
-list of different salads-

node fruits
-text-
-headline 1: apples-
-list of different apples-

-headline 2 berries-
-list of different berries-

Have I built for carrots, salads, apples, berries... separate views? Maybe there is one better way?
How can I collect this seperate views on the nodes "vegetable" and "fruits"? I tried it with eva, but (sure) I got on both of my nodes the same result with all fruit and vegetables together.

Any ideas?
Thanks in advance


texts: Suggestions for Importing CSV User Purchase History Data

texts:
I wonder about the most elegant solution for importing user history data.

I need to run a daily feed import of a CSV file to ingest the following user related purchase history.

uid,category,spent
1106,BED,2600
1106,BROOM,7800
2103,MANCH,89

Obviously, there can be multiple rows for a user.

Ideally, I would like to store the data in the user's profile. However, I have a couple of concerns.

Firstly, the only module I can think of for containing this data within the profile is field collection which I have had some frustrations with in the past. Secondly while I find the feed module a wonderfully easy solution for inserting/updating entities, but I'm not sure how to just import one field.

The other option I am considering of is importing to a content type called "Purchase History" that contains a reference to the the user. I haven't got time to create custom modules for this feature.

Any other suggestions?


texts: Convert a node from one content type to another, using a rule set

texts:
I want to convert a node from one content type ("Project") to another one ("Project follow up"), basing on the comparison between the current date (using PHP) and the value of a field date ("Project signup date," which is a CCK date field). Currently, I am using a rule set that will be scheduled based on a check that a rule does when the project is created. The rule set than checks (upon a successful cron run) if the date is higher than the field date (using the date timestamp); the rule set will then convert the node from "Project" to "Project followup."

As I keep getting errors when testing the rule/rule set, I must ask if I'm doing it right. What are the proper PHP evaluation and token replacement pattern? The following are the replacement tokens, and my default PHP code.

Replacement tokens

[node:field_pdate-value]     The raw date value.
[node:field_pdate-view]      The formatted date.
[node:field_pdate-timestamp] The raw date timestamp.
[node:field_pdate-yyyy]      Date year (four digit)
[node:field_pdate-yy]        Date year (two digit)
[node:field_pdate-month]     Date month (full word)
[node:field_pdate-mon]       Date month (abbreviated)
[node:field_pdate-mm]        Date month (two digit, zero padded)
[node:field_pdate-m]         Date month (one or two digit)
[node:field_pdate-ww]        Date week (two digit)
[node:field_pdate-date]      Date date (YYYY-MM-DD)
[node:field_pdate-datetime]  Date datetime (YYYY-MM-DDTHH:MM:SS)
[node:field_pdate-day]       Date day (full word)
[node:field_pdate-ddd]       Date day (abbreviation)
[node:field_pdate-dd]        Date day (two digit, zero-padded)
[node:field_pdate-d]         Date day (one or two digit)
[node:field_pdate-dS]        Date day (one or two digit) with ordinal suffix (st, nd, rd or th)
[node:field_pdate-time]      Time H:i

PHP code

php echo time();


texts:
Did anyone try the combination Drupal 7 + apache 2.2 + mod_pagespeed + varnish?

Does it produce any problem?

IS Drupal own CSS and JavaScript aggregation mechanism needed if mod_pagespeed is used?


texts: How can I target the first item in a view?

texts:
I have a views page that shows all the latest articles that were posted. I want to show case the latest article in a different div on it's own, and then have my loop with all the other articles.
This is my code for the loop, which is in the node--view.html.twig file -

{{ node.label }}

        {% set text = content.body|render|striptags %}

{{ text|length > 100 ? text|slice(0, 120) ~ '...' : text }}

        Read More

and in my views-view-unformatted.html.twig file I have -

{{ view.getTitle() }}

  {% if title %}

{{ title }}

  {% endif %}

{% for row in rows %}
  {%
    set row_classes = [
      default_row_class,
    ]
  %}
    {{- row.content -}}
  {% endfor %}


texts:
I am facing the following error while trying to access Admin section in Drupal 8 (WAMP Server). I tried to install the Update manager module and from then I am facing this error. I am unable to access any Admin section of the website. But, I am able to login and access the User account section (Ex: http/test.com/user/1).

  The website encountered an unexpected error. Please try again later.

  Symfony\Component\Routing\Exception\RouteNotFoundException: Route "update.report_update" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 191 of core\lib\Drupal\Core\Routing\RouteProvider.php).

Any suggestion please?


texts: Add show more/read more to CKEditor Drupal

texts:
How can I add a button to CKEditor so users can use read/show more in their editor.
This would help me a lot.
I have looked in a lot of places, but no succes.
I am no programmer, so I'm not familiar with drupal/php code.


texts: What is the difference between the Workbench and Workflow modules?

texts:
I use the Revisioning module to manage revisions of nodes on my Drupal 7 site.  I had been updating the site by myself, so Revisioning was sufficient; now, however, I will be adding some content editors to the project so I need to set up a more complex workflow.

I used to use the Workflow module on Drupal 6 and the Drupal 7 version has integration with Revisioning.  However, Workbench has been getting a lot of good press recently.

What are the significant differences between these two modules, Workbench and Workflow?


texts: How do I run drush migrate for specific path site

texts:
I want to use drush to run the migrate command to upgrade my drupal version 6 to 7 using Data Export Import module.

I have two site in different path.

How do I run drush migrate for the Testing website below. Drupal version is 6.

  Main website

  /domains/site.com/public_html

  Testing website

  /domains/site.com/public_html/testsite


texts:
I want to breadcrumb in drupal8
that display as url as home / list page /  node page.
I just have in breadcrumb home > node page.
I use bootstrap breadcrumb.


texts:
How do I make a one-page user profile? I want to include wishlist, cardonfile and addressbook from commerce, and render all the data already inserted into the profile, and edit/create forms on the individual user page.

Thanks!


texts: How to merge multiple fields into one, across multiple content types?

texts:
I'm updating some old Drupal 7 sites, and I need to merge a number of fields across multiple content types.

For example, I have the field_article_body, field_page_body, and field_event_body fields that needs to be merged into the core body field, or the field_article_image, field_page_image, and field_event_image fields that need to be merged into the field_image field.

I am hoping there is some solution which can assist me in combining these fields, or alternatively some SQL magic which an expert can help me with.

Do you have any idea?


texts: Match JSON POST data with custom node fields

texts:
Is there a fool-proof method to generate a correctly formatted JSON data object to be received by a create node resource given by a REST server, defined with Services in Drupal 7?

I have setup a REST server accepting the application/json content type. I have also set up an anonymous endpoint with the create node resource enabled and I managed to create a new item with the Poster plugin for Firefox with Content Type set to application/json and the following data

{"title":"Review","type":"story"}

I can't seem to get any further though. I am following this guide and the node is created but my data for the rest of the fields is not added. I use this JSON editor to generate my code so it matches the structure shown by the dsm($_POST) call I placed in node.module's node_submit handler for testing.

The JSON data I am trying to post looks like this (I remove all whitespace before using Poster):

{
"title":"great success!",
"type":"story",
"field_review":[
    {"und":
        [{"0":
            [
                {"value":"Some text"}
            ]
        }]
    }
],
"field_rating":[
    {"und":
        [
            {"rating":"60"}
        ]
    }
],
"field_product_type":[
    {"und": "1"}
],
"field_barcode":[
    {"und":
        [
            {"value":"33333333333"}
        ]
    }
]
}

What am I missing?


texts: How to handle DB updates when my Drupal source is in git?

texts:
I've put my Drupal installation in Git so that it is easier to replicate the production site on my development system.  Then I discovered drush and I think it's way cool.  But then it occurred to me:  If I use drush on my development box to update a module, then the source code changes will be in git and will end up in production by way of git.

But what about the database changes?  How do I apply those in production?  Is it sufficient to run drush updatedb in production (after using git to transfer the code)?

I'm not sure the version numbers are relevant for this question.  Anyhow, running Drupal 6 currently, planning to upgrade to Drupal 7.


texts: Last form validation function is passing an error even though the first one registers the user

texts:
I wrote a custom user_login form validation function that calls user_external_login_register() to register and login the user, but the last validation function for the form calls form_set_error().

The form's #validate array looks like this:

validate (Array, 4 elements)

    * 0 (String, 32 characters ) vtiger_portal_user_form_validate
    * 1 (String, 24 characters ) user_login_name_validate
    * 2 (String, 32 characters ) user_login_authenticate_validate
    * 3 (String, 25 characters ) user_login_final_validate

user_login_final_validate() is here: http://api.drupal.org/api/drupal/modules--user--user.module/function/user_login_final_validate

Here is the code for vtiger_portal_user_form_validate() and the authentication function that it calls:

function vtiger_portal_user_form_validate($form, &$form_state) {
  if (!vtiger_portal_authenticate($form_state)) {
    // Not a portal user. Let the other validation handlers run.
  } else {
    global $user;
    if($user->uid) {
      dpm($user);
    }
  }
}

/**
 * Custom user authentication function
 */
function vtiger_portal_authenticate($form_state) {
  $username = $form_state['input']['name'];
  $password = $form_state['input']['pass'];
  $testname = drupal_substr(drupal_strtolower($username),0,4);
  if ($testname == "dave") {
    user_external_login_register($username, 'vtiger_portal');
    return TRUE;
  } else {
    return FALSE;
  }
}

I'm Seeing the "Sorry, unrecognized username or password. Have you forgotten your password?" error and at the same time, being successfully logged in.  I have printed the $user object after calling user_external_login_register() and it shows that the uid is 9.

Can anyone help me figure out why I'm seeing an error from user_login_final_validate() when the user has obviously logged in successfully?

Update: I've found the root of the problem.

From the line 2121, user.module contains the following code.

// We are not limited by flood control, so try to authenticate.
// Set $form_state['uid'] as a flag for user_login_final_validate().
$form_state['uid'] = user_authenticate($form_state['values']['name'], $password);

user_login_authenticate_validate() sets $form_state['uid'] to FALSE so that later user_login_final_validate() sends it's error message.


texts:
I have created a block that generates some links. I want to display these links as menu tabs in my website. This is the php code I have written inside block.

<?php
  $current_url = current_path();
  $param = explode("/", $current_url);
  $nid = $param[1];

  $type = db_select("node", "n")
            ->fields("n", array("type"))
            ->condition("nid", $nid, "=")
            ->execute()
            ->fetchAssoc();

  switch($type['type']) {
    case "description":
      $current_desc_link = $current_url;
      $current_demo_link = db_select("field_data_field_desc_demolink", "fddd")
                          ->fields("fddd", array("field_desc_demolink_url"))
                          ->condition("entity_id", $nid, "=")
                          ->execute()
                          ->fetchAssoc();

      $howto_entityid = db_select("field_data_field_howto_demolink", "fdhd")
                          ->fields("fdhd", array("entity_id"))
                          ->condition("field_howto_demolink_url", $current_demo_link['field_desc_demolink_url'], "=")
                          ->execute()
                          ->fetchAssoc();

      $current_howto_link = "node/" . $howto_entityid;

      break;

    case "how_to":
      $current_howto_link = $current_url;
      $current_demo_link = db_select("field_data_field_howto_demolink", "fdhd")
                          ->fields("fdhd", array("field_howto_demolink_url"))
                          ->condition("entity_id", $nid, "=")
                          ->execute()
                          ->fetchAssoc();

      $desc_entityid = db_select("field_data_field_desc_demolink", "fddd")
                          ->fields("fddd", array("entity_id"))
                          ->condition("field_desc_demolink_url", $current_demo_link['field_howto_demolink_url'], "=")
                          ->execute()
                          ->fetchAssoc();

      $current_desc_link = "node/" . $desc_entityid;

      break;

    default:
      $desc_entityid = db_select("field_data_field_desc_demolink", "fddd")
                          ->fields("fddd", array("entity_id"))
                          ->condition("field_desc_demolink_url", $current_url, "=")
                          ->execute()
                          ->fetchAssoc();

      $howto_entityid = db_select("field_data_field_howto_demolink", "fdhd")
                          ->fields("fdhd", array("entity_id"))
                          ->condition("field_howto_demolink_url", $current_url, "=")
                          ->execute()
                          ->fetchAssoc();

      $current_demo_link = current_url;
      $current_desc_link = "node/" . $desc_entityid;
      $current_howto_link = "node/" . $howto_entityid;

      break;
}
?>

I want to render $current_demo_link, $current_desc_link, $current_howto_link as menu tabs in drupal webiste. I have tried menu_tree_output but I have to create menu links in Db. Is there any other way to render the links as menu without converting this as menu links.


texts: How can I read config schema from a config entity?

texts:
I need to read the schema definition from a config entity, which is located in config/schema. For example the schema from a node type defined in node.schema.yml:

node.type.*:
  type: config_entity
  label: 'Content type'
  mapping:
    name:
      type: label
      label: 'Name'
    type:
      type: string
      label: 'Machine-readable name'
    description:
      type: text
      label: 'Description'
    help:
      type: text
      label: 'Explanation or submission guidelines'
    new_revision:
      type: boolean
      label: 'Whether a new revision should be created by default'
    preview_mode:
      type: integer
      label: 'Preview before submitting'
    display_submitted:
      type: boolean
      label: 'Display setting for author and date Submitted by post information'

How can I do this?


texts: Updating a drush command from drush 7 to drush 8

texts: what to do if there is a drush command file worked with drush 7 but doesn't work with drush 8. The official docs seem not to have an upgrade guide for this.


texts: How do I display the date but not the author?

texts:
I want articles to show Submitted on without showing Submitted by. The checkbox on Display settings toggles both, not only one of them.
Control/modify display settings (author and date) on posts explains how to do it in Drupal 7.

How should I achieve it in Drupal 8, for example with the Bartik theme?


texts: extracting data from webform and parsing it

texts:
I looked into this question, but it was irrelevant.

I have data entries on my webform... obviously each field has its own key field. Let's say it has key1, key2, key 3

What I want to do is to create an email draft as such:

Hi "key1"

I wanted to say "key2"

SUBMIT BUTTON

After pressing the submit button it will be emailed to "key3"

If there isn't any module that does do this, then can anyone tell me the steps( doesn't have to be very detailed) needed to do this?


texts: More on recommendable caching practices?

texts:
Having read this Q & A, I feel like asking some more, perhaps very basic, questions anyway.

I'm just about to deploy a taxonomy- and Views-intensive site, and I'm wondering about the best cache practices with regards to Drupal and Views configuration.

Needless to say that all my caches are turned off for the purpose of reliable development, but for the sake of speed and server efficiency, some caching should be enabled when the site goes live.

The following questions come to my mind:

Should the Expiration of cached pages and Minimum cache lifetime
settings depend on the frequency of adding content to the site?
Is it possible to broadly define types of Views that should have their cache
turned on? and which should not?
If you were to turn the cache on, where would you do that: on the production site, or the development one before
deployment?
Has anybody developed a comfortable operational pattern
using a staging and production sites using Deploy module, with
regards to cache? If so, what practice do you recommend?


texts: How to make custom template for search results

texts:
I have developed a custom search module that is working perfectly. Currently I am using the existing "search-results-tpl.php" and "search-result-tpl.php" for showing search results.

But I want to make my own custom template file for showing results and that template file should be inside my custom module directory. In this template I will be able to style my search results however I like.

Any suggestions on this?

Note: I have tried many contributed modules also, but they don't satisfy my requirements, so therefor I have started a custom module. But if you have any better solution, then feel free to point me to any of them.


texts:
I'm creating a content type on Drupal 8, which will contain a text that's linked to PDF file.

In Drupal 7, it was just easy with some useful modules. Is it possible to link a text to a PDF file using CKEditor in Drupal 8?


texts: How to display field collection items left to right in views grid

texts:
I created a content type as follows:

Content Type > field collection field > accepts unlimited values.
Field collection field > text field, Image field. > Each accepts one value.

Add content > content type x > added 5 field collection items. So I have one content with 5 field collection items. Each item has one text field value and one image value.

Views:
Created views grid > number of columns equal to 3.
Fields > added field collection field.

I see all the items in a single column. I would like to display items left to right. How can I do it?


texts: Ubercart order completion not working propperly

texts:
I have a problem with the completion of an order. After completion I get redirected to the filled out checkoutpane and and the cart will not empty.

While working on the e-mail template I made a mistake in my uc-order--customer.tpl so the mail did not work. As a surprise I was redirected to the "Thanks" page I made and the cart was emty! Whe I fixed the e-mail template the redirection stopped working properly again.

Log report:

Notice: Undefined index: cart_order in _paynl_order_update_status() (regel 263 van /home/karsijns2/domains/karsijns.eu/public_html/sites/all/modules/paynl/paynl.inc.php).

The line in the module:

$_SESSION['uc_checkout'][$_SESSION['cart_order']]['do_complete'] = true;

$goto = 'cart/checkout/complete';
break;

Strange thing is that it works properly as the mail has not been sent.

I am using:

Ubercart 3.10
Drupal 7.53
Third party module for payment: Ideal payment by Pay.nl

Anyone?
I'm not a real php specialist so forgive my probable incompleteness in this.


texts: What are the required fields to create user through social media login?

texts:
I want to integrate Social Media Login (which is not a module name, I am going to integrate the HybridAuth Social Login module) in my website. So that I just want to know the required (by our website Drupal signup) fields in social sign up process.

I guess that username and email are required, but is the password required?


texts: Node imports using Feeds module giving errors

texts:
I am trying to create nodes by importing (CSV import) nodes through Feeds module.
My CSV file is in (guid, title) format.

I got the following errors while importing the file.

  Notice: Undefined property: stdClass::$type in _node_extract_type() (line 379 of XXXX\modules\node\node.module).
  Notice: Undefined property: stdClass::$type in node_export_import_types_check() (line 458 of XXXX\sites\all\modules\node_export\node_export.module).
  Notice: Undefined property: stdClass::$type in node_export_import_types_check() (line 458 of XXXX\sites\all\modules\node_export\node_export.module).
  Notice: Undefined property: stdClass::$type in _node_extract_type() (line 379 of XXXX\modules\node\node.module).
  Notice: Undefined property: stdClass::$type in node_export_import_types_check() (line 458 of XXXX\sites\all\modules\node_export\node_export.module).
  Notice: Undefined property: stdClass::$type in node_export_import_types_check() (line 458 of XXXX\sites\all\modules\node_export\node_export.module).
  Notice: Undefined property: stdClass::$type in _node_extract_type() (line 379 of XXXX\modules\node\node.module).

And the following error:

  Error encountered during import. Node types unknown on this site: . No nodes imported.


texts:
I want to send emails using email stored on node fields that are referenced twice by other two contents types. I have this content types relationship:

Content1
field1 (unlimited) - reference > Content2
                                 field2 (only 1) - reference > Content3
                                                               email

I want to send a email message to all itens on field1 using email field on Content3, after the node is created or updated.

I dont have experience with Rules looping. Ill appreciate any help.

Thanks!


texts:
I've added and enabled the YouTube module and I'd like to put a YouTube video on my page but I can't figure out how.

I think there is a youtube widget somewhere but I can't find it or get it onto my site.


texts: IEF: Link to existing node instead to create a duplicate

texts:
I am using Inline Entity Form, specifically the Simple widget, in D8.
I would like, when saving the entity, to be able to check if the referenced entity (the node) to be created already exists. If it exists, instead of creating a new node, automatically reference the existing one.
I want to avoid duplicates, but in a transparent way to the user. Let's take an example:
I have the entity "Book" and the entity "Location", which indicates the shelf where the book is located in the library.
If the user adds a book and fills in the location H34.22A, in the Inline Entity Form Simple widget, and this node location already exists (all the fields are the same), I would like IEF not to create a new node (a duplicate), but, transparently to the user, to link to this already existing node.
I know there is the Complex widget, but that solution is not valid in my case because users don't check if a node exists before creating it (there are many elements and they find it tedious).
Any hints on where to start or hook to use?


texts:
How can we put a archive view block on user profile page, and this archive views should only display the archives of the user.

Lets take an example, my username is "MyUser" and i am view a profile of other user ie "SomeUser".

Then how can we put a archive view block in profile page of "SomeUser" where it should displays the contents/ list of stories or articles he/she posted.

Do we need to do UI method over archive view block or need to write a seperate code for this.


texts: How to constrain proportions with the image resize filter

texts:
For our Drupal 6 site, we are currently using the image-resize-filter to to let our editors resize our images. The only issue I have with this filter is that when they use the resize handles rather than an image manager the proportions of the image aren't maintained.

Is there any way to enforce constrained proportions on images resized with the image resize filter's resize handles?


texts: how do i set the first page of my site in drupal 6?

texts:
I am new to drupal.

I started ctreaing site but facing problem in

how do set my first page in drupal

eg:

when user type

www.mysite.com

he should redirect to first page....


texts: How to use "db_query" instead of "db_select"?

texts:
I am using "db_select" in a computed field to get an array of values from database (trough an entity reference field - multi value):

$wrapper = entity_metadata_wrapper($entity_type, $entity);
$current_nid = $wrapper->nid->value();
$values_y = array();
/* First I get an array of referenced nodes IDs that are neccesary in second query*/
$child = db_select('field_data_field_plan_tpl_select_trainings', 'f')
  ->fields('f', array('field_plan_tpl_select_trainings_target_id'))
  ->condition('entity_type', 'node')
  ->condition('bundle', 'skills_plan_tpl')
  ->condition('entity_id', $current_nid)
  ->execute();
$child_nid = array();
foreach ($child as $item_child){
   $child_nid[] = $item_child->field_plan_tpl_select_trainings_target_id;
}
/* Here I get an array of values from referenced nodes */
$week_no = db_select('field_data_field_skill_week_no_planned', 'f')
  ->fields('f', array('field_skill_week_no_planned_value'))
  ->condition('entity_type', 'node')
  ->condition('bundle', 'skill')
  ->condition('entity_id', array($child_nid))
  ->execute();
$week_value = array();
foreach ($week_no as $item_week){
   $week_value[] = $item_week->field_skill_week_no_planned_value;
}

$values_y = array_filter($week_value);

I understand that "db_query" is faster than "db_select"; is it true and can it have a positive impact in my situation? How can this be translated into "db_query"?


texts: I am using Drupal 7. When I test my page speed in Google PageSpeed Tools, it says to compress the images. After that I compress the image and uploaded it. The uploaded image placed in files folder like (test_0.png) and the old name is test.png. I have lot of images like that. How to remove images which are not in use.


texts:
I have menu structure like this:

Home | About | Products

if a user is currently on English page then I need like this:

Home | About | Products | Swedish

and if a user is currently on Swedish language then it will show like:

Home | About | Products | English

1: So how can I add a menu switcher link to the main menu which shows only one language link at a time?
2: What will be the pate for each of the language in the path field while adding a menu link.


texts: How to configure breakpoints and picture to use span data-picture

texts:
I have follow the documentation that appear here: Picture documentation, but I'm not able to configure the module to use the same html that appear in the examples.

This is the code from the example Page:

  &lt;img typeof="foaf:Image" src="http://picture7w.h011.attiks.com/sites/picture7w.h011.attiks.com/files/styles/piccustom_user_tablet_1_5x/public/field/image/38054784.jpg?itok=zyO3uMRu" width="1300" height="867" alt="" /&gt;

Instead I get this html code:

<picture title="ejemplo">

  <source srcset="http://domain.new/sites/default/files/styles/verisure_breakpoints_theme_tc_mobile_1x/public/block/footer/LADRONA_en.jpg?itok=TrydhOr5 990w" media="only screen and (max-width: 767px)" sizes="(max-width: 767px)">

</picture>

Any idea how to configure the module?

Thanks

Oskar


texts: Ubercart: If two credit card payment gateways are activated, which one is used?

texts:
I have a client who has two payment gateways activated.

1) How do I figure out which one is being used during the transaction?

2) If one of the gateways fails, does it automatically try the next one?


texts:
Is there anyway I can set workflow dynamically using rule. Basically I need to setup workflow for given article only when someone flagged that article.

So can I setup some kind of rule that when an article is flagged, initialize workflow for that node and assign it to one of the workflow state?

-- Many thanks for your time.


texts: D8 - Access Webform submission values programatically

texts:
I have a webform whose results (some specific fields) I want to display in a table in a view. I am able to achieve that using the Webform Views Integration module. The view displays the output as

Field Name
Field Value

I want it to be displayed as

Field Value

Although it can be done via CSS using label{display:none;}, is there any way to do it out of the box or using modules?

Also, I want to overwrite the default webform submission layout which I can achieve using the answer here. But when I try to access the elements of the webform submission using {{html.fieldName}} or {{data.fieldName}}, it again prints out the label with it. I tried the nolabel filter but it does not work.


texts:
I'm doing the following

field_view_field('node', $node, 'field_geo',
    array(
      'label' => 'hidden',
      'settings' =>
        array(
            'format_type' => 'geofield_map_map'
        ),
    );

field_geo is a geofield.
geofield_map module is enabled (output is fine for this field in other instances where I am not calling field_view_field()

In looking through geofield_map.module, there is every indication in hook_field_formatter_info() that I should be using "geofield_map_map", but I don't get the map output. Anyone have any idea why?


texts: Create custom rendering of a field for search?

texts:
Is there a way to change the appearance of a field in the search?

Using a custom plugin, there is a field that holds an ID linked to a media database. The usual display for this field is getting links to all the images in this collection specified with this id. They will then be rendered using JavaScript.

In the search, I want to only show a thumbnail of the first image.
How can I hook into the search result rendering to change the display of this field.

At the moment, it just displays the stored ID in JSON format directly from the database without any processing!


texts: Why my custom submit handler isn't working in menu item edit form?

texts:
Code:

/**
 * Implements hook_form_FORM_ID_alter().
 */
function mymod_form_menu_link_content_menu_link_content_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {

  array_unshift($form['#submit'], 'mymod_menu_link_content_form_submit');
}

function mymod_menu_link_content_form_submit($form, \Drupal\Core\Form\FormStateInterface $formState) {
  //some code
}

Debug shows me that my custom submit handler is added to $form['#submit'] array as a first item. However this submit handler is never called.


texts: How to restrict number of nodes per content type?

texts: How can we restrict number of nodes allowed per content type. Let suppose if we allow 5 nodes then no one including the admin user can add the 6th node of that content type.


texts: Best approach to wrap rendered file field in a link?

texts:
I have a file field from the File Entity   module (2.x-alpha2) attached to a content type. I'm trying to customize the output of this field so that it links to the main node (this is for a teaser display). I'm overriding the node template for the teaser display, so I have access to the renderable field array for the field as well as the node path.

I'm trying to find the best approach for wrapping the image in a link. I can easily create the link tag using the l() function. However, I can't just wrap that around the rendered file field because it renders with a lot of extra markup aside from just the image tag.

What is the best approach to handle this? Programmatically altering the theme functions that render the actual image tag? It's not clear to me if I can do that quite yet.

If it helps at all, I'm also using the Media module (2.x-alpha2).


texts:
We have one REST API for getting the XML from users. Sometimes users enter XML data with a wrong format, for example with missing tags.
The following code only checks the used content type.
$contentTypes = $allHeaders['Content-Type'];
$requestmethod = \Drupal::request()->server->get('REQUEST_METHOD');
$contentTypes = isset($_SERVER["CONTENT_TYPE"]) ? trim($_SERVER["CONTENT_TYPE"]) : '';

if (strcasecmp($contentTypes, 'application/xml') != 0) {
  return new ModifiedResourceResponse('Content type must be: application/xml');
}

How do I check the XML format is correct?


texts: How do I query for the next three dates using EntityFieldQuery or Views? (7)

texts:
This is my first question, so please don't be too harsh.  I've been trying for the last couple days to solve this with no luck.

I have a content type called "Event" which contains a custom date field for the 'start date/time' of the event. What I need is to be able to list events for the next THREE days after the current timestamp.

Keep in mind that it doesn't count empty days, so if there are no events for tomorrow, for example, it won't count that as an empty day.  Instead it would list the events out for the next day, and the following (assuming there are events for those days).

If I were able to access the custom date field through straight SQL, I would first get the 3 dates I need, and the query would look something like this:

SELECT DISTINCT(DATE(`date_field`))
FROM {node}
WHERE `type` = 'event'
AND `field_start_test_date` > NOW()
ORDER BY DATE(`date_field`) ASC
LIMIT 3;

I've been unable to accomplish this with Views or EntityFieldQuery. I'm also willing to create my own joins using SQL, but from what I've read, that's discouraged.  I'm open to any suggestions.  Please let me know if I need to be more specific.

Thanks!


texts:
I'm trying to resolve a checkout redirecting issue. I've inherited a project and the site is using a multi-page checkout process. After entering all information and clicking the continue button, it goes into some kind of redirect loop.
You can see the resulting redirects on this screenshot.

I'm only guessing, but it appears to be caused by commerce_checkout_router call in commerce/modules/checkout/commerce_checkout.module.
I found the following code.
function commerce_checkout_menu()
 $items['checkout/%commerce_order/%commerce_checkout_page'] = array(
    'title' => 'Checkout',
    'page callback' => 'commerce_checkout_router',
    'page arguments' => array(1, 2),
    'access arguments' => array('access checkout'),
    'type' => MENU_CALLBACK,
    'file' => 'includes/commerce_checkout.pages.inc',
);

In /commerce/modules/checkout/includes/commerce_checkout.pages.inc, around line 34, the code is the following.
if (!empty($target_uri) && $target_uri !== $_GET['q']) {
     drupal_goto($target_uri);
}

The checkout page where this happens is /checkout/[order number]/checkout, so I'm assuming this code is the issue.
The messages I get are the following.

The webpage at http://mysite.local/checkout/44/review has resulted in too many redirects.
The webpage at http://mysite.local/checkout/44/shipping has resulted in too many redirects.

It seems to alternate between the two, so I'm pretty sure they are redirecting to each other. The question is, why?
I've installed xdebug and set a breakpoint in the commerce_checkout.pages.inc file, at the conditional statement I list above, but it doesn't seem to break, so I don't know what to do.
I also turned on rules debugging, but I'm not sure I see anything that would indicate a redirect, just stuff like "Reacting on event Calculating the sell price of a product." fires, "Calculate taxes" fires, and "Collect rates: Delivery By Truck" fires.
I'd really appreciate some assistance in troubleshooting this. I have to get this store running ASAP.


texts:
I'm working on a module that has a custom output for the form that's being called, and this form has multiple pages. The multiple page part is being called correctly, but I can't get the theme to render the form.

I've got the following code:

<?php

// Page callback to render the form
function mymodule_main() {
    return drupal_render(drupal_get_form('mymodule_form'));
}

// Picks which form to call
function mymodule_form($form, &$form_state) {
    drupal_set_message('Picking form to use');
    if(!empty($form_state['page_num']) && $form_state['page_num'] == 2) {
        drupal_set_message('Form 2');
        return mymodule_form_two($form, &$form_state);
    } else {
        drupal_set_message('Form 1');
        return mymodule_form_one($form, &$form_state);
    }
}

// Form definition for the first page
function mymodule_form_one($form, &$form_state) {
    return array(
        // ...
        '#theme' => 'mymodule_theme_one',
    );
}

// Hook theme call
function mymodule_theme() {
    drupal_set_message('Hook Theme has been called');
    return array(
        'mymodule_theme_one' => array('render element' => 'form'),
    );
}

// My custom theme for the first page
function theme_mymodule_theme_one($vars) {
    drupal_set_message('Theme for first form has been called');
    // Code to style the form
    return $output;
}

In the theme_mymodule_theme_one function I move some of the form definition things around, unset some variables for output, etc. When I visit my page I defined in my hook_menu() call I get the form I defined in mymodule_form_one but without any of the work done in theme_mymodule_theme_one and I only get the following two messages:

Picking form to use
Form 1

I don't see any of the other messages.

Edit

I've cleared the cache manually as well as disabled and re-enabled the module and the theme code still is not being called.


texts: How to change placement of block or region on events?

texts:
I want to change the placement of 2 regions based on window size. I know that I can print 2 blocks and use css dipslay:none based on window size, but I prefer not to double print a block.

Is there any way I can change the placement of blocks / regions based on events, such as screen size, using JS or similar?


texts: How to use an image styled by ImageCache Actions as background for a node?

texts:
I am trying to implement a custom banner with some text written on it.

I have created a custom content type called banner with 2 fields: an image field and a text field.
Then I process the image field through ImageCache actions in order to apply a watermark on a photo. (fine till now)

I want to use this image (the output of imagecache_actions) as a background image of a node, so that I can apply the text on top of it.

So now node is something like the following.

 blabla

I want to change it to the following.

 blabla

Seen from a different perspective, if I could dynamically overlay some text on top of the image, then that would also do the trick!

Can you suggest any idea?


texts: Services 3.5 q=system/connect.json 404 (Not Found)

texts:
I have code that use JQuery to call services module and login.
After Login, I call token through ?q=services/session/token and gets the token of the user.
I think that i have got the right token...
After that the code calle to ?q=my_services_endpoint/system/connect.json and pass through the header the token.

the problem is that i get those lines in the console and no success of course...

  7dR8Eo0pmiTeMCHLUeneAAQFCONn80NgXnJuNqhrtYw login.js:38

  OPTIONS http://{localhost}:8888/drupal2/?q=system/connect.json 404 (Not Found)
  jquery-1.6.4.min.js:4 POST

  POST http://{localhost}:8888/drupal2/?q=system/connect.json 404 (Not Found)

this is the code:

   $.ajax({
        url: "http://{localhost}:8888/drupal2/?q=test_test/user/login.json",
        type: 'post',
        data: 'username=' + encodeURIComponent(name) + '&password=' + encodeURIComponent(pass),
        dataType: 'json',
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            alert('page_login_submit - failed to login');
            console.log(JSON.stringify(XMLHttpRequest));
            console.log(JSON.stringify(textStatus));
            console.log(JSON.stringify(errorThrown));
        },
        success: function(data) {
            $.cookie("sessid", data.sessid);
            $.cookie("session_name", data.sessid);
            // Obtain session token.
            $.ajax({
                url: "http://{localhost}:8888/drupal2/?q=services/session/token",
                type: "get",
                dataType: "text",
                error: function(jqXHR, textStatus, errorThrown) {
                    alert("Didn't got the token");
                },
                success: function(token) {
                    console.log($.cookie("sessid"));
                    console.log(token);
                    // Call system connect with session token.
                    $.ajax({
                        url: 'http://{localhost}:8888/drupal2/?q=test_test/system/connect.json',
                        type: "post",
                        dataType: "json",
                        beforeSend: function(request) {
                            request.setRequestHeader("X-CSRF-Token", token);
                        },
                        error: function(jqXHR, textStatus, errorThrown) {
                            alert(errorThrown);
                        },
                        success: function(data) {
                            alert('Hello user #' + data.user.uid);
                        }
                    });
                }
            });


texts: Use image from taxonomy term as exposed filter option

texts:
I created a view which has an exposed filter for taxonomy terms. Now the next step is to theme the options. I tried the module "Better exposed Filters" but I wasn't satisfied. I would like to have images to click on instead the standard filter. I already have stored the images in the taxonomy fields, so every term has it own image.

I tried to create a template file for the filter, but I don't have any access to the fields, where the image is stored. I could do some hardcoded stuff, but I want it as generic as possible.

Has anyone an idea how to achieve it?


texts:
Basically I want to run this query against the current database and retrieve all node titles with node type of foo_type.

SELECT title FROM node WHERE type='foo_type' ORDER BY title ASC

How can I do this using db_query or any similar function? I tried doing the below but $result is empty.

$result = db_query("SELECT title FROM node WHERE type='foo_type' ORDER BY title ASC");

Please note any D6 and D7 differences if there are any.


texts: How to use LESS (CSS) in a Zen sub-theme?

texts:
I'm trying to use LESS in a Zen sub-theme, but while the CSS files are correctly included (even with a ".less" extension), the LESS rules themselves don't seem to be recognized and processed.

Here's my setup :

Zen theme installed, and sub-theme created (and activated)
LESS module installed and enabled (along with Libraries)
the lessphp library has also been installed, following the instructions on the LESS module page.

In my sub-theme folder, I basically have the following files :

mytheme.info, which includes the css/styles.css below.
css/styles.css: (provided with the Zen Starter Kit) only contains a bunch of import rules; among them I added @import "mytheme.less"; which will be the main CSS (LESS) file for my theme.
css/mytheme.less, in the same folder as the styles.css. I used this file to test simple LESS rules.

When I use a normal CSS rule in the mytheme file, it's recognized and displayed normally in the site (e.g. body {color: red;}. However, even basic LESS rules seem to be simply ignored. Example of code that doesn't work:

@color: red;
body {
    color: @color;
}

I'm not familiar with CSS preprocessors, so I don't know if I'm missing anything. Or is the Zen theme somehow incompatible with the LESS module?

So, any help is appreciated. Thanks in advance.


texts: How can I implement Schema.org on my Drupal 6 site?

texts:
I can't seem to find a straight-forward answer to implementing this - http://googleblog.blogspot.com/2011/06/introducing-schemaorg-search-engines.html - on my Drupal site.

I've found lots of Drupal discussion about microformats, RDF and RDFa, as well as support for RDF in Drupal 7 core, but I can't find a module that will help me to take advantage of Schema.org in Drupal 6.

As a non-developer, how can I easily start to work with Schema.org on my Drupal 6 site?


texts: How to load the required modules only on Drupal site?

texts:
I have a site which contains more than 100 modules. So, for each page every module is getting loaded.

Is there any way to load only required modules to that particular page?


texts: Altering the page title on a /node/add/ page from a custom module

texts:
I have a new content type I am developing that I am packaging using Features.

What I need to do is alter the page title for the node add page for this content type from the Features' .module file. I cannot see an appropriate module hook to do this.


texts:
I'm using flag_friend module and want to customize the email that is sent after a friend request is made.

What's the best way developing code for email functions like this where you can't just reload the page to see your changes?

I would have to go back, remove the friend request and create a new request to trigger the next email, then wait for the email to arrive.


texts: 'Illegal choice' error while submitting/validating selectbox shown with AJAX

texts:
I'm making a module where the content type and fields are created by install. Now i want to make one of those fields only to show up when an option is selected. I did this with AJAX, in some way I can't make it work with the field as defined in the module.install file. I have a radio button selector for two options. When selecting the first option there should show up a selectbox with a list of nodes to select. When selecting the second option two textfields should be shown instead. When I try to add content of this type I get the error message (when changing the value from the radio buttons):

An illegal choice has been detected. Please contact the site administrator.

Can someone give me some advice to make this work? Thanks in advance!

Here is my code from the install file:

function _concert_installed_fields() {
$t = get_t();
return array(
  // other fields left out
'venue_node' => array(
 'field_name' => 'venue_node',
 'label' => 'Select a venue from the list',
 'type' => 'list_integer',
 'cardinality' => '1',
 'foreign keys' => array(),
 'indexes' => array(
   'value' => array(
    0 => 'value',
   ),
  ),
 'module' => 'list',
 'settings' => array(
  'allowed_values_function' => '_concert_content_type_venue_options_list',
  ),
),
'venue_radio' => array(
 'field_name' => 'venue_radio',
 'cardinality' => 1,
 'type' => 'list_boolean',
)
);

From my .module file:

 function concert_form_alter(&$form, &$form_state, $form_id) {
 if($form_id == "concert_node_form") {
 $form['venue_radio'] = array(
  '#title' => t("Choose a venue from the database or add one manually"),
  '#type' => 'radios',
  '#options' => array(0 => t('Add a venue from the database.'),
                      1 => t('Add a venue manually.'),),
  '#ajax' => array(
    'callback' => 'concert_venue_callback',
    'wrapper' => 'venue_select',
    'effect' => 'fade',
  ),
);

$form['venue_select'] = array(
  '#prefix' => '
',
  '#suffix' => '
',
  '#type' => 'fieldset',
);
if (!empty($form_state['values']['venue_radio']) && $form_state['values']['venue_radio']   == "1") {
  $form['venue_node']['#type'] = 'hidden';

  $form['venue_select']['location'] = array(
    '#type' => 'textfield',
    '#title' => t('location'),

  );
  $form['venue_select']['venue_city'] = array(
    '#type' => 'textfield',
    '#title'=> t('city'),
  );
}

else {
$form['venue_select']['venue_node'] = array(
    '#type' => 'select',
    '#options' => _concert_content_type_venue_options_list(),
    '#title' => t('venue node select'),
    '#default_value' => '466', // node id is select value
  );
if (!empty($form_state['values']['venue_node']))
$form['concert_venue_node']['und']['#default_value'] = $form_state['values']['venue_node'];
}

function concert_venue_callback($form, $form_state) {
   return $form['venue_select'];
}

The options from the selectbox are populated by a function in a file accessable for both the .install and the .module file:

function _concert_content_type_venue_options_list() {

$results = db_select('node', 'n')
 ->fields('n', array('nid', 'title'))
 ->condition('n.status', 1)
 ->condition('n.type', 'venue')
 ->execute();

$options = array();
  foreach ($results as $node) {
    $options[$node->nid] = $node->title;
  }
return $options;
}


texts:
For some fields, not all, the language index is missing from the field array. For example, here is the body field of the packaged blog content type (using print_r):

[body] => Array
    (
        [0] => Array
            (
                [value] =>
Shirley Temple[...]
                [summary] =>
Shirley Temple[...]
                [format] => html_raw
                [safe_value] =>
Shirley Temple[...]
                [safe_summary] =>
Shirley Temple[...]
            )
    )

Expected structure:

[body] => Array
        (
            [und] => Array
                (
                    [0] => Array
                        (
                            [value] =>
Shirley Temple[...]
                            [summary] =>
Shirley Temple[...]
                            [format] => html_raw
                            [safe_value] =>
Shirley Temple[...]
                            [safe_summary] =>
Shirley Temple[...]
                        )
                )
        )

I have only ever seen this happen on two fields (the one above and another field from a different content type). Other fields on the blog content type are fine. It looks like it is only happening on my development environment, production seems to be fine. If I set $reset to true when calling node_load() then the structure is fine.

field_get_items() returns false and wrapping the node using the Entity API's entity_metadata_wrapper() and calling $wrapped_node->body->value() I gives the following PHP error:

  EntityMetadataWrapperException: Missing data values. in EntityMetadataWrapper->value() (line 83 of /vagrant/web/sites/all/modules/entity/includes/entity.wrapper.inc).

Setup:

  Drupal 7.28
  PHP 5.3.10
  MySQL 5.5.34
  Apache 2.2.22
  memcached 1.4.13


texts: How can I trigger a rules event by code ?

texts:
I'm using Commerce for the website I'm building right now.
I want to trigger the event "Calculate the sell price" after an order is updated to a status, I made one called "Approved".
The reason I want to do that is that the Tax is calculated at this event and at the "Checkout: Checkout" page, but the store manager wants to choose if the customer should pay tax or not, he wants to do that manually not using billing or shipping conditions.

I added a boolean field "Apply VAT?" to  the order page and added a condition if that entity exists and is true to apply the VAT tax, but this is:not done at the checkout page and I noticed that if I change the status back to "Checkout: Checkout" the VAT tax is applied and this is because of the "Calculate the sell price" event (tell me if I'm wrong).

I was thinking to build a rule with the event "Order is updated" and the action to be a PHP code to invoke the event again, I know about rules_invoke_event, but I can't get it working.

I also have problems with the tax not being applied to the shipping cost, but this is another problem (maybe I will open another question of this)

I will appreciate any answers, thanks!


texts: Commerce Payment method with custom fields

texts:
I am trying to create simple payment method with some text-fields the customer must fill out.
Spend a lot of hours on this and can not figure it out.
Right now I am trying to make a custom PaymentMethodType and ad it to a custom PaymentGateWay but i can not get it to work.
Can not find any documentation on creating PaymentMethodTypes.


texts:
I want to control the thumbnail image size for my media entities of type video.

The thumbnail image size being fetched by the media module from Youtube has 480 x 360px.

I want to use the 1280x720 images. Is there a way for me to control this?


texts: register with webform in uber cart drupal 7

texts:
Im trying to build a site with custom roles which are sold as memberships.

I've created my uber cart install and tested it. The rules defined allow the User to be assigned to the desired role upon completing a payment.

But the role membership should only be available to new users so im trying to unify the registration/uber cart checkout process

ive got some ubercart/webform module that allows me to have a webform in the checkout pane.

The problem im having is trying to hook the webform up to the registration process, i need some kind of rule to create a user account and login the visitor the new account one the payment is marked received.

I know there is some modules for dr6 to do this but im using dr7,

any help appreciated on figuring this out, im looking into using field collection/tokens/entities but maybe im over complicating it? maybe there is a direct hack into the .tpl i could do to insert the details from the webform into the user table?


texts: Import translation file only for specific core module

texts:
I am creating a multilingual D7 website. I am using core module locale and i18n contrib module. I am trying to import the localization files for a language.

I know that I can download the unified .po file for a language from https://localize.drupal.org and import it in the multilingual website from http://EXAMPLE.COM/admin/config/regional/translate/import.

Is there a way I can export from https://localize.drupal.org a .po file only for a specific core module (eg contact)? I can do this for a contrib module but not for a core module.

Thanks a lot.


texts: How do I display a taxonomy term if another term is active for a node?

texts:
I have a content type that has taxonomy terms for Category, like Blog, Publication, and Project. Depending on which term is selected, the content is displayed under blogs, publications or projects. If the category selected is Project, then the user has to select the focus area from another vocabulary (not a child vocabulary) - Focus Area 1, Focus Area 2... through to Focus Area 10.

Currently, my pathauto pattern displays the Category/Node_Title - [node:field_post_category:entity]/[node:title]

My objective is that I also want to display the Focus Area term in the node url, but ONLY if the category chosen is 'Project'. In that case, I want the url to be project/focus_area_n/node_title. So the focus area is displayed in the node url only if the category is project. Is there a Pathauto pattern, or any other method that I can use to accomplish this?

I need to do this so that I can control the display of a few blocks in the sidebar that will show up depending on what the URL is.

Thanks in advance...


texts: Why does webform module uses $node->webform as a property?

texts: Why does webform module uses $node->webform as a property instead of $node->type['webform'] or something like that?


texts: View example.com/tags/xyz works, now how to get example.com/tags working?

texts:
Using Drupal 7.31 with Views 7.x-3.8.

I cloned the existing default "Taxonomy term" View and enabled it. Now if I visit www.example.com/tags/xyz I get a nice listing of all nodes tagged with xyz (I have Pathauto enabled).  And same for www.example.com/tags/abc.

However if I visit www.example.com/tags it displays "Page not found".  So my question is how can I get www.example.com/tags to list all the terms for the tags taxonomy?  Do I have to create a new view or can the one view handle it all?


texts: avoid duplicated records with drupal_write_record

texts:
I want to test drupal_write_record, the insert part is ok, but this function seem to duplicate records.

How to make a condition for if new record is already stored ?

some like db_merge with key

Thank you


texts:
How can I create a Tagadelic page in a view? I create a tagadelic page in a view, but all tags display as a column.  See the below screenshot

But I want to display them in the following style:

Would you please tell me, how to change this style?
Many thanks


texts:
In my module, I was trying to make use of db_or() in this way...

$filterSparten = db_select($this->tbl_hat_sparte, 'hs')
  ->fields('hs', array('hat_AID'));

$or = db_or();

foreach($_GET['tags'] as $tag) {
  $or->condition('hat_KID', $tag);
 }

 $filterSparten->condition($or)
  ->execute()
  ->fetchAssoc();

...which, unfortunately, only returns a SelectQuery-object:

SelectQuery Object
(
    [fields:protected] => Array
        (
            [hat_AID] => Array
                (...

Why doesn't my code return a fetched results-object? I have compared it several times with the examples on the Drupal-pages, but I can't help myself with it.


texts: Webform does not submit when a file field is added

texts:
I have a single page webform with a bunch of fields (text field, radio buttons, etc) that works fine. As soon as I add a file upload field it stops working:

when submitted, the form returns with all the fields still filled in
there are no validation messages of any kind

I've littered webform.module with lines of print statements and it appears that webform_client_form_validate and webform_client_form_submit are never called at all. I suspect some module may be altering my form because it picks up the file field somehow.

All webform related modules have been disabled.

I suspect I'm having a similar problem this question describes: Webform does not submit, instead redirects to self . The suggested solutions are rather vague though, and I'm not sure how to proceed.


texts: Default installation of D8 treatment of .gif accesses?

texts:
If I request a non-existent URL, say, /ddddd I get Page not found (as expected). If I do th4 same with an unusual extension /dddd.xcf I also get Page not found.

BUT if I request /ddddd.gif there's an Apache error as opposed to a 404?

I'm guessing this has something to do with security, but can someone clarify this?


texts:
I was wondering if its possible to setup a facility where I can attach content to existing content?  Let me elaborate...say I have my Page nodetype, but I want to give the content-editor the ability to add extra information to it that can be displayed in a separately styled div (I do not want the editors playing around with the HTML - they don't know how to anyway). This must be a zero-or-one relationship.

I'm thinking something like the nodereference_url module, except that I want to limit the amount of node references to a maximum of one. Does anyone how this can be achieved? Thank you!


texts: Is it possible to load a webform that is using a specific custom handler?

texts:
I have a custom handler for one of our webforms, it may be re-used for other webforms. It integrates with a 3rd party API and sends the response back to Drupal.
I have to save the submissions to handle the response.
I`m wondering if its possible to load all webforms which are using this custom handler?
My goal is delete submissions of those webforms when they are older than a certain time.


texts: How can I translate the particular field or content in english to german language?

texts:
As I want to convert the particular field or content from drupal to german language.Is any other way to do this .Also i tried the entity translation to convert the german language But Its convert all the content in my site to german I need only convert the particular field to german language Is it possible to do this in drupal .

Any one Much appreciated.


texts: How to import Panel configuration from versionned code

texts:
I have a Panel in my D6 website and I have exported it using the Panels Export Section and I want to know if it is possible to use this code from i a module so I can have a version control over the Panel configuration.
How can I do that. Is there any Panle API I can use??Or how can I export panel export in features??

Thanks


texts: Add payment method surcharge on single page checkout

texts:
Using Drupal 7, Drupal Commerce module.

I have a single page checkout on which the user enters Billing Info, selects one of two payment methods and enters their credit card or E-Check information (using the Commerce NMI payment gateway which utilizes a direct-post method), and ultimately submits the payment.  The Review pane is empty and therefore skipped, so the checkout proceeds directly to the Third-party Payment Redirect pane.

My issue: I use a Rule to apply a fee (using Commerce Fees) depending on payment method, but it seems like the payment method isn't being set before the information is sent to the payment gatway--the payment method comparison always evaluates to false.

The rule is recognized after the fact, however, as the fee gets added after the payment has been submitted, resulting in an unpaid balance on the order.

The client is set on a single page checkout process, and so what I need is this:

How can I grab and alter the order information after submitting the checkout form but before the third party redirect fires? This would be very helpful as I would also like to add a custom code to the order ID this way.