texts:
I successfully print the image url for a individual images by the following:

$file = file_load($node->field_hp_slideshow_image['und'][0]['fid']);
                print file_create_url($file->uri);

How can I do something similar but display the url of multiple images in a for or for each loop? Below I have this but it doesn't work:

<?php $slide_image = $node->field_hp_slideshow_image['und'];
    $slide_url = $node->field_hp_slideshow_link['und'];
    $file = file_load($node->field_hp_slideshow_image['und'][0]['fid']);
    print $field_hp_slideshow_image['und'][0]['filename'];
    print file_create_url($file->uri);
?>
<?php for ($i = 0; $i < count($slide_image); ++$i): ?>

        <a href="<?php print $slide_url[$i]['url']; ?>">
        <img src="<?php print $base_url . "/" . $path . "/" . $slide_image['filename']; ?>" alt="" />

<?php endfor; ?>


texts: Should a fresh install of Drupal have failing tests and what to do with the failing tests?

texts:
I'm delving into the world of SimpleTest in Drupal. I started off by doing a fresh installation of Drupal 7 and running all the tests. I noticed there are a few tests that are failing, along with 1 test throwing an exception. Should a completely fresh install of Drupal 7 (or Drupal in general) have failing tests? I understand that in HEAD not all tests are going to pass. But, does Drupal get released along with a test suite that includes still failing tests?

I've tried searching the Drupal Core issue queue for some of the failing tests but haven't really found anything.

Edit

Based on comments so far, it seems that it is not intentional that a release of Drupal would include failing tests, even if for known issues that haven't been resolved as part of that release. Given that assumption, what is the best thing to do from there?


texts:
I have the following code:

            $node = new stdClass();
            $node->type = 'enterprise_event';
            node_object_prepare($node);
            $node->title = $event->title;
            $node->venue = $event->venue;

My enterprise_event content type also has a date field which is a (start_date - end_date) field, but using the devel module it shows that the field is called date.
How can I set the date->start_date, date->end_date values?

Is there something like $node->date->start_date?


texts: How to Show Nodes under different flags in a view

texts:
I have two flags, Flag A and Flag B. I need to have a view that lists the nodes that flagged under A and also the nodes that flagged under B.

Using Include only flagged content option in Relationship, I only get the nodes that are flagged by both the flags. But in my scenario I need nodes that are flagged either by flag A or flag B.


texts:
I made custom module that implements hook_form_alter that marks the field_text_field_1 textfield as Ajax-enabled. When a key is pressed inside the field_text_field_1, it should change the value in a second textfield: field_text_field_2.

$form['#prefix'] = '
';
$form['#suffix'] = '
';

// $form['field_village']['#attributes']['id'] = 'edit-field-cities-wrapper';

$form['field_text_field_1']['widget']['#ajax'] =array(
    "callback" => "ajax_change1",
    'wrapper' => 'my_form_submit_wrapper',
    "event" => "change",
    "effect" => "fade",
);

The callback function:

function ajax_change1(array &$form, FormStateInterface $form_state){
      $form['field_text_field_2']['widget'][0]['value']['#value']='hello';
      return $form;
}

But it's not changing the value of `field_text_field_2 to "hello".


texts: Is there a module or configuration that logs PHP mail errors?

texts:
On shared hosting. We're having strange mail problems... mails do not get sent to various domains or are delayed. It seems to happen more in Webforms than in Notify_message actions in Rules.

Is there a way to log the PHP mail() error messages without hacking the MimeMail module? The Drupal log only shows that there was an error... nothing more specific.


texts:
I am using Drupal 7 version of Signup module. It send email reminders before the course starts X number of days. Is it possible to send SMS reminders using another module. If not then where i should be looking in the code ?

thanks


texts: Override node template depending on menu settings

texts:
How do I override the template of a node based on where it is in the menu?

For example, I create a node, and within the "Menu settings" I put it under some "parent item". I wish to use a specific template for nodes of a particular content type that fall under a particular parent item.


texts:
I have a site online engcorrect.net and for some reason my menu on my homepage disappears. On all other pages, it shows. The weird thing is that on my localhost (local machine) it shows correctly but not on the production site and it also shows if I use private browsing. What am I missing here? I am using Drupal 7 and bootstrap 3 theme with a subtheme called paper.

There is a css line that I cannot allocate:

body.front ul.menu { display:none;}

The inspector shows that it originates from engcorrect.net:1 where is that and who set it?

resizing doesn't fix the issue either.
Who can help me with this?


texts:
I've got this request.

SELECT COUNT(*), ( SELECT COUNT(*) FROM  `node` WHERE uid = 1 AND type = 'article' )
FROM  `comment`
WHERE uid = 1

Currently, I'm executing this with 2 different EntityFieldQuery objects.

$query = new EntityFieldQuery;
$result = $query
          ->entityCondition('entity_type', 'node')
          ->propertyCondition('status', 1)
          ->propertyCondition('type', 'article')
          ->propertyCondition('uid', 1)
          ->count()
          ->execute();
$query = new EntityFieldQuery;
$result = $query
          ->entityCondition('entity_type', 'comment')
          ->propertyCondition('uid', 1)
          ->count()
          ->execute();

How can I make only 1 request (EntityFieldQuery, db_select(), or db_query())?


texts: Composer module doesn't contain a .info file

texts:
So I am quite new to Drupal and I was hoping someone experienced could tell me what I am doing wrong.

Essentially, I have Drupal 7.5 linked to my website, but I am having problems installing the Composer module using the control panel.

Whenever I attempt to add the module by either URL or a local download, Drupal claims that it doesn't include a .info file. Which, from what I can tell after unpacking it and inspecting its contents, is true.

So, I was wondering if the lack of a .info file is a problem on my end (likely) or just a case of the Composer devs forgetting to include it (unlikely).

Hopefully someone will be able to help out.


texts:
I am using D7, I want to create a dependent filter in view .
Now I use taxonomy to create three vocabulary : Device, Unit Type, Format .

Device has two value PC and mobile , unit type values belongs to PC and mobile , Format values belong to Unit type .
I want it to show like : choose PC, then the value for Unit type only show the list belong to PC, and when choose 'PC type one', then the value for Format only show the list belong to Unit type.

I try to use the module dependent filter in view , but it can't create the relations between the three list. anyone can give any suggestion and guidance will be very thanks .


texts: Invalid form POST data error on ctools modal

texts:
I am using Node Comment Block and Ajax Comments to put comments in block and ajaxify them, and comment system is working fine, on content page I have a link which opens node edit form using ctools modal, node form on ctools works fine too. Issue comes when  a user replies on a comment and then comes back to use the node form on ctools modal through the link, in that case the form opens fine but on submitting user gets

An AJAX HTTP error occurred
HTTP Result Code: 200
Path: /system/ajax

Meanwhile there is a watchdog entry for the same which says Invalid form POST data.

WatchDog trigger point seems to be includes/ajax.inc, inside ajax_get_form()

function ajax_get_form() {
  $form_state = form_state_defaults();

  $form_build_id = $_POST['form_build_id'];
  watchdog('ajax', $form_build_id, array(), WATCHDOG_WARNING);

  // Get the form from the cache.
  $form = form_get_cache($form_build_id, $form_state);
  if (!$form) {
    // If $form cannot be loaded from the cache, the form_build_id in $_POST
    // must be invalid, which means that someone performed a POST request onto
    // system/ajax without actually viewing the concerned form in the browser.
    // This is likely a hacking attempt as it never happens under normal
    // circumstances, so we just do nothing.
    watchdog('ajax', 'Invalid form POST data.', array(), WATCHDOG_WARNING);
    drupal_exit();
  }...

I am getting $form_build_id on node form submission, not sure if it is valid one or outdated, also I am not getting clue how ajax comments are creating issue with node form. Any pointers?

Update

function ajax_get_form() only gets invoked from node edit form submission on ctools when there is reply on comment section, if there is no activity in comments, ajax_get_form() does not even invoke.


texts: Adding a Image Upload Button in CKEditor

texts: I have installed CKEditor in Wysiwyg profiles. While publishing any node if i click on the image upload button it shows options to add images by a image link, but what is the way to add a dynamic image upload button so that users will be able to Browse and choose any image from their computer in content?


texts: Custom Mult-Step Form remove next button

texts:
I have built a Multi-Step form using forms example module as a base:

https://api.drupal.org/api/examples/form_example!form_example_wizard.inc/function/form_example_wizard/7

I have a function that takes the user-inputted location on the first form and returns data for presentation on the 2nd form. If no data if returned back from the first form I want to hide the Next button. How can I do this?


texts: Quick edit destroys CKEditor formatting... any way to avoid it?

texts:
Quick edit doesn't bring up CKEditor buttons, and clears immediately all previous formatting (like numbered lists), which can lead to serious data lost, in my case.
Is there any patch to have Quickedit SKIP those textareas at all, while allowing it to interfere in those more simple fields?
Using 7.x-1.5 module version, Drupal 7.41
thanks


texts: Contextually filtering a view using values from a completely separate table?

texts:
I have a table "user_connections"

id | uid1 | uid2
1  | 1    | 2
2  | 3    | 1
etc

So, if the current user has uid = 1, then according to my table, he is "connected" to use 2 and 3. So I just want to be able to do something like:

select uid1 from user_connections where uid2 = :currentUserUid

Then pass these uids as a parameter to the view. So that it is ultimately used as a "where in" condition.

Any ideas how to do this? Or what is the best way?


texts: I'm trying to create a view based on a Solr search index that includes a search form in a block. The view seems to be working based on the preview I see when editing the view. I have set "Exposed form in block: Yes" and "Exposed form style: Basic". The block is assigned to a region, and the block itself is rendered appropriately when the page is displayed. The problem I'm having is that the form is not displayed in the block. I see the block title, but no form and no button. What might I be missing here?


texts: Upgrading from 8.3.7 to 8.4 conflicts with acquia/blt-project

texts:
In the composer.json file I added "drupal/core": "~8.4" to the required section. When I run composer update drupal/core --with-all-dependencies, I get the following output.

  Loading composer repositories with package information
  Updating dependencies (including require-dev)
  Your requirements could not be resolved to an installable set of packages.

  Problem 1

  drupal/core 8.4.0 conflicts with acquia/blt-project

Why does Drupal 8.4 conflict with acquia/blt-project?


texts: How to get bundle machine name when viewing the creation form?

texts:
From the creation form (any bundle), I need to get the content type label/name to use it in a link (in a block, for example) and pre-filter the View opened by this link.

Example :

The user wants to add a new Article and opens the Article creation form.

In a special block (let's say in Highlighted region), a link is displayed : "Clone existing".

This link leads to a View listing the existing Articles with a clone button for each.

This View can be filtered by content type.

So the link would be something like :

<a href"/existing-nodes?type=[node:content-type]">Clone existing</a>

How to get the [node:content-type] (just here to clarify, good old token) from the form?

Any tip would be nice.


texts:
Quick question, is there a token that can be used within the drupal ui to grab what has been typed into a exposed filter text box.

I am asking because, for example, when a user applies this filter, if it returns 0 results i want to display the message 'Your search for 'SEARCH_TERM' returned 0 results'.

With SEARCH_TERM being whatever was typed into the input field.

I went into ADMIN->STRUCTURE->VIEWS, chose my views and went to the 'No Results Behaviour' configuration page.

Did the following:

And i thought this would grab the input in the 'Title' field, but instead it just outputting exactly what is typing into the pictured textbox.

Any help on how i can grab what has been typed in to display in the no results message would be much appreciated.

Thanks


texts: How to embed existing website in my Drupal 8 site?

texts:
I have a site I created with Drupal 8, lets say http://falzon.xyz/.
Elsewhere, I have a site created with Jekyll, a bunch of static pages linked to each other visible http://www.elina-noe.eu/).
I'd like to "embed" the static site as a "subsite" of falzon.xyz, i.e. accessible as http://falzon.xyz/elina-noe/, by 'simply' putting all its files in a subfolder of the D8 site.
How can I do that?


texts: Disabling authoring information in Omega 3.x does not work from content type; how can I disable it?

texts:
I see no way of successfully disabling, through the user interface, the author information, wheb using an Omega 3.x sub-theme. The standard method of disabling it from the content type settings is not functional.

So is my only option to use a theme suggestion?


texts: How to get Views field value in View twig template if the Views field is set to 'Exclude from display'?

texts:
I have a Views fields twig template where I want to print the Views fields values manually.

For example, using: {{ fields.body.content }}

But this only works if the Views field is not excluded from the display.

Is there a way for me to print Views fields values if they are hidden (excluded from display)?


texts:
I have created a content type called providers and when editting said content types users can fill in extra information related to the content.
I have included said form fields using hook_form_alter, and the appropriate hook for _submit applied with it all working fine (saving to db etc)
Where I am stuck is I can access the data, by loading it via hook_ENTITY_TYPE_load call which allows me to access it in _form_alter but for some reason when viewing the node, I do not see the data.
Is there a specific way of loading external data on top of node object in d8?
below is how i load the data.
    /**
     * Implements hook_ENTITY_TYPE_load($entities)
     */
    function remittance_providers_node_load(array &$entities) {
      //loop thorough the loaded entities
      foreach ($entities as $key => $entity) {
        // if provider node type is being loaded add our data on top of it.
        if ($entity->bundle() == 'providers') {
          $nid = $entity->id();
          $commission_data = currencyStorage::loadCommission(array("companyID"=>$nid));
          if(count($commission_data)>0){
            foreach ($commission_data as $ckey => $comm) {
              $entities[$key]->commission[$ckey]['amount_from'] = $comm->amount_from;
              $entities[$key]->commission[$ckey]['amount_to'] = $comm->amount_to;
              $entities[$key]->commission[$ckey]['commission'] = $comm->commission;
            }
          }
        }
      }
    }

I have installed devel and checked all its phases and I dont see it in there.


texts:
I am trying to create a node programatically like so,

$newNode = (object) NULL;
$newNode->type = 'job';
$newNode->title = $data['JobTitle'];
$newNode->uid = $user->uid;
$newNode->created = strtotime("now");
$newNode->changed = strtotime("now");
$newNode->status = 1;
$newNode->comment = 0;
$newNode->promote = 0;
$newNode->moderate = 0;
$newNode->sticky = 0;
$newNode->tid = 0;

$newNode->summary['und'][0]['value'] = $data['JobSummary'];
$newNode->body['und'][0]['value'] = $data['JobDescription'];
$newNode->field_employment_type['und'] = strtolower($data['JobType']);
$newNode->field_job_reference['und'][0]['value'] = $data['JobReference'];
$newNode->field_salary['und'][0]['value'] = "";
$newNode->field_salary_from['und'][0]['value'] = $data['SalaryFrom'];
$newNode->field_salary_to['und'][0]['value'] = $data['SalaryTo'];
$newNode->field_salary_override['und'][0]['value'] = $data['Salary'];
$newNode->field_application_email['und'][0]['value'] = $data['ApplicationEmail'];
$newNode->field_job_category['und'][2] = 2;
$newNode->field_job_category['und'][4] = 4;

//die(print_r($newNode));
// save node
node_save($newNode);

Here I have potentially 4 taxonomies to pick from (their id indicated in brackets) Creative (2), Technical (3), Marketing (4), Client Services (6).

On node_save I am getting the following error,

  500 Internal Server Error : An error occurred (23000):
  SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'tid'
  cannot be null

How do I overcome this this I would have thought setting the field_job_category to the id of the taxonomy would be enough?


texts:
I have a Drupal view where I would like to enter some text in between 'Exposed Filter' and 'Content' sections. What is the safest of doing this? Attached image shows exact location I need text inserted.

Thanks


texts: Different favicon for local version of site?

texts:
It's a small thing, but it would be nice if a site running locally could use a different version of a favicon, to make it easier to separate local and live sites visible in browser tabs.

I had in mind a really simple implementation, where a local favicon would just have "_local" appended to the name of the current theme favicon, so:

favicon.ico
favicon_local.ico

Then, if the site is running locally, and if a local version of the favicon exists, use it instead.

My question - what's the best way to implement this? Also, what would be a good way to check if a site is running locally?

Thanks for any ideas, code, or pointers.


texts: How do I make rows of views blocks on a basic page reacting collectively to an exposed filter?

texts:
I have to make a page, containing 3 rows with 3 blocks with content teasers.
Preferably the page layout should be made through a basic page content type item, through the Layout Builder, so it is easy to add other stuff.

At the top of the page should come a view's exposed filter for the teasers. So, the teasers that are shown must be filtered for some selected content types plus for some taxonomy terms. I've been able to make that filter on a normal view page. Also I accomplished to get the filter in a separate block. But, because of the fact that both a basic page and a view page need a url, I couldn't accomplish this idea.

Is it possible to make a basic page with separate rows of view blocks via the Layout Builder, reacting collectively to an exposed views filter?


texts: Output block in particular region from custom module drupal 7

texts:
I have a custom module that spits out a form using the drupal form API. What I'd like to do is output a block (a custom menu) in a particular region of the page (using block regions would be the best way I'm guessing.) As of now, the block renders in the top left everytime. How can I output the menu block in a particular region of the page?

function client_menu(){

 $items=array();

 $items['campaign']=array(

   'title'=>'Campaign Manager',
   'description'=>'Area for clients to manage their campaigns',
   'page callback'=>'drupal_get_form',
   'page arguments'=>array('client_campaign'),
   'access arguments'=>array('access client administration'),
   'type'=>MENU_NORMAL_ITEM
 );

 return $items;

}

function client_campaign(){

$block = module_invoke('menu', 'block_view', 'menu-client-admin');
print render($block);

//a bunch of form API stuff...

}


texts: Is it possible to remove classes from a field that uses the Rendered entity format?

texts:
I have an entity reference field that is being handled by Display Suite. Even when setting the field template to expert, I can't completely strip away the default classes. The markup still has a div wrapper like so:

      Configure

Edit

Delete

Manage display

    Chicken Breast Tenderloins

Is there any way to remove those classes? Like maybe using a preprocess function or something?


texts:
I have the following code and for some reason my title is not showing up on the form display. I've tried flushing the caches a million times, clearing my cookie cache, and refreshing the browser and even changing the code to read

'#title' = t('Module tool'),

It doesn't work. The title never shows up although all the rest of my form displays and works fine. Any idea what might be going on here?

Current code:

function modulename_menu() {
  $items['modulename'] = array(
    'type' => MENU_CALLBACK,
    'title' => 'Module Tool', // doesn't display
    'page callback' => 'drupal_get_form',
    'page arguments' => array('modulename_form'),
    'access callback' => TRUE,
  );
  $items['modulename/secondLevel'] = array
  (
    'title' => 'Other Title', // page redirect; displays fine
    'page callback' => 'pathfindertool_recommendations_page',
    'access callback' => TRUE,
  );
  return $items;
}

So this was FIXED by removing this line:

'type' => MENU_CALLBACK,


texts: In which table in the database are the email messages stored?

texts:
I would like to know what the table the email messages (Emails section at admin/config/people/accounts) are stored in?

Config: Drupal 7

Any help is appreciated.


texts: Keeping track of date when user profile has been updated

texts:
I couldn't find a module or feature in D7 that keeps track of the date/time when a user updates their profile (any of the fields).
I'm not using profile2 and I'm not planning to switch to that, otherwise I could probably do it with the node revision.

Is there another way of doing it other than adding a "last_update" date field to the user and then using a hook_user_update() or hook_user_presave()?


texts: Advanced search in Multidomain - Multilanguage catalog webpage Drupal 7

texts: I have a quite complex products database. I have migrated most of the content and hierarchy into Drupal taxonomy, content type and relationships scheme. However, I am not sure if I will be able to configure some Advanced search module to look for products according to name of product, category (taxonomy) and other intrincate parameters. Can you advice some module which is easy to configure and write own MySQL search strings?


texts: Concept of services, tags, and arguments

texts:
I defined a service using the following code.

services:
  redirect.repository:
    class: Drupal\redirect\RedirectRepository
    arguments: ['@entity.manager', '@database', '@config.factory']
    tags:
      - { name: backend_overridable }

According to my understanding, '@entity.manager' , '@database', and '@config.factory' are classes on which the service is dependent.

Now, the entity.manager service definition is the following.

class: Drupal\Core\Entity\EntityManager
parent: container.trait
tags:
  - { name: plugin_manager_cache_clear }

It has a tag associated with it. Maybe this tag manages all entity specific cache.

What is the responsibility of the redirect.repository services?
Does this service help communicating with the database directly?
What if I don't have any entity and I implemented hook_schema()? Can I mention my custom database table name instead of @entity.manager?
Where do these tags actually get registered?


texts: How to get parent node values on inline entity form hook alter?

texts:
I am using inline entity forms to create a paragraph in a node form. When I add a node I want the title of the node form to be copied to the paragraph when I click on "Add paragraph". I use hook_inline_entity_form_entity_form_alter to prefill the title field. That works, only I can't get the values from the node form. Not with the below code.

function example_forms_inline_entity_form_entity_form_alter(&$entity_form, &$form_state) {
  $node = $form_state->getFormObject()->getEntity();
  if ($node->getType() == "task" && $entity_form['#bundle'] == "improvement") {
    \Drupal::logger('Form state values')->debug("
" . print_r($form_state->getValues(), TRUE) . "
");
    \Drupal::logger('Node values')->debug("
" . print_r($node, TRUE) . "
");
    $entity_form['title']['widget'][0]['value']['#default_value'] = 'This is Jessica';
  }
}

Can someone help me solve this?


texts:
i created a custom module, which renderes a custom template.

i followed this tutorial

now basically i want to add, bootstrap, jquery, and some custom stling and scripts,

I read this article,

and i am not able to attach any files to my timplate..

my file structure:

 - product_tree
  - templates
     - products-tree.html.twig
  - src
     - Controller
         - productTreeController.php
  - js
     - bootstrap.min.js
     - customScripts.js
     - ...

  - css
     - customStyles.css
     - bootstrap.min.css
     - ...

  - product_tree.libraries.yml
  - product_tree.info.yml
  - product_tree.module

this is my libraries file:

# producttree.libraries.yml
product-tree-libraries:
 version: 1.x
  css:
   theme:
    css/customStyles.css: {}
  js:
   js/customScripts.js: {}
  dependencies:
   - core/jquery

this is my hook:

function product_tree_theme($existing, $type, $theme, $path) {
  return array(
    'products_tree' => array(
      'variables' => array('items' => array(), 'title' => '')
    )
  );
}

i tried attaching it through the renfer array

$build =  array(
    'page' => array (
        '#theme' => 'products_tree',
        '#items' => $items,
        '#title' => 'products',
        '#attached' => array(
            'library' => array(
              'product_tree/product-tree-libraries',
            ),
        ),
    )
);

and in the twig template:

{{ attach_library('product_tree/product-tree-libraries') }}

but still no luck,

in the twig i call the css and scripts

<link href="css/style.css" rel="stylesheet">

i dont know if that is needed, but i tried with and with out, when i include it, i see in the browser inspector that the css file being uploaded, but then "canceled"

can any one tell me what should i do? or what am i doing wrong ?

EDIT:
in the controller, I am renderiung the page like this:

$items = array(
    array('name' => 'product one'),
    array('name' => 'product two'),
    array('name' => 'product three'),
    array('name' => 'product four')
);
$build =  array(
    'page' => array (
        '#theme' => 'products_tree',
        '#items' => $items,
        '#title' => 'products',
    )
);

$html = \Drupal::service('renderer')->renderRoot($build);
$response = new Response();
$response->setContent($html);

return $response;

i made This according to this answer

because i want it to be separated from drupal.
maybe this is the problem?

when i use BareHtmlPageRenderer to render the page (according to this answer). i see drupal imports and the page looks more alive, but still my custom css and js are not there!


texts: How do I show a term's node count in grid format?

texts:
I've been looking around for instructions on how to show the node count for taxonomy terms, and, while I did find instructions on Views and node count for taxonomy terms, it wasn't exactly what I need. The terms and their counts do show up next to each other quite nicely (Ex: Term A(13), Term B(2), Term C(17), etc.). However, they only show up as an unformatted list.

I need them in a grid form. Although I did play with the settings for quite a while, I wasn't able to get it work, and didn't find anything else on the web that fixed the problem.

Any advice would be much appreciated!


texts: Where do i enable caching for drupal 7 panels data for Logged in Authenticated users?

texts: For drupal 7 panels where do i set the settings to enable caching for logged in authenticated users?


texts: Drupal Commerce Entity Query Line Item Prices

texts:
I'm working on a Drupal module that needs to access the line items in a Drupal Commerce Shopping Cart. On most carts, there is a "line items" table of some sort that is linked to the cart via an unique cart id.

However, Drupal Commerce uses "Entities" which effectively obfuscate the relationship between the shopping cart id, the line items, the products and their prices. If you've played around with it at all, then you understand my pain when seeing the "revision" tables and how the data could exist in one of a dozen tables and requiring complex joins that would break if (when) the client upgrades their Commerce module.

I know there is a way to query entities, but I haven't found adequate explanations for using those queries with Drupal Commerce to allow me to pull line items and pricing from a cart. I keep running into Ubercart documentation which is close, but doesn't use entities.

Does anyone know where there is documentation on doing Entity queries (particularly with Drupal Commerce)? Better yet, do you have a query in your pocket that can pull cart contents, and line item pricing?


texts: Upgraded Contrib modules & Drupal to 7.14 now SSL doesn't turn green

texts:
I'm using the latest D7 & securepages. When I took over this website from the previous developer, they had the problem that when they would update "anything" (according to them) it would break the SSL. I didn't believe them, so I cloned the site to a sub domain and updated everything. It still worked. My pages in the shopping cart turned into HTTPS, so everything was good. The only problem is that now the browser address bar doesn't turn green (still HTTPS, though) even though we are paying for an extended validation cert. So now the boss is asking why it doesn't turn green.

I checked the certificate and got the following:

Website: www.[site].com <- this is correct
Owner: This website does not supply ownership information.
Verified by: Not specified

This wouldn't happen prior to the update. What is causing this and how can I fix it?

I was able to get a full SSL connection again. It was one of my images that I manually edited in one of my template files. So now that I have a full SSL connection again, I guess the question has changed slightly to: Why isn't it green? The only thing I notice when checking the cert is that it shows: This website does not supply ownership information.

For anyone else encountering this issue with secure pages: In your settings file, make sure that if you have redirections to www.example.com or example.com, and that you have your $cookie_domain set properly.


texts: How to change default registration form?

texts:
By default, user registration form in Drupal 7 takes 2 fields: "Username" and "Email."

I want users to set their password directly upon Registration.

Take 4 fields:
- Username
- Password
- Confirm Password
- Email

How can I do so?


texts: How do I auto generate products via attribute?

texts:
I have a shoe store, as you know, Drupal Commerce allow us to control each Attribute of Shoe like Color and Size.

This is my problem :

I have 2000 shoe styles, each style has sizes from 5-12 (6US to 12US)
It mean that everytime I add new style, I have to create 8 products for 8 sizes. Im using Clone Product Module, it's working very well, but how can I save my time :

It mean that when I create New Shoe Style (Node Products Display)
--> node/add/shoe-style
--> the system will auto generate 8 products (Size) for me, it depend on how many value in my attribute field (Size attribute has 8 value and system will create 8 new product), and now what we need to do is update something to each product.


texts: How do I further expand my restored principal menu?

texts:
By mistake I eliminated the entire principal menu.

I already restored it but it appears with all the sub menus.
I need to change it but I don't know how to make the expanding menu.


texts: Creating an external authentication module

texts:
In Drupal 7, is it possible to make a module that handles user authentication without using the user_external_login_register method?  (In other words, without saving the user in the Drupal database?)

Of course, Drupal will need the uid of the logged-in user, so my guess would be that this would be pretty hard if not impossible.

It would also require Drupal to do its checks on this external source every page load. So, would this require hacking the User module, or making something similar? Is that even possible?


texts:
$result = $query->entityCondition('entity_type', 'node')

    ->entityCondition('bundle', 'mypage')
    ->fieldCondition('field_mymodule_module','tid', 123,'=')
     ->execute();

  $nids = array_keys($result['node']);

  $or = db_or();

  foreach($nids as $nid)

    $or->condition('m.entity_id', $nid, '=');

  $query2 = db_select('metatag', 'm')

    ->fields('m', array('entity_id', 'revision_id', 'language', 'data'))
    ->condition('m.entity_type', 'node')
    ->condition($or)
    ->orderBy('entity_id')
    ->orderby('revision_id')
    ->execute();

  while ($record = $query2->fetchAssoc()) {

dpm($record);

    }

As you can see in above code, I'm trying to get metadata information of each node. Getting nids of them turns out to be easy. However, when I use those nids to retrieve metadata, I get so many identical ones. That problem persists even after I removed "or" statement from the db_select and hard-coded entity_id, it returns like 10 identical records. Can anyone shed a light on the problem and where I am doing wrong here?


texts: Which module (not library) works best in Drupal 7 (they support corresponding libraries), labjs or headjs? Which is one better written, tested, and with less bugs?


texts: Newly created fields are not being displayed

texts:
I have a content type "Article" with fields and data that was migrated from a Drupal 7 website.

In the admin/structure/types/manage/article/fields I added a new text field called "Test" with default value some of some HTML added.
Then, I went to manage form display and disabled that field from the form
Then I went to manage display of the appropriate view mode and enabled that field.
Flushed the cache

Reloading the article page doesn't display the newly added field. I believe it is because there is no value in it, but shouldn't adding a default value to the field pre-populate that field for all previous content belonging to that content type? Or am I missing something here?


texts: Send an email via mailchimp in drupal to a userlist created in views

texts:
I want to give my client the possibility to send an email to a self-composed userlist. Preferably I want to direct the client to a (views) page where he can compose this list based on a couple of exposed filterfields (role, location etc)

Is it possible to compose a userlist via views and hand this over to mailchimp with mailchimp?

Thanks in advance


texts: Can I create an aggregate view that only shows totals without details?

texts: I have a view that totals columns but displays each row as well as the totals. Is there a way to hide the detail rows?


texts: How to make a node appear across *all* Taxonomy terms?

texts:
I am creating and classifying nodes by:

A main taxonomy
A secondary geographic location taxonomy

I created a View for the display of these nodes. It accepts a term ID from the main taxonomy via URL, and provides a Hierarchical Select "exposed filter" for further filtering by geography within the displayed nodes.

I notice that if a user does not select any location from the exposed filter, all nodes from across the world are displayed. But when I select USA, only USA nodes are displayed.

That is the desired behavior, however, I need to create some nodes that have "Worldwide" scope, and appear in the view even when the geographical filter is activated. It would be a great hassle to create nodes for each and every location.

I could hardcode this in some way: I even considered a separate taxonomy of worldwide nodes, and creating a block which is always displayed on top of the filtered results. But the problem with this is that the order of node-creation is also important, and my solution would appear disjointed.

Any ideas to nudge me in the right direction would be greatly appreciated.


texts:
Does any one know how Drupal 8 picks up theme template file? I mean in source code.

I have module which use a custom template file for a custom block , but the custom template file was not been picked up.

I have tried many different ways, but none working, so I have decided to looking Drupal 8 source code to find out , but I am unable to find out exact source code that picks up the theme template file.


texts: how to open a link field in new window in view

texts:
In views,for image  field, I have selected "output this field as link" and in link path, I wrote "node/[nid]". Link works and open in same window. How to open the link in a new window? I dont see any option in view.

Thanks


texts: I've written a custom installation profile.  When running install.php for the first time to install it, I have to select the installation profile I want to use.  I then select mine and run the install profile, no problem.  However, my client wants to be able to use the profile I put together as the default installation profile and skip that first step entirely (selecting an install profile).  How can this be accomplished?  Simply setting it as the default selected profile is not enough.


texts: Step back button for Commerece offsite payment method

texts:
I'm writing an offsite payment method for Drupal Commerce (I need that to interact with my bank API). The thing is that when I create a form to send to payment server via PAYMENT_redirect_form I have the only button - SUBMIT there. I want to add one more button there - smth like GO A STEP BACK to return to checkout state. So, i've created one more button, but it performs the same action as SUBMIT - goes to payment server... I think i'm missing smth very simple, but how can i make that one more button in payment submition form to perform a step back like those we have in checkout proccess?

Will be very thankful for your advice :)


texts:
I'm looking for a way to theme the inner fields of field collection. Does anyone know, how to do that?

Currently the template output is like this:

        ... the field collection ...

but as you can see, there are now two ids with the same name


texts: Drupal Search- Linking Multiple Entities with Relations as a Single Unit

texts:
I've got a site that currently uses Views exposed filters for search.  I'm looking at other search solutions for Drupal in an attempt to make more complicated searches possible.

The searches on my site are of users, but the catch is that each user, in addition to a user profile, has four nodes of four different content types connected to that profile with relations (from the Relation module).  These four nodes should also be considered part of the user profile.

In Views, I handle this by adding the four relations to the view, which allows me to pull the four pieces of content into the view.  My question is, is there a way to use Search API (with or without Solr) to link each user profile with its content based on the relations?  Or is there another search solution for Drupal that can accomplish this?

I don't need a step-by-step tutorial; I just want to understand whether it's possible to use relations from the Relation module to link entities (nodes and users) as a single "unit" in search in Drupal.


texts: how can I use jquery autocomplete in drupal 7

texts:
I want to use jquery autocomplete jquery plugin, I test below code but nothing happend, I check, the file added correctly and there is not js error.

function imodbdev_form_alter(&$form,$form_state,$form_id){
  if($form_id='movie_node_form'){
      drupal_add_library('system', 'drupal.autocomplete');
      drupal_add_js(drupal_get_path('module', 'imodbdev') . '/js/jquery.livequery.js', array('scope' => 'footer'));
      drupal_add_js(drupal_get_path('module', 'imodbdev') . '/js/imodbdev.js', array('scope' => 'footer'));
  }

}

and  js/imodbdev.js file

(function($) {
    Drupal.behaviors.imodbdev = {
        attach: function(context) {
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$( "#edit-title" ).autocomplete({
source: availableTags
});
        }
    }
})(jQuery);

I had install jquery update module and set jquery version to  1.8 .
where is the problem?

update

after sometimes I type in textfield to test , I saw TypeError: c.curCSS is not a function in firebug, I search this error in google and suggestion in upgrade jquery ui  to 1.9.3  but drupal not has version higher than 1.8.


texts: Empty title on one View based on Taxonomy Terms

texts:
I'm struggling with a couple of pages that won't propagate a page title.  Because the view is based on Taxonomy Terms I want it to change the page title to the taxonomy term it's using. I've spent hours going through different drupal blogs etc to try and trouble shoot the problem but nothing's working.  The site is www.skyviewelectronics.com and the problem pages are all the pages that use the collection Taxonomy Terms:
/collection/cables-and-connectors
/collection/cell-phone-signal-boosters
/collection/clearance
/collection/computer-software
/collection/computers
/collection/data-storage-and-backup-drives
/collection/hd-tv-antenna-accessories
/collection/hd-tv-antennas
/collection/high-speed-internet
/collection/networking
/collection/notebook-bags
/collection/protection-and-cleaning
/collection/security

I've turned off the Metatag View module since some people report that is a problem.
Here is the options for my view:

Here is the options I have for the contextual Filter under content: has taxonomy term ID (with depth)  - I've also tried without depth, and many many many other combos...

Can anyone help??


texts: What is the form ID of a submitted Webform to perform a custom redirect?

texts:
Once the webform is submitted, I need it to be redirected to edit form page where user can edit that form again.

I know is at webform->components->form settings and choose custom redirect. What is the value I should key in (since form ID is always different)?


texts: From single site to multi site of an existing site broke all pages images

texts:
I had a single site that is running in prod. We wanted to use the multi site feature of Drupal 7 because a few site will be using the same core code. So I moved the default/files/ to mysite.com/files like it was suggested. I created a settings.php that point to my existing DB. Everything worked fine until I reach a page that was created from the CMS and pointed to images in the default/files/ folder.

I understand that somewhere I need to change the image source paths from default/files to mysite.com/files but I can't find where. I find a lot of examples like this one stating that I need to run a sql script in the files table. The thing is, there is no files table... I figure it must be for Drupal 6 or older. I am on Drupal 7 and can't find where to change the images path. I found a table called file_managed which looks like the right place but all uri are ex: public://folderUnderFiles/image.png. There must be a way to change the public:// to point to my new folder!


texts: Entity:media doesn't exist error when searching for url in "add link" in wysiwyg

texts:
When adding a link into a rich text field (wysiwyg) (see images bellow) and searching for a keyword the throbber icon keeps spinning and that's it.

I looked at the error logs and found the following, this was working recently, no idea what happened.

Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginNotFoundException: "The "entity:media" plugin does not exist. Valid plugin IDs for Drupal\linkit\MatcherManager are: entity:contact_form, email, entity:contact_message, entity:feeds_feed, entity:node, entity:scheduled_update, entity:taxonomy_term, entity:user, entity:file, front_page"

If anyone has an idea what happened?
Drupal 8.7.3


texts: Drupal 7 - access to page content in template.php

texts:
In Drupal 7 I'm trying to access the body field of a page from template.php. I want to find a keyword in the text and then send subsequent text to a separate variable so that I can format it in page.tpl.php

I can access the node using
    $vars['node']
but can't find a way of accessing the content part of the node.

I can access the content in page.tpl.php using:
    $node->body[$node->language][0]['value']
but cant use the same or similar syntax in template.php


texts: How to natural sort by text fields in Views?

texts:
I'm trying to sort a view by a text field. The text field include numbers, in general.

While sorting it sorts as below:

1
10
11
2
20
...

But I want to make the sorting natural.

The Views Natural Sort module doesn't work, it only works with the Title field, unfortunately (there was some options to sort text fields before but now there isn't any option for this).

How can I natural sort the view by text field? And use the table sort asc/sort desc feature?

(The field should be text field and couldn't be an integer field.)


texts: Error after updating core from 8.6.2 to 8.7.14

texts:
After I have updated my Drupal core version from 8.6.2 to 8.7.14, I have got below error at the time of cache clear and db update.
Below error occurs while running update.php
An AJAX HTTP error has occurred. HTTP result code: 200 Debug information follows.
Path: /update.php/start?id=55&op=do_nojs&op=do
Status text: OK
Answer text: ArgumentCountError: Too few arguments to function Drupal\Core\Entity\EntityTypeManager :: __ construct(),
5 passed and exactly 6 expected in Drupal\Core\Entity\EntityTypeManager->__construct()
(line 92 of C:\myproject\html\core\lib\Drupal\Core\Entity\EntityTypeManager.php).

This error occured at the time of cache rebuilt (Drush cr)
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Drupal\Core\Entity\EntityTypeManager::
__construct(), 5 passed in C:\myproject\html\core\lib\Drupal\Component\DependencyInjection\Container.php on line 285
and exactly 6 expected in C:\myproject\html\core\lib\Drupal\Core\Entity\EntityTypeManager.php:92

I didn't find any core patch or any other solution.
Any help?


texts: How to allow my view to display duplicate results for the title field?

texts:
In a content pane view i have excluded my title from the display.
Instead i have grouped the title under fields configurations.

My problem is that for some reason my view isn't allowing any duplicate results for the title.
I have made sure that under query settings the distinct is unchecked.

What other setting could cause this behaviour?


texts: How to supply hidden field value to node based on webform?

texts:
Using D8 to create a node based on a Webform named "White Paper". I have a hidden field on the webform named white_paper_title.

When creating a node based on this form, I've added the following in the Default webform submission data field, like so:

white_paper_title: 'something'

This works fine if I base the new node on Webform, and select "White Paper" from the list.

The problem is that it never works when I create a new content type based on the White Paper webform. When viewing the node in the browser, the hidden field is there, but the value is never plugged in. How do I get this working?


texts: Security issues concerning including external code for module

texts:
I would like to implement some external code in my custom module and if I understand correctly (correct me if I'm wrong), you can drop those folders in both sites/all/libraries as well as in sites/all/modules/custom/myModule/libraries.

What would the better security-wise place to include the folder be?

If you can think of another reason why to place it in the first folder or the second, I'm happy to hear it.


texts: Limit Entity Reference to published nodes

texts:
Here is a content type structure called Bill :

  Bill_ID => Int
  Bill_Date => Date
  Services => Entity Reference (Target Type : Node , Target Bundle : Service , Widget : Auto-complete)

The only problem is that the end user shouldn't be allowed to make a reference to an unpublished Service.

So how can we limit user to only make a reference to published contents ?


texts:
First of all. Are

$ent = Drupal\custom_entity\Entity\MyEntity::load(1);

and

 $ent = \Drupal::entityTypeManager()->getStorage('custom_entity')->load(1);

the same?

Also I know that
\Drupal::entityTypeManager()->getStorage('custom_entity')->load()
is getting cached.

When I talk directly to the class's load function also?

Thanks


texts: Problems moving whole project from one directory to another

texts:
I have Xampp Portable installed on Windows 10.

I run about a dozen Drupal, Wordpress and other CMS on there. I can move the whole stack to different drives and machines and it all works perfectly, only one that can't work is D7/CIVICrm install.

When I move it to another directory I get this error:

 Fatal error: Cannot redeclare class CRM_Core_ClassLoader in C:\Core\XAMPP_2018\htdocs\crm4\sites\all\modules\civicrm\CRM\Core\ClassLoader.php on line 36

I can see that the path in the error is the wrong path.

The correct new path is:

G:\XAMPP_2018\htdocs\crm4

And not:

C:\Core\XAMPP_2018\htdocs\crm4\

As stated in error, where should I go change that setting? In what file/directory?


texts: views filter: broken filter - but what's broken about it?

texts:
I am trying to build a views filter and after a lot of digging into the views-workflow, I think I might have understood the basics. I used a lot of resources 1 2 3 4 and of course doc.logrus.com, but now Views tells me that my handler is broken.

If there is anybody outhere that can help me get my filter-handler working, I would be in a huge debt!

Right now I have the following three files:

ds_regions.module

function ds_regions_views_api(){
  return array(
    'api' => 3,
    'path' => drupal_get_path('module','ds_regions')
  );
}

ds_regions.views.inc

<?php
function ds_regions_views_handlers() {
  return array(
    'info' => array(
    'path' => drupal_get_path('module','ds_regions'),
  ),
  'handlers' => array(
    'ds_regions_handler_filter_view' => array (
      'parent' => 'views_handler_filter',
      ),
    ),
  );
}

function ds_regions_views_data(){
  $data=array();
  $data['node']['ds_regions_filter']=array(
    'title' => t('ds regions view filter'),
    'help' => t('Filters the nodes by region'),
    'filter' => array(
      'handler' => 'ds_regions_handler_filter_view',
    ),
  );
  $data['field_data_field_verein']['table']['join']['node']=array(
    'left_field' => 'nid',
    'field' => 'field_verein_tid',
  );
  $data['ds_vereine']['table']['join']['node']=array(
    'left_field' => 'field_verein_tid',
    'left_table' => 'field_data_field_verein',
    'field' => 'tid',
  );
  return $data;
}
?>

ds_regions_handler_filter_view.inc

<?php
class ds_regions_handler_filter_view extends views_handler_filter{
  function admin_summary(){}
  function option_definition(){
    $options = parent::option_definition();
    $options['misc'] = array('default' => '1');
    return $options;
  }
  function value_form(&$form, &$form_state) {
    $form['custom_filter']  = array(
      '#type' => 'textfield'
    );
  }
  function options_form(){}
  function operator_form(){}
  function query(){
  $table = $this->ensure_my_table();
  $this->query->ensure_table('ds_vereine',$this->relationship);
  $this->query->add_where($this->options['group'],"ds_vereine.plz IN (SELECT ds_plz_distance.plz_first FROM `ds_plz_distance` WHERE ds_plz_distance.distance < 20 AND ds_plz_distance.plz_first=ds_vereine.plz) OR ds_vereine.plz IN (SELECT ds_plz_distance.plz_second FROM `ds_plz_distance` WHERE ds_plz_distance.distance < 20 AND ds_plz_distance.plz_second=ds_vereine.plz) OR ds_vereine.plz IN (SELECT ds_plz_ort.plz FROM `ds_plz_ort` ort WHERE ds_plz_ort.kreis=306)");
  }
}
?>


texts: How to change a node add form without changing the node edit form

texts:
I'm using drupal 7

I'm writing a custom hook_form_alter something like this

function mymodule_form_alter(&$form, &$form_state, $form_id){
    if($form_id == "rating_node_form")
        {
            // Do something
        }
}

it seems that both the node add form and the node edit form are using the same form ID. I'm wondering if there is a way to determine weather you are editing or adding a node and make changes to the form accordingly. Do they always have to be the same exact form?


texts:
drupal 7 marinelli banner images not cycling (no forward or back icons either) I had disabled banner for a while and on trying to re-enable, images load but don't cycle.  my back up site works but main site is too far changed to restore from months ago.
I have tried removing and re-installing theme.
where does the theme store settings?
What can I do?
Thanks
Mick


texts: Make private pdf files Non-Downloadable via absolute url links

texts:
In a content type I have option for pdf file upload, the uploaded files are stored in private folder.

The uploaded file has absolute url of http://example.com/system/files/abc.pdf

At the moment anyone with the absolute url can download the file (no matter the user roles, access and permissions)

I want to redirect visitors to the front page of the website (instead of downloading) if they use the absolute url of pdf in browser to download it.

So far I tried something with JavaScript something like:

$(document).ready(function() {
  if(window.location.href.indexOf(".pdf") > -1) {
    $(location).attr('href', window.location.protocol + "//" + window.location.host); // Redirect to front page
  }
});

Usually this would do the trick if it was rendered webpage where javaScript is loaded, but it doesn't work with pdf files (as javaScript is not loaded while clicking the absolute url of the pdf file).

I have already tried private files download permission module, but that doesn't do what I want, as my downloadable links are accessible to Anonymous users as well.

Any hints, suggestions, how to accomplish this?


texts: Are Wysiwyg and CKEditor modules incompatible now?

texts:
Apologies if this question has been raised elsewhere, but I couldn't find anything directly related to it.

I'm in the process of setting up my first Drupal site. I want to be able to include images in the body of posts but without turning on "full HTML". Chapter 4 of Using Drupal (2nd Edition) describes a way of doing that involves using both the Wysiwyg and CKEditor modules.

However, when I install the latest versions of both modules (Wysiwyg: 7.x-2.2; CKEditor: 7.x-1.13), I get the following message on the CKEditor configuration page:

  "The WYSIWYG module was detected. Using both modules at the same time may cause problems. It is recommended to turn the WYSIWYG module off (click here to disable)."

If I ignore the message and try to configure Wysiwyg I get the following message:

  "The version of CKEditor could not be detected.
  Extract the archive and copy its contents into a new folder in the following location:
  sites/all/libraries/ckeditor

  So the actual library can be found at:
  sites/all/libraries/ckeditor/ckeditor.js"

But ckeditor.js is saved in the above directory.

I've tried installing other editors besides CKEditor (e.g., TinyMCE), but I get a similar result.

I've got CKEditor installed and working fine, but it only generates HTML code, not tags that the Media module can process. Consequently, images only appear in "Full HTML" mode, not in "filtered HTML" mode.

I'm really interested in finding out how can I include images in posts using filtered HTML mode (either by using CKEditor/Wysiwyg or by some other method). Very grateful for any suggestions.


texts:
I've recently upgraded from Drush 8 to Drush 9. In Drush 8, I use drush @project.local.sitename status; in Drush 9, I have to run drush @project-local.sitename status.
How can I replace the hyphen with a dot just like the command in Drush 8?


texts: How to unlink an active module from available-update-checks?

texts:
I am using a deprecated version of a module which I customized somehow.

How to exclude an active module it from "available updates" checks without breaking stuff? It's because I always get the warning "Not supported" and I simply want to surpress it.


texts: I was testing with rules and now I got around 50 rules. Just wondering if Is there any way to bulk delete rules and components


texts:
I'm trying to define a compound key for a custom database table.

My first insert goes through OK but the following inserts fail because the PID value is the same.

What I'm trying to achieve is a state where the uniqueness of each insert is determined by a combination of the PID, QID and UID values of each insertion.

The following is my schema in my install script:

function module_schema() {

  $schema = array();

  $schema['module_records'] = array(
    'description' => '',
    'fields' => array(
      'pid' => array(
        'description' => 'PID',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => 'User ID',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'qid' => array(
        'description' => 'QID',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'first' => array(
        'description' => 'First option',
        'type' => 'text',
        'length' => 255,
        'not null' => FALSE,
      ),
      'second' => array(
        'description' => 'Second option',
        'type' => 'text',
        'length' => 255,
        'not null' => FALSE,
      ),
    ),
    'primary key' => array('pid'),
    'indexes' => array(
      'uid' => array('uid'),
      'qid' => array('qid'),
    );

  return $schema;
}


texts:
I have write sql query in drupal looks like this.

Let's assume today's date is 2013-07-24 and total of node is 4.

    $query = "SELECT COUNT(*) amount FROM {node} n
              LEFT JOIN {flagging} f ON n.nid = f.entity_id AND f.fid = '1'
              LEFT JOIN {field_data_field_tarikh_tamat_passport} ttp ON n.nid = ttp.entity_id AND (ttp.entity_type = 'node' AND ttp.deleted = '0')
              WHERE (( (n.status = '1') AND (n.type IN  ('data_pekerja')) AND (ttp.field_tarikh_tamat_passport_value > CURDATE()) AND (f.uid IS NULL ) ))";
$result = db_query($query)->fetch();
print $result->amount;

The output of code above is 3 but with this code below is 1

 $query = "SELECT COUNT(*) amount FROM {node} n
                  LEFT JOIN {flagging} f ON n.nid = f.entity_id AND f.fid = '1'
                  LEFT JOIN {field_data_field_tarikh_tamat_passport} ttp ON n.nid = ttp.entity_id AND (ttp.entity_type = 'node' AND ttp.deleted = '0')
                  WHERE (( (n.status = '1') AND (n.type IN  ('data_pekerja')) AND (ttp.field_tarikh_tamat_passport_value > '2013-07-24') AND (f.uid IS NULL ) ))";
    $result = db_query($query)->fetch();
    print $result->amount;

The different of this sql query is only the value of CURDATE() and '2013-07-24'

Can you please explain why the output is different? I need the query to displaying total of node that has date field value greater than today.


texts: How to automatically put your site into maintenance mode if at least a critical security update is available?

texts:
I think I'm craving for this functionality.

What I want is, if after a CRON run, Drupal detects that such a security update is available, the site would be taken down for maintenance mode to avoid potential attacks. Well, quite paranoid here. It would be better if Apache can be made to serve a static page from another folder.

I have a vague idea in my mind that we can use drush in this. However, I can't think of how Drupal can "tell" some daemon/service or run some script if the trigger (critical security update available) is uhm, triggered.

I can't seem to find any solution to do this thing, so far. Do you have any suggestions?


texts: use-ajax Class does not work if used in multiple views?

texts:
What seems like a pretty straight forward implementation of ajaxifying a link is not working if I use it in more than one view block on the page.

I have a route that calls a function. In my view I have simple links that hit that route such as:

Delete

Here is the Controller

  public function DeleteEntityParagraph($pid) {
    $response = new \Drupal\Core\Ajax\AjaxResponse();
    $response->addCommand(new \Drupal\Core\Ajax\AlertCommand('wtf'));
    // $response->addCommand(new InvokeCommand(NULL, 'refreshView', []));

    return $response;
  }

It all works fine. You click it, it throbs and returns the alert response. But then if I make another view block, with different content, and put it on the same page, the links on the second view do not use the ajax behavior.

The first views links will continue to work with the ajax behavior. If I remove the first view, the second views links will begin to work. Whichever view block occurs first is the only one with working ajax links.

Does anyone have any idea why this happens? Ive searched high and low. Found this issue but I don't think it is related


texts:
There is a requirement in my website: The post content should have a link (it is for IOS device to install apps) like the following.

Install APP

I used the Ckeditor and it can make it.

Is there any other ways to make it? I tried the Link module, but it failed.


texts:
I am trying to theme a block from my view.  I have a view called slides and it is creating a block.  I have a template file I want this block to use.  I have looked at the documentation for themes and the pattern to follow is

views-block--<viewname>.html.twig

or

block--views-block--<viewname>-displayid.html.twig

I can't find displayid for my block so I am trying to get that first option to work, but No matter what I do my block wont seem to take on the template I have written.

my template is named

views-block--slideshow.html.twig

What am I doing wrong with my names?


texts: Override _user_mail_notify() to NOT send email on user_save() if user status is changed

texts:
I have an external service registering and altering the status of Drupal users, performing user_save() on several occasions depending on the service response.
So i am blocking and unblockiing users and other operations.

My problem is i cant find a descent way to override this code inside user_save()

// Send emails after we have the new user object.
if ($account->status != $account->original->status) {
 // The user's status is changing; conditionally send notification email.
 $op = $account->status == 1 ? 'status_activated' : 'status_blocked';
 _user_mail_notify($op, $account);
}

ideally i would like to have full control on what is going to be sent depending on user role, the account status etc. say for example

// pseudo code
if (user_is_external and statusChanged){
  dont send email
} else {
  send_email
}

Is this possible?
thanks


texts: Edit button on the top right menu disappeared, how can I get it back?

texts:
Put my website in development mode in the past but I'm having a hard time finding the setting to re-enable the in field editing of nodes.

Which configuration setting is responsible for toggling the edit button in the top right corner and the pencil icon on blocks and content?

Edit:

I found out there are many javascript errors, check the screenshot here.


texts: Add current user name beside Logout in admin menu

texts:
This is my backend style

What is the correct way/Hook to add the username beside logout word?


texts:
I created a custom theme (a sub-theme of Radix base theme).

I am loading a custom Javascript file (radix_sub.script.js) using the module libraries.yaml file like below:

style:
  version: VERSION
  css:
    theme:
      assets/css/radix_sub.style.css: {}
  js:
    '//cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js': { type: external }
    '//stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js': { type: external }
    assets/js/radix_sub.script.js: {}
  dependencies:
    - core/drupal
    - core/jquery
    - core/jquery.once
    - core/drupalSettings

In that file, I want to register some JavaScript events (Bootstrap modal).

(function ($, Drupal) {

  Drupal.behaviors.portfolio = {

    attach: function (context) {

      console.log('CONTEXT', context);

      $('#portfolioModal', context).once('bootstrap-modal-shown', console.log('*** REGISTER SHOWN.BS.MODAL')).each(function () {
        $(this).on('shown.bs.modal', function () {
          console.log('SHOWN BS MODAL EVENT TRIGGERED');
        });
      });

      $('#portfolioModal', context).once('bootstrap-modal-hidden', console.log('*** REGISTER HIDDEN.BS.MODAL')).each(function () {
        $(this).on('hidden.bs.modal', function () {
          console.log('HIDDEN BS MODAL EVENT TRIGGERED');
        });
      });
    }
  }
}(jQuery, Drupal));

It works. I see both SHOWN BS MODAL EVENT TRIGGERED and HIDDEN BS MODAL EVENT TRIGGERED logs when I show/hide the modal.

First, am I doing that the correct way?

This is what my developer console looks like when I load my page.

This happens only when I am logged in (as admin). When I am anon, I see the REGISTER logs only once but here my code seems to be executed 11 times.

Is this normal behavior? And/or why is it doing that?


texts: Compare specific fields of two nodes side-by-side

texts:
I have a content type consisting of 15 large text areas fields.

I would like to be able to select specific fields (or maybe just one for start) and review the content of two nodes side-by-side with the selected fields aligned horizontally (in a table maybe). Also these fields should be available for inline edit using the Editable Fields module, so I need this to be done inside a view which would allow me to use the editable field formatter.

I've checked the Node Compare module which is great, but it doesn't allow the user to check which fields he'd like to review side-by-side. I need to be able to filter those by exposed filters or something. Furthermore Node Compare uses a custom view that doesn't allow me to use the editable formatter.

Any ideas how could I achieve this?


texts: How to use hook_menu to create wildcard aliases to a normal node page

texts:
I have a node template where I check the url for the existance of some parts and play with that, eg, if the node is called your/recipies, I catch urls like

/your/recepies/bananas
/your/recepies/apples
/your/recepies/oranges

and check the url for bananes,apples,oranges in the template.

I used aliases to point those urls to the original node, but they keep on dissapearing. It's probably be a breeze to set up a module router, like

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

        $items['your/recipies/%'] = array(
            'title'  => t('Recipies'),
            'page callback' => 'drupal_magic',
            'page arguments' => array('your/recipies')

        );
 }

to make drupal just render the node (and not redirect somewhere).
however, i cant find out what to write instead of drupal_magic.

(recipies, if you must know, is a webform; not something i can easily generate myself)


texts:
I'm trying out the built in test driven development method in Drupal 8 but I'm running in to a problem..

I'm getting the following errors when trying to run ./core/vendor/bin/phpunit --list-groups ./modules/ in my cli:

  PHP Fatal error:  Class 'Drupal\Tests\UnitTestCase' not found in
      /Applications/MAMP/htdocs/drupal/modules/custom_cookie_compliance/
      tests/CustomCookieComplianceTest.php on line 10

  Fatal error: Class 'Drupal\Tests\UnitTestCase' not found in
      /Applications/MAMP/htdocs/drupal/modules/custom_cookie_compliance/tests/
      CustomCookieComplianceTest.php on line 10

I have created a module folder called custom_cookie_compliance in my modules folder. In turn I have a custom_cookie_compliance.info.yml file containing the following.

 name: Custom Cookie Compliance
 description: Displays a cookie compliance information window at the top of the website.
 core: 8.x
 type: module

I also have a tests folder containing a src folder which then contains a CustomCookieComplianceTest.php file with the following code.

<?php
namespace Drupal\custom_cookie_compliance\Tests;

use Drupal\Tests\UnitTestCase;

/**
 * @group cookie
 */

class CustomCookieComplianceTest extends UnitTestCase {
  public function testSetCookies() {
    if (!isset($cookie_set)) {
      $cookie_set = TRUE;
    }

    $this->assertTrue($cookie_set);
  }
}

I have written the code by following this guide.

I understand it can't find the UnitTestCase class, but the guide says that is should work, so why isn't it?


texts: Cron error message. table or view not found: 1146

texts:
In watchdog I am seeing an error when cron is run.

  Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'tdtvnksvps.field_deleted_data_38d3088921' doesn't exist: SELECT DISTINCT t.entity_id AS entity_id FROM {field_deleted_data_38d3088921} t WHERE bundle = :db_condition_placeholder_0 LIMIT 50 OFFSET 0; Array ( [:db_condition_placeholder_0] => ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->readFieldItemsToPurge() (line 1686 of /home/300465.cloudwaysapps.com/tdtvnksvps/public_html/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Pretty sure I mistakenly deleted a table from the database a while back and this is the result.

The issue appears to be similar to Error when deleting some node, but I think the advice given to find a record of the deleted field was written for D7.

Is this the same problem and how resolve it for D8?


texts: How to provide ubercart discount coupons only for specific users

texts: Anyone can say how to provide ubercart discount coupons only for applicable users and not for the other users ?. For example if a user from texas, then the admin can provide a coupon code only for that texas user and  it should not applicable for other out of texas users . please reply ASAP if anyone knows . thanks.


texts: How do I get Path Auto to display one value in the URL structure when node:field has multiple values?

texts:
Using path auto to create a url structure, I would like the following:

my-content-type/[node:field_restaurant_category]

Note that node:field_restaurant_category can have multiple values, and in my url structure this is unfortunately the case. I have a url now that is my-content-type/t1-t2-t3-t4-tetc

How can I limited the node:field_restaurant_category to be just one and only one term? I honestly don't care which term the module chooses so long as the limitation is in place.

I read earlier that something like node:field_restaurant_category:values:1 should work, or something, but I cannot get any logical configuration of that to work correctly.


texts:
I'd like to have a header with PNG files, that are clickable.

I am using Drupal 7 and Omega Theme.

In the Omega default.css, I've added the following:

.branding-data {

    height: 250px;
    background-image: url('../images/slideheader1-object1441486291.png'),url('../images/slideheader1-object1068949429.png'),url('../images/slideheader1-object1159417376.png'),  url('../images/slideheader1.jpg');
        background-size: 100% 23.2%,49.55% 99.6%,39.51% 100%,  100%;
        background-position: 0px 192px,292px 4px,505px 0px,  0 0;
    background-repeat: no-repeat;}

It adds the images to my header. One of these should be a link to another page.

How can I do this?


texts:
I have two related views to display pictures in a gallery.
The first created view is "gallery" which display small pictures using

Responsive_grid format
Filter on a field category
24 items/page

The second created view "gallery_details" use the same filter, only one item by page, and a large picture of the same content type.

I would like to link all pictures from the first view (gallery) to the corresponding one in the second view (gallery_details).

Do I have to create a specific module to do that? I try to find a solution using this but not sure that is the good way to do it.

The idea is that both views will have the same number of results, and each item of the first view result correspond to a page of the second view (because we display 1 item/page). Also it should be possible for example on the third item to add
 ...

 around it.

To simplify I also use the module views-fieldsets to group text fields in a
 that should be the one to link to the gallery_details item/page.


texts: How to display a message on login until a user fills out a specific Webform?

texts:
Relevant modules installed:

Rules.
Webform.
Webform rules.
Conditional rules.
Permissions per Webform.

What I have tried:

Rule 1: activates on user login that displays a system message.
Rule 2: activates on Webform submission with the condition that the Webform's name is the required name. The rule executes PHP code to disable Rule 1 if true.

/**
* Implements hook_update_N().
* Disables name_of_rule rule.
*/
function hook_update_N() {
  $rules_config = rules_config_load('name_of_rule');
  $rules_config->active = FALSE;
  $rules_config->save();
}

However, this set of rules is NOT working at the moment.

Concerns:

If Rule 1 was working, how do I ensure that it permanently disables Rule 1 per user, and not globally?
Is there a better way to do this?
For example, all I should need is one rule: On user login + if a Webform has not been filled out, display a message. However, I have not been able to find a module that adds the "If Webform has not been filled out" rule.


texts:
I am using Drupal 7 and I have a view displaying the Updated date.
Unfortunately, the Updated date changes every time I save the node, even if no changes are made.

How can I configure the Updated date to be changed only if changes in fields are made??

P.S: I tried with "Rules", setting as action "Set a data value" and Data selector "node:changed", but it shows me this message: "The selected data property doesn't support writing."


texts: How to get services post data(json format) callback function?

texts:
I am using services module and rest API its working fine.

But i need to create a menu callback where i get the json post data and save in database.

How to get the json data in menu callback?


texts: What effect does BigPipe have if my traffic is mostly anonymous and I'm serving unpersonalized content behind varnish?

texts:
I've looked into this before and I swear, though I can't seem to find any documentation to confirm it now, that I read BigPipe only helps performance for authenticated users. (Note: I'm sure I'm just misremembering.)
I think this was due to the fact that anonymous users don't have regular sessions. I'm having trouble tracking this down too, but I did find the following quote:

If you run that chunk of code from the preceding section as an anonymous user, you'll note that the entry gets created in the database with a session ID, as expected. However, upon the next request, if you try to retrieve the value by key, you won't find it. That is because anonymous users do not necessarily have a session started. This means a new session ID is created for each request.

Anyway, my understanding is that the Sessionless BigPipe module fixes any issue with anonymous traffic and ensures that BigPipe will have an impact for those users.
On the Sessionless BigPipe module's project page I see:

This module uses BigPipe to accelerate the first unpersonalized response! And after that first response is sent, the response is stored in Page Cache. Which means that any subsequent requests for that unpersonalized page will be answered very quickly by Page Cache!

Does this mean that when a page is flushed from cache (Page Cache and Varnish) I'll see something like the following chain for subsequent anonymous requests for that same page?

First request: Varnish miss, Drupal Page Cache miss, BigPipe builds the page (This is the one case where BigPipe would have an impact)
Second request: Varnish miss, Drupal Page Cache hit, Drupal Page Cache serves the page
Third and all subsequent requests: Varnish hit, Varnish serves the page

Edit: I now see that this is explicitly outlined further down on the project page:

So, when using Varnish: the first request will be streamed by BigPipe, and not cached in Varnish. The second request will be a Page Cache hit, not a Varnish hit. The third request and all later requests will be Varnish hits.

Additionally, why does the second request bypass Varnish?


texts:
I'm trying to get my users to post only once on each Product node... I'm kind of new to hooks and I'm not sure what else should I use for this.

What is the drupal way to do this?


texts: How do I reinstall the Forum module in Drupal 7?

texts:
I did something really stupid: I deleted the taxonomy_forum field (Forums) from the content type. Now I'm get all sorts of errors.

  PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'flo1121202154643.field_data_taxonomy_forums' doesn't exist:
  SELECT field_data_taxonomy_forums0.entity_type AS entity_type, field_data_taxonomy_forums0.entity_id AS entity_id, field_data_taxonomy_forums0.revision_id AS revision_id, field_data_taxonomy_forums0.bundle AS bundle FROM {field_data_taxonomy_forums} field_data_taxonomy_forums0 WHERE (field_data_taxonomy_forums0.deleted = :db_condition_placeholder_0) AND (field_data_taxonomy_forums0.bundle = ..........

How do I reinstall the Forum module in Drupal 7 from scratch (including recreating the database schema)?


texts:
How do I assign users to a group in Drupal 7? Basically I wanted to have following groups in my website.

Administrators
Content Writer and Publisher
Registered users

I wanted to assign all of the newly registered users to "Registered users" group automatically and I as a member of administrator should be able to assign some trusted users into "Content Writer and Publisher" group.

Each of these groups will have different-2 permissions as expected.


texts: Is there any Russification of the Simple MCQ Drupal 7 module? How to translate it?


texts: Develop new content type for xml to html translation (Drupal 6)

texts:
What I would like to achieve is the this:

Develop new content type
Add two fields to the content type : XML, XSLT,  /  text areas
When I use this content type later on I want to be able to paste some XML into the XML field, some XSLT into the XSLT field. When I save my new content I want the XML to be translated into HTML.

So in view mode I would always see the HTML, 'edit' mode would give me away of manipulating the XML / XSLT

I started following this tutorial: http://drupal.org/node/231019. But that does not cover how /where to save my new fields.
This is how far I got following the tutorial:

/**
* Implementation of hook_node_info().
*/
function xmlparser_node_info() {
  return array (
    'node_amlparser'=>array(
    'name'          => t('XML Parser'),
    'module'        => 'xmlparser',
    'description'   => 'This module takes XML and XSLT to generate HTML'
  )
 );
}
/**
* Implementation of hook_perm().
*/
function xmlparser_perm () {
  return array ('create xml content','edit own xml content');
}
/**
* Implementation of hook_access().
*/
function xmlparser_access($op, $node, $account) {
  if ($op == 'create') {
    // Only users with permission to do so may create this node type.
    return user_access('create xml contene', $account);
  }
  if ($op == 'update' || $op == 'delete') {
  if (user_access('edit own xml content', $account) && ($account->uid == $node->uid)) {return TRUE;}
  }
}
/**
* Implementation of hook_form().
*/
function xmlparser_form (&$node, $form_state) {
  $type = node_get_types('type', $node);

  $form['title'] = array(
    '#type' => 'textfield',
'#title' => check_plain($type->title_label),
'#required' => TRUE,
'#default_value' => $node->title,
'#weight' => -5
  );
  $form['xml'] = array(
    '#type' => 'textarea',
'#title' => check_plain('xml'),
'#required' => TRUE,
'#weight' => -5
  );
  $form['xslt'] = array(
    '#type' => 'textarea',
'#title' => check_plain('xslt'),
'#required' => TRUE,
'#weight' => -5
  );
  $form['body_filter']['body'] = array(
    '#type' => 'textarea',
'#title' => check_plain($type->body_label),
'#default_value' => $node->body,
'#required' => FALSE
  );
  $form['body_filter']['filter'] = filter_form($node->format);
    return $form;
}

So this brought me to the point that my content type comes up when creating new content - cool. But where do I need to go now to actually save my values? Where would I save my HTML once the XML is parsed on submit?

I know quite a few question, but any input would be great appreciated!

Thanks,
 Uwe


texts:
Module: Popups
Site: http://www.mastersfunds.com.php5-23.dfw1-2.websitetestlink.com/images/slide1.jpg
Read Me: http://www.mastersfunds.com.php5-23.dfw1-2.websitetestlink.com/README.txt

Brief: I need to add a popup form to the menu links STAY INFORMED on the top-right and sidebar menu. I tried the Popups module, which loads all of my sites pages blank/white when activated. I am using it, but I am not sure how to use it.

The README.txt file has 4 ways of adding it, and I would like to use the second method (adding "popup" as CSS class to an existing link), but I am unable to add a custom CSS class/ID to a specific menu item. Is there a module that can do this, or does anyone know a easy way to setup?


texts: Webform submission redirect to view with node ID

texts:
I have a view with table of data about a member of a sport club. I've placed a link to webform in the header that adds more rows into that view, which works fine but I'd like to redirect the form to go back to that view with person's ID as the argument/token.
To make it more straightforward: my view is /grade-details/%id, webform pickups the ID and inserts new data into right person table.

How can I make the redirection to go back to the view with same person details?


texts:
because I use a websevcice to manage my users, I need to override the user_pass() to send a new password via my webservices.
This is what i did:

/**
* Implements hook_validate()
*/
function beneficiaire_user_pass_validate($form, &$form_state){
    die('poc');
}

/**
* Implements hook_submit()
*/
function beneficiaire_user_pass_submit($form, &$form_state){
    module_load_include('inc', 'beneficiaire', 'ws');
    global $user;

    if(beneficiaire_reset_password($user->name)){
        drupal_goto('login');
    }
}

My module is named beneficiaire.
I've cleaned my caches many times
when I enter a username in the form, it returns me

  Sorry, %name is not recognized as a user name or an e-mail address

instead of

  poc

An idea ?

Thank you


texts: How to preload a css/js library programmatically after module installation? is there api for changing *.library.yml file?

texts:
i would like to develop a module where i cached internally html,css,js statically for pages.
1) in a admin setting page i can add a bundle with 1 html page + css/js files.
2) for each bundle i have different path
3) Normally in drupal8 i can define a file *.library.yml where i can set css/js but in this case is not defined statically when i install the module, but is changed every time in admin section i add a bundle.

Is there drupal API for loading programmatically the register where there are saved libraries and where i can change and save again the configuration? it is not possible do you have other suggestions?


texts: Creating event lists using nodequeue, static pages and dynamic dates

texts:
I'm new to Drupal, with some familiarity in other CMSes. I'm currently attempting to create a series of event lists, and have met up with a few issues. The number of modules available for the system are confusing my Googling, as terminology isn't uniform across the web and I'm picking up information for everything but what I want. From reading in StackOverflow, I gather it's a common problem with Drupal. I'm looking for recommended resources or perhaps more direct help - advice on whether to learn the system fully despite this being such a simple/small job would be useful as well.

In summary:

Need an online system to create itineraries, lists of events containing location information and dates that are specific to unique clients/users. Employees access the backend, assemble an itinerary and provide a link to customers with an appropriately formatted, final page/document. Drupal is a CMS that is potentially going to be used for a future website, and "location information" would be a duplication of web content - this system would make for a neat way of populating the website with content whilst the main frontend is being developed.

What I need

locations are created as static nodes (pages)
access the backend with an interface that allows for the selection of these location nodes and compiles them into an ordered list
each node, despite being static, is associated with a date field (start and end) specific to each ordered list
lists are unique and independent, using the same static content to fill description fields but able to be linked with specific date information

Where I'm currently at

locations are created as static nodes (pages)
the itinerary is a nodequeue, where an employee creates a new one, adds location nodes and can control the order without technical know-how
display using Views, using unique URL per list
trying to find a way to relate the unique nodequeue with a pair of dates for each location
been playing around with custom content types/custom fields, but don't know how to define the relationship between the static/dynamic content
using Date API for javascript calendar pop-up in these custom fields

Any help would be much appreciated! I've tried to word the concept clearly here, and am  looking for a friendly pointer in the right direction. Even so much as the appropriate keywords so I can find tutorials would help - been a few long hours of head scratching.

Thanks in advance for any help!


texts: drupal 6: passing multiple arguments to a view using code

texts:
I have a template file that uses execute_display to pass arguments to a view and this works great for single arguments. However, one of my arguments is a taxonomy id and the form allows the user to choose multiple term ids.

I've set the view to accept multiple arguments in the form 1+2+3 etc. But when i pass execute_display an array array containing arguments in the form of term1+term2 it doesn't work.

Any ideas how to pass multiple ids as one argument using code


texts: Apply discount on checkout when a specific quantity of products are purchased with a specific taxonomy

texts:
I have Commerce Discount installed that enables me to create a discount on a product with a certain taxonomy. However I only want this discount applied when a customer selects at least three of these products with the taxonomy.

It there a way I can update the rule created with the discount to achieve this?

This has already been logged as an enhancement Add option to specify amount of products that needs to be orderd

But I need to resolve this before my site can go live

Many thanks


texts: How can I insert one bespoke item first and one last in a views grid?

texts:
I have a set of views (in D7.57, views 7.x-3.18). Each view takes a selection of my (drupal commerce) product-displays and places them in a grid, in alphabetical order.

Now I want to add a bespoke item as first item (so in row 1, column 1), 'bumping up' all normal products one place (so product 1 goes to row 1 column 2, etc). Whatever I try (adding global header in views (obviously wrong), changing the views-grid-xx.tpl) 'breaks' the rows, displaying my bespoke item in perfect order, but breaking the row.

Option 1: adapt the views style or row output .tpl

Update after @AltaGrade answer: Thanks for your answer. That's what I tried, I amended both the 'style' and the 'row' templates for the view, but do not get the desired results with either.

The view does display my insert (which is a piece of fixed code, same lay-out etc as the normal grid items), but then treats the normal generated items as a full row, causing breaks where I don't want them, and also repeats my insert each row.

My rows (of three columns each) then look like:

insert - item 1 - item 2

item 3

insert - item 4 - item 5

and so on..

Code of the views.grid.xxx.tpl looks like this, where and how would I code my inserts (one to go before the first item in row one; one to go after all items have been listed)?

<?php

/**
* @file
* Default simple view template to display a rows in a grid.
*
* - $rows contains a nested array of rows. Each row contains an array    of columns.
*
* @ingroup views_templates
*/
// Match Column numbers to Bootsrap class
$columns_classes = array(1 => 12, 2 => 6, 3 => 4, 4 => 3, 6 => 2, 12 =>     1);
$bootsrap_class = isset($columns_classes[$view->style_plugin-   >options['columns']]) ? $columns_classes[$view->style_plugin-   >options['columns']] : 3;
$delay_attr = '';
?>
<?php foreach ($rows as $row_number => $columns): ?>
  <div class = "row<?php if ($row_classes[$row_number]) { print ' ' .  $row_classes[$row_number];  } ?>" >
    <?php foreach ($columns as $column_number => $item): ?>
      <?php
        if(isset($column_classes[$row_number][$column_number]) &&  strpos($column_classes[$row_number][$column_number], 'animation-delay') !==  FALSE) {
          $delay = isset($delay) ? $delay + 0.1 : 0.1;
          $delay_attr = ' data-wow-delay = "' . $delay . 's" ';
        }
      ?>
      <div class = "col-md-<?php print $bootsrap_class; ?><?php if   ($column_classes[$row_number][$column_number]) { print ' ' .  $column_classes[$row_number][$column_number];  } ?>" <?php print  $delay_attr; ?>>
        <?php print $item; ?>

    <?php endforeach; ?>

<?php endforeach; ?>

Option 2: Preprocess the view output using pre_render.

One suggestion I found is using hooks (hook_views_pre_render, hook_views_post_render?), is this the best way? If so, where would I put such a hook? Are these actually written into views.api.php? And how do I then write such a hook that it only applies to the view I want? All pointers / help very welcome, hooks 100% new area for me.

In the views.api.php I also found a whole section on views-handlers which looks similar to the hooks, are these an option too?.

Option 3: create extra content types

Create new content types (in this case product types) and let the view render first extra type, then the main products, then the second extra type. So I'd create a new content type for the bespoke items, and then add them to the view's filter. Any explanation how I would do that so it neatly merges into the row would be amazing.


texts: insert advertisement block within views list

texts:
I have a view that output the content nodes as grid. (instigram style). How to insert an advertisement block in a random location within the views list.

Node
Node
.
.
Advertisement
.
.
Node
Node


texts: Configuring PayPal Express Checkout to accept BRL currency

texts:
When configuring PayPal Express Checkout on Payment Methods, the Default Currency selector don't show BRL as an option.

In the FAQ page https://www.drupal.org/node/1902660#comment-9118725, where we read

  PayPal only supports a small set of currencies, and these vary by
  service. This module uses the most up to date documentation to
  populate currency option lists.

on documentation link there are more currencies that Express Checkout accepts. So isn't it necessary to update the set of currencies in Default currency selector?

When I go to paypal site  through checkout button I can't complete transaction because the currency send from Drupal is in USD instead of BRL.


texts: shorten input text size and maxlength with exposed filters

texts:
I use Drupal-7.14 and Omega sub theme.
I have a view of my content type with exposed filters.
When focusing input tags, HTML output is like this:

  <form action="/searchedlist" method="get" id="views-exposed-form-searchedlist-page-1" accept-charset="UTF-8">

               BANGO

                    <input type="text" id="edit-field-bango-value-min" name="field_bango_value[min]" value="" size="30" maxlength="128" class="form-text" />

                    And
                    <input type="text" id="edit-field-bango-value-max" name="field_bango_value[max]" value="" size="30" maxlength="128" class="form-text" />

Please show me how to change the input text size from 30 to 10 and its maxlength from 128 to 20.

for other startup people

I've reached the solution.

# mkdir sites/all/modules/mymodule
# cd sites/all/modules/mymodule
# vi mymodule.info
# cat mymodule.info
name = mymodule
description = mymodule for dummy
package = mymodule
files[] = mymodule.module
version = "7.x-1.0"
core = "7.x"
# vi mymodule.module
# cat mymodule.module
<?php
function mymodule_form_alter(&$form, &$form_state, $form_id){
  if($form_id == "views_exposed_form"){
    //dsm($form); // print $form array on the top of the page
    if (isset($form['field_bango_value']['min']) && isset($form['field_bango_value']['max'])) {
      $form['field_bango_value']['min']['#size'] = '10';
      $form['field_bango_value']['max']['#size'] = '10';
      $form['field_bango_value']['min']['#maxlength'] = '20';
      $form['field_bango_value']['max']['#maxlength'] = '20';
    }
  }
}
# wget http://ftp.drupal.org/files/projects/devel-7.x-1.3.tar.gz
# tar xzf devel-7.x-1.3.tar.gz
# mv devel modules

Admin > Modules

Check the boxes on mymodule and Devel,then Save.

Admin > config > development > performance

Clear caches.

Browse hostname/myview

Finally, HTML input tags says:

<input type="text" id="edit-field-bango-value-min" name="field_bango_value[min]" value="" size="10" maxlength="20" class="form-text" />
<input type="text" id="edit-field-bango-value-max" name="field_bango_value[max]" value="" size="10" maxlength="20" class="form-text" />


texts: how can I install Drupal 7 with PHP 5.2 on a Windows Server 2003 machine with IIS 6.0 and SQL server 2000 running on it?

texts:
What I have:

Drupal 7.0
PHP 5.2
IIS 6.0
SQL server Enterprise Manager 2003
SQL server 2000 running on local system(my database is on the same system.)
Windows Server 2003.(makes any difference?)

I am using VPN to connect to the production system.(relevant?)

I have added the Microsoft SQL Drivers 2.0 to the php/ext folder.
I have added the sqlsrv module to the database\includes as well.

Got the option to install Drupal to sql server which was the only option by default in this case (got a message that my server does not support multiple databases hence sql server was selected by default).
I have the following fields available to me in the database setup:

The values I have entered are in []:

database type:radio button (selected by default--microsoft SQL server)
database name: [database_name]
database user name: [user_name]
database password: [password]

Advanced options:

hostname: [localhost]
port: blank
prefix: blank

I get an SQLState[20008]:SQL server native client [10.0] error: can't login.
what are the possible reason for not being able to connect?


texts:
I want to contextually filter my View with a boolean field, for which the "On" value is "New," so using a URL like /view/url/new.

I first tried basic validation, but that would only work if my URL were /view/url/1.

So I wrote my own validation plugin to validate "New" as if it were "1".

<?php

namespace Drupal\my_module_validation\Plugin\views\argument_validator;

use Drupal\views\Plugin\views\argument_validator\ArgumentValidatorPluginBase;

/**
 * Validate the New boolean.
 *
 * @ingroup views_argument_validate_plugins
 *
 * @ViewsArgumentValidator(
 *   id = "my_module_validation",
 *   title = @Translation("MYMODULE Validation")
 * )
 */
class MyModuleValidation extends ArgumentValidatorPluginBase {

  public function validateArgument($argument) {
    if($argument == 'new' || $argument == 'New' || $argument == '1') {
      return TRUE;
    }
    return FALSE;
  }
}

So I'm able to apply this fine (and I can tell it's being used with a drupal_set_message() thrown inside that block), but it still doesn't work. Results only appear if I add the /view/url/1 and not the /view/url/new like I want.

Please help me understand what I've done wrong and how I can fix it.


texts: Link to a custom entity settings page does not appear at /admin/structure

texts:
I have several custom entities as part of a module. When I visit /admin/structure, one of the entities is not listed in the groups of setting, or in the lists. However, if I manually type, /admin/structure/{entity}/settings/fields, I can manage the fields, form and display. However, the "Settings" tab is missing.

Similarly, I can manually type /admin/structure/{module}/{entity} to see the entity list, but the link is missing. The entity list is missing the button to add a new entity because the entire #block-seven-local-actions div is missing. Manually typing /admin/structure/{module}/{entity}/add brings up the correct form, and the form works.

It appears the routes are present, but something is preventing some of the links from being displayed. There are no errors in the recent log messages.