texts:
Where can I find the definition of the meaning of terms in eComerce and Drupal iself . It is a bit confusing. F.e. there is :

Product
product type
product attribute
product variation
product variation type
product field
entity reference

and then :

 display field
 display form field

what are they and how they interact. I understand some of it ... but how do the COMPOSE and interact that is abit confusing.

===========

I read abit and here is the flow of creating product as I understand it.

Create Product attributes
Bundle attributes in Product variation types
Make Product types out of PVT
In the Create Product create the final Product-Variations, out of PT

Why so convolved !???


texts:
If I followed the README.txt in the module and created a view with a sorting field as instructed, should I be able to drag the items around with a four-way cursor, and then Save? I do see the Save button, but no ability to drag...

Also, is there a way to have DraggableView come into play for a view which uses display mode (teasers) rather than fields? (I do have my own CCK field named "weight", which I could make use of and get away without DV, so it's just a question of how to make admin UI easier).


texts:
I added a field:

$form['field_brand_selector']['#type'] = "select";
$form['field_brand_selector']['#title'] = "Brand";
$form['field_brand_selector']['#required'] = false;

This field is populated dynamically using Javascript. However, if I try to save the form, I get:

Illegal choice 49124 in Brand element.

I suspect that this is because I don't have this:

$form['field_brand_selector']['#options'] = $options;

So Drupal doesn't know which values are allowed for this Dropdown Selector. But seeing as this dropdown selector is not actually a field that must be saved, is there a way to "ignore" it's submission when I press save, so that I don't get the illegal Brand element error?


texts:
I'm using advanced forum and flags module to flag forum content. Flagging topics works well - I just turned it on for "Forum topic" content type. But how can I do the same for forums?

Forums are tags, so I added flagging for "Forums" vocabulary and when I visit a forum as a tag (/taxonomy/term/tid) link for flagging is there and that works fine. But when I visit a forum on desired URL  (/forum/forum_id) - link is not there. And there is no forum entity or something which I can use instead of tags.

So, how to set flags module to work with advanced forums and allow users to really flag forums as forums and not as taxonomy terms?


texts:
I'm using a Kernel test in Drupal to add a new instance of my custom entity. In the postSave() method of my entity, I generate a PDF using TCPDF. In the browser, this all works well and I can see the generated PDF in my file system. My issue is that when I run PHPUnit from the CLI, it produces my entity fine but it can't assert that the file exists.

class CustomEntityAddTest extends EntityKernelTestBase
{

  /**
   * A list of modules to be enabled to run this test
   *
   * @var array
   */
  public static $modules = ['block', 'datetime', 'custom_entity', 'entity_reference', 'file', 'migrate', 'options', 'system', 'taxonomy', 'text'];

  /**
   * The Directory where generated PDFs are stored
   */
  const FILES_DIRECTORY = \Drupal\custom_entity\Entity\CustomEntity::DP_DIRECTORY_BASE;

  public function setUp() {

    parent::setUp();
  }

  /**
   * Undocumented function
   *
   * @return void
   */
  public function testAdd() {

    $custom_entity = CustomEntity::create([
      'user_id' => 1,
      'status' => 0,
      'title' => 'First Test!',
      'inventco' => CustomEntity::generateSubmissionID(),
      'abstract' => 'Test abstract',
      'created' => time(),
      'changed' => time(),
    ]);

    $this->assertInstanceOf(CustomEntity::class, $custom_entity, "An entity was not created");

    $inventco = $custom_entity->get('inventco')->getString();

    // debugging
    $path = "/var/www/drupalvm/docroot/sites/default/files/private/{$inventco}/{$inventco}_frontpage.pdf";
    print_r(scandir("/var/www/drupalvm/docroot/sites/default/files/private/{$inventco}"));
    print($path);
    // Assert DP files exist
    $this->assertFileExists($path, "Generated PDF does not exist");
  }
}

How can I assert that the file was produced? I've checked that the filepath is correct.


texts: Why isn't the code in my implementation of hook_form_alter() being called?

texts:
When I test to see if my form is called by checking for its $form_id, there is no output. Why is it that under the comment form it can't invoke the mymodule_ask_form?

/**
 * @Implement of hook_form_alter()
 */
function mycaptcha_form_alter(&$form, &$form_state, $form_id) {
    if ($form_id == 'comment_form') {
      mycaptcha_ask_form($form);
      echo 'test';
    }
  }

function _mycaptcha_get_ask($key = NULL) {

  $ask = array(
    'test 1' => 'example 1',
    'test 2' => 'example 2',
  );

  return isset($key) ? $ask[$key] : $ask;
}

function mycaptcha_ask_form(&$form) {
  $ask = _mycaptcha_get_ask();
  if (isset($_SESSION['mycaptcha_ask_key']) && $ask[$_SESSION['mycaptcha_ask_key']]) {
    $ask_key = $_SESSION['mycaptcha_ask_key'];
  }

  if (!$ask_key) {
    $_SESSION['mycaptcha_ask_key'] = $ask_key = array_rand($ask);
  }

  $form['mycaptcha_ask'] = array(
    '#type' => 'textfield',
    '#required' => 1,
    '#title' => 'tetst'.$ask_key,
    '#weight' => -1
  );
}


texts: Applied JS to Drupal theme doesn't work correctly, but it works fine outside Drupal

texts:
Applied this JS http://jsfiddle.net/tbq8eo8b/10/ to webforms. As you can see in fiddle, it calculates total amount. When in Drupal, it gives 0 no matter what amounts you select, it always prints 0. What's wrong?

Drupal code:

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

/*Add your js code here*/
    var $selects = $("select").change(function (e) {
        var total = 0;
        $selects.each(function() {
            var val = this.value.match(/\$(\d+)/);
            total += val ? +val[1] : 0;
        });
        $(".total").val(total);
    });

}

};
}(jQuery));

Also console prints:

TypeError: $ is not a function
$("select").change(function ()


texts:
I am trying to get all the taxonomy terms added to a node. How would I get only the taxonomy term values that are added to a code in a mymodule_preprocess_node hook?

Current term list:

value1 (tid=1)
value2 (tid=2)
value3 (tid=3)

Node list:

node1 has field_category = 1
node2 has field_category = 3
node3 has field_category = 1,2,3

Here is what I tried, but cannot find a way to filter and only return the taxonomy term values that are added to a node.

// Returns entire list of values, but we want only ones added to Basic page
$term_tree = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadTree('field_category');

$nodes = \Drupal::entityTypeManager()->getStorage('node');

I am trying to get all the taxonomy term values, but just the entity field values.


texts: User Avatars on My Relationships: friends Block

texts:
I have read several tutorials about doing this through views but I was wondering if it is possible to modify the block created out of the box by user relationships without having to create a view.

Am using the following version for the module;
-UR 7.x-1.0-alpha4


texts: I created a view which is viewable at http://mysite.com/branch-locator.   The view is being displayed by my page.tpl.php.  How do I override this and use a new template file called branchlocator.tpl.php to display my view?


texts:
I'm building an HTML table in a php filter in a block. Can I/is it OK if I call drupal_add_css() from the block php?

Thanks.


texts: When checking out, redirected to front page and not payment page

texts:
I am creating a new order, and line item (without a product, since this is just a fee we're collecting from the customer).  The order is created, with line item, but when I go to /checkout/[order_id], I'm just redirected to the front page.

My code for the order creation is:

function mymod_form_submit($form, &$form_state) {
        global $user;
        $order = commerce_order_new($user->uid, 'checkout_checkout');
        commerce_order_save($order);
ddl($order);

        $line_item = commerce_line_item_new('app_fee_type', $order->order_id);
        $line_item_wrapper = entity_metadata_wrapper('commerce_line_item', $line_item);

        $line_item_wrapper->line_item_label = t('Application Fee');
        $line_item_wrapper->quantity = 1;
        $line_item_wrapper->commerce_unit_price->amount = 3500;
        $line_item_wrapper->commerce_unit_price->currency_code = 'USD';
        $line_item_wrapper->commerce_total->amount = 0;
        $line_item_wrapper->commerce_unit_price->data = commerce_price_component_add(
                $line_item_wrapper->commerce_unit_price->value(),
                'base_price',
                $line_item_wrapper->commerce_unit_price->value(),
                TRUE,
                FALSE
        );
        commerce_line_item_save($line_item);

ddl($line_item);

        $order_wrapper = entity_metadata_wrapper('commerce_order', $order);
        $order_wrapper->commerce_line_items[] = $line_item;
        commerce_order_save($order);
ddl($order);
        commerce_order_status_update($order, 'checkout_payment');
        drupal_goto('checkout/' . $order->order_id);
}

The customer should just be taken to the checkout screen.  What am I missing?


texts:
I need to display one of the pages on the site as a secure page, currently it's:
http://www.mypage.co.uk

and it needs to be:
https://sub.mypage.co.uk/

I can add a redirect to htaccess but the page doesn't show the styling as it's not https.

Also the certificate that the client has bought only covers this page.

I tried using secure pages but I get a Forbidden error when I try to view the page.

What do I need to do to display a single page on a subdomain URL and as https?


texts:
I understand Drupal 8 ControllerBase implements StringTranslationTrait so we can use $this->t() in Controller class.
But I found in Drupal 8 examples code, they setStringTranslation to use t() function. Here is the code.

public static function create(ContainerInterface $container) {
    $controller = new static(
      $container->get('database')
    );
    $controller->setStringTranslation($container->get('string_translation'));
    return $controller;
  }

The link for their module. https://git.drupalcode.org/project/examples/blob/8.x-1.x/tablesort_example/src/Controller/TableSortExampleController.php

My question is why setStringTranslation when you can just use t() function in the controller.


texts:
I'm trying to change the grid system in the Zen theme to use susy but can not find any documentation on how to do it with the 7.5.5 version.

I have installed susy through compass and have added require 'susy' to my config.rb file.

But from here I'm not sure what I need to do.

Do I have to delete the _responsive.scss file that comes with Zen and code my own?

If anyone could provide a run down of the steps needed that would be very helpful.

Many thanks,

Terry.


texts: Is it a way to get know if more than one user edit the same node?

texts:
I'm looking for the way to inform site editors if the other editor is trying to edit the same node. In other words I need functionality that is similar to the Checkout module. But it is no longer maintained and I don't like to lock anything, just show a popup message.

Do you think that it is possible? I didn't find any hooks in Drupal API that could do that.

And the last thing - this is Drupal 6


texts:
Im doing a simple Rules that when a content is created of type X, and has taxonomy term of T1, simple action to display a message in the page.

Events: After saving new content (rules_entity_insert:node)
Conditions:

Node is of type
How to configure this item to select taxonomy term???

Action: Show a message on the site


texts:
How can I highlight the checkbox boxes when be validated a CCK field? (CCK 2.9). Data is validated correctly, and message is displayed correctly in the head of the form, but the checkboxes does not appear highlighted.

<?php
$quantity_options = count($form_state['values']['field_checkboxes']);
if ($quantity_options > 2) {
form_set_error('field_checkboxes', 'message.');
}
?>


texts: I want to use a custom field in my Views REST export, but rather than having "nothing": "My custom text", I would like "mycustomtext": "My custom text". Is there a way to do this from within the UI?


texts: Referenced Entity not Updating Correctly When Saved

texts:
I have node A that contains an Entity Reference Revisions field in it set to display as a Rendered Entity that points to node B of a different content type.

Initially this works fine. However, if I make an update to node B and save it, the changes don't appear on node A until I edit and save node A again.

It seems like it should update without having to re-save the parent node. Is there a way around this?


texts: Services module, custom endpoint & authentication

texts:
I have a have setup a custom endpoint via services and a REST server the custom end point looks like this,

https://website.local/api/v1/druaplsquare

The custom endpoint is built using the following code,

drupalsqaure.module

function drupalsquare_services_resources() {
  $resources = array();
  $resources['drupalsquare'] = array(
    'operations' => array(
         'create' => array(
             'file' => array('type' => 'inc', 'module' => 'services', 'name' => 'resources/drupalsquare'),
             'callback' => '_job_resource_create',
             'args' => array(
                 array(
                     'name' => 'node',
                     'optional' => FALSE,
                     'source' => 'data',
                     'description' => 'The node data to create',
                     'type' => 'array',
                 ),
             ),
             'access callback' => '_drupalsquare_resource_access'
         ),
         'delete' => array(
             'file' => array('type' => 'inc', 'module' => 'services', 'name' => 'resources/drupalsquare'),
             'callback' => '_job_resource_delete',
             'args' => array(
                 array(
                     'name' => 'jobref',
                     'optional' => FALSE,
                     'source' => array('path' => 0),
                     'description' => 'The job reference to delete',
                     'type' => 'string',
                 ),
             ),
             'access callback' => '_drupalsquare_resource_access'
         ),
    ),
  );
  return $resources;
}

resources/drupalsquare.inc

<?php

function _drupalsquare_resource_access() {
    return TRUE;
}

//function _drupalsquare_resource_retrieve($uid) {
//  $account = user_load($uid);
//
//  if (isset($account->data['checked_in'])) {
//      return array(
//          'uid' => $account->uid,
//          'name' => $account->name,
//          'last_checkin' => $account->data['checked_in'],
//      );
//  }
//  else {
//      return FALSE;
//  }
//}

function _drupalsquare_resource_checkin($JobReference, $date = NULL) {
    die(print_r($JobReference));
//  $account = user_load($uid);
//  $account->data['checked_in'] = is_null($date) ? REQUEST_TIME : $date;
//  user_save($account);
    return TRUE;
}

function _job_resource_create() {
    die("create");
}

function _job_resource_delete($jobref) {
    die("here");
}

I am making a cURL request this is endpoint, but I am first of all authenticating a user, and getting a token, I am then sending this token in the request header, however the endpoint above is returning,

  Access denied for user anonymous

Can anyone see any reason as why this would be happening?


texts: Ubercart - how to alter button texts via hook_form_alter()?

texts:
I am attempting to change the language of the buttons on the product and cart forms.

All is working well on product form but when the same is implemented on the cart page it stops submitting properly. Button values change but they stop working.

<?php

/**
**Custom Module for hook_form_alter
*/

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

    if ($form_id == uc_product_add_to_cart_form_1){
            $form['submit']['#value'] = 'Register';
    }

    if ($form_id == uc_cart_view_form){
        //dsm($form);
        $form['continue_shopping']['#value'] = 'Back';
        $form['update']['#value'] = 'Update';
        $form['checkout']['#value'] = 'Continue';
    }
}
?>

Any help would be much appreciated.


texts: How do I make it so Drupal doesn't automatically show latest content on frontpage?


texts: Upgraded Drupal 7.37 to 7.38 using Drush and its not working. update needs a higher bootstrap level to run - Error

texts:
I am new to Drupal.  I am reading a book called Definitive Guide to Drupal 7.  I had installed Drush on Windows 7 with Git as well.  It was working last week.   Since 7.38 is released I tried to update my localhost website for this particular book and I am getting an error.  I have googled this problem and I am coming up with some solutions but they are not working for me.  I have navigated to the root folder of the Drupal installation in Git before using Drush Up. I have also changed the 'host' value in settings.php to '127.0.0.1'. It was 'localhost' before.  I don't know how to fix this. Does anyone know?

Anthony@ANTHONY-PC ~
$ cd c:/wamp/www/definitiveguided7

Anthony@ANTHONY-PC /c/wamp/www/definitiveguided7 (master)
$ drush up
Command pm-update needs a higher bootstrap level to run - you will       [error]

need to invoke drush from a more functional Drupal environment to run
this command.
The drush command 'up' could not be executed.                            [error]

Drush was not able to start (bootstrap) the Drupal database.             [error]

Hint: This may occur when Drush is trying to:
 * bootstrap a site that has not been installed or does not have a
configured database. In this case you can select another site with a
working database setup by specifying the URI to use with the --uri
parameter on the command line. See `drush topic docs-aliases` for
details.
 * connect the database through a socket. The socket file may be
wrong or the php-cli may have no access to it in a jailed shell. See
http://drupal.org/node/1428638 for details.

Drush was attempting to connect to:
 Drupal version         :  7.37
 Site URI               :  http://default
 Database driver        :  mysql
 Database hostname      :  127.0.0.1
 Database port          :
 Database username      :  root
 Database name          :  definitiveguided7
 PHP executable         :  php
 PHP configuration      :  C:\wamp\bin\php\php5.5.12\php.ini
 PHP OS                 :  WINNT
 Drush script           :  C:\Users\Anthony\AppData\Roaming\Compose
                       r\vendor\drush\drush\drush.php
 Drush version          :  8.0-dev
 Drush temp directory   :  C:/Users/Anthony/AppData/Local/Temp
 Drush configuration    :
 Drush alias files      :
 Drupal root            :  C:\wamp\www\DefinitiveGuideD7
 Site path              :  sites/default


texts: How to pass arguments based on term filter

texts:
I have content type called 'software' and added taxonomy terms to this content type as select list. There are 10 taxonomy terms in that list.
And now I have created 10 pages under this 'software' content type with 10 different taxonomy terms selected among them.

> Page1 -> Term1
> Page2 -> Term2
> etc.

What I need is, If i see www.mysite.com/taxonomy/term/3  in the url, I need to display only the page title of the listed nodes in the view (rather than the title and teaser), for those nodes tagged with taxonomy term(3).

How can I achieve using views arguments and filters?


texts: How to add a user rank in their profile?

texts:
I want to have rank for every user. A simple -> amin rank is 18 with 300 points.

Any suggestions?


texts: How to change date format in an ajax View's exposed Date filter that uses BEF?

texts:
I have a view with Ajax option enabled and using some date filters with better exposed filters (latest version). What i'm trying to do is to change the default date format of a date filter from mm/dd/yy to dd/mm/yy.
I tried to implement this solution. The format changes and the popup works fine, but the problem occurs when applying the filters, where it seems that the date filter value does not validate.
Any suggestions on how to change the date format of a BEF filter in an Ajax view?


texts:
How do I go about adding a drop down to alter the amount of search results at search-results.tpl.php that will change pagination?

I would prefer not to use Views because I have completed a lot of styling and template changes to search-result.tpl.php.


texts: Can't get Ajax data sent to my PHP function

texts:
I recently took over an existing Drupal project and I tried to add a new PHP function (which works regularly) and link it with an Ajax query. There were already some in place that worked, and I wanted to add one that when you press a link, it sends the ID in the link to a PHP function which generates an info field. By copying the working code I got to this:

In my module, I added a menu hook referring to the PHP function in the module and the Ajax link:

$items['api/feedback'] = array(
  'page callback' => 'admin_user_feedback',
  'access arguments' => array('access feedback'),
  'access callback' => TRUE
);

return $items;

This is my Ajax code:

function getFeedback(id){
    $.ajax({
        type: "POST",
        url: 'api/feedback',
        dataType: 'json',
        data: {
            'id': id,
        },
        success: function(data){

            alert("success");
        },
        error: function(){

            alert("error");
        },
    });
}

I know the function gets called on, but the console gives this error:

  POST http://localhost:8080/site/api/feedback 404 (Not Found)

The URL is correct, the other APIs with similar URLs do work, so somehow he doesn't recognise this API, I must have missed something. Does anybody know?


texts: How to let flexslider's picture point to its own node uri?

texts:
I do several step below:

1 Add a PIC field to "artical" node type.
2 Make a view and set it flexslider,then limited type "artical",show "PIC" field.

And now I need to make slider that when I click on picture,the browser jump to the exect node that picture own.

How to do so?


texts:
I try to use the module automenu 6.x-2.x-dev in drupal 6.30. I have installed the module in /sites/all/modules and then activated the module.
Further I added some content (story,page) leave the menu link title empty, choose a parent menu item and published the newly created content; but I never gets a menu item created.

I created the content as admin, so there shouldn't be a permission issue.

Could anyone explain me how this module works? I googled a lot, but find any helpful information.


texts: Formatting options in Webform Select field

texts: I have a select field on a webform with 20+ options for the user. The default is a long list of options to select from. Is there any way to have the options broken into columns for the user to choose from so the webform doesn't end up an excessively long form?


texts:
I recently updated my Drupal 'Newsflash' theme but one of my javascripts stopped working. I contacted the writer of the js script and he suggested that my head section has lost the markup for importing the overlibmws.js file, and that I should put it back.

<script type="text/javascript" src="/files/overlib.js"></script>

Where do I go in Drupal 7 (Im guessing it is a tpl file) to insert this code into the header?


texts:
I have a custom module which creates a new field with a computed value, which I need to update.
How do I bulk update my nodes for a specific content type?


texts: Contextual Filters with multiple arguments

texts:
Why isn't this view filtering correctly? I have four contextual filters applied to one view:

http://i.imgur.com/3wN6Q.png

The view is filtering a list of projects by four properties, Region, Client, Type, and State.  When the view-page is loaded, all 4 arguments will be supplied.  The problem I'm having is:

The first two arguments, Region and State, filter correctly.  The last two: Type and State do not affect the filter.

http://i.imgur.com/9fVfG.png

The Type field isn't being factored into the query at all. You can see content with both Roadway and Airport values for the type field show up, but none for Asian or Military which are correctly filtered out values for the first two arguments (Region and Client).

I have tried remaking the filters, re-arranging the filters to make type first, re-entering some of the test content to make sure it wasn't corrupted.. no luck yet.


texts: Failing to uninstall a module because "The website encountered an unexpected error. Please try again later."

texts:
It is something wrong with the Profile module I'm using together with the Commerce module and multilanguge module. I would like to uninstall all three modules and try to install them again, but it doesn't allow me as you can see below. How to proceed?
When I try to uninstall a module at /admin/modules/uninstall I get this error.

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

Detailed error message:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pantheon.profile' doesn't exist: SELECT base_table.revision_id AS revision_id, base_table.profile_id AS profile_id FROM {profile} base_table LIMIT 1 OFFSET 0; Array ( ) in Drupal\Core\Entity\EntityStorageBase->hasData() (line 588 of /code/core/lib/Drupal/Core/Entity/EntityStorageBase.php).

I have clear all cash and run cron, still same issue. It asks me to run this update script:

15 PENDING UPDATES

profile module

8003 - Removes the langcode key from the profile entity keys.
8004 - Add the uid entity key to profiles.
8005 - Rerun uid entity key addition after incorrect entity type fixed.
8006 - Install the `data` field.
8007 - Set the 'published' entity key.
8008 - Adds a storage schema for profile that adds a multi-column index.
8009 - Update revision fields.
8010 - Update the status field.
Add new revision settings to profile types.
Change the plugin ID of the delete action.
Change the plugin IDs of the publish and unpublish actions.
Show the profile form at user registration using the profile_form widget.
Replace the "profiles" view with the updated version.

commerce_tax module
Add the tax_number field to customer profiles.
Add the tax_number field to customer profile view displays.

I click on Apply pending updates. I get this error
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /update.php/start?id=44&op=do_nojs&op=do
StatusText: parsererror
ResponseText:

Detail error log:
Error: Call to a member function hasKey() on null in profile_update_8003() (line 82 of /code/modules/profile/profile.install)
#0 /code/core/includes/update.inc(246): profile_update_8003(Array)
#1 /code/core/includes/batch.inc(295): update_do_one('profile', 8003, Array, Array)
#2 /code/core/includes/batch.inc(137): _batch_process()
#3 /code/core/includes/batch.inc(93): _batch_do()
#4 /code/core/modules/system/src/Controller/DbUpdateController.php(185): _batch_page(Object(Symfony\Component\HttpFoundation\Request))
#5 [internal function]: Drupal\system\Controller\DbUpdateController->handle('start', Object(Symfony\Component\HttpFoundation\Request))
#6 /code/core/lib/Drupal/Core/Update/UpdateKernel.php(115): call_user_func_array(Array, Array)
#7 /code/core/lib/Drupal/Core/Update/UpdateKernel.php(76): Drupal\Core\Update\UpdateKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request))
#8 /code/update.php(28): Drupal\Core\Update\UpdateKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#9 {main}


texts: Node type created by custom module doesn't get updated

texts:
I'm working on a custom module that creates a new content type. Recently I added a new field to the content type, but it doesn't get updated. I don't have any nodes of this type and when I disable my module, the content type is deleted. After I enable it again, the content type is back, but with the old setup and without the newly added field.
I'm probably overlooking something very basic, but I couldn't figure out what. I cleared the cache and run cron before and after I disabled and enabled my module.

I even tried to give a different name to my content type and fields, but then the content type is not created. I bet it's just some small mistyping or something.

What could be the problem?

Here is the code. I put the field arrays into functions, but I don't think this causes any problem.

function simplegal_node_info() {
  return array(
    'simplegal' => array(
      'name' => t('Simple Gallery'),
      'base' => 'simplegal',
      'description' => t('A simple gallery that will display all images from a given directory'),
      'title_label' => t('Title of gallery'),
      'locked' => TRUE,
    ),
  );
}
function simplegal_node_type_insert($content_type) {
  if ($content_type->type == 'simplegal') {
    $body_instance = node_add_body_field($content_type, t('Description'));
    field_update_instance($body_instance);
    foreach (_simplegal_installed_fields() as $field) {
      field_create_field($field);
    }
    foreach (_simplegal_installed_instances() as $instance) {
      $instance['entity_type'] = 'node';
      $instance['bundle'] = 'simplegal';
      field_create_instance($instance);
    }
  }
}

function _simplegal_installed_fields() {
  return array(
    'simplegal_gallery_dir' => array(
      'field_name' => 'simplegal_gallery_dir',
      'cardinality' => 1,
      'type'        => 'text',
      'settings'    => array(
        'max_length' => 60,
      ),
    ),
    'simplegal_thumb_width' => array(
      'field_name' => 'simplegal_thumb_width',
      'cardinality' => 1,
      'type'        => 'text',
      'settings'    => array(
        'max_length' => 10,
      ),
    ),
    'simplegal_thumb_height' => array(
      'field_name' => 'simplegal_thumb_height',
      'cardinality' => 1,
      'type'        => 'text',
      'settings'    => array(
        'max_length' => 10,
      ),
    ),
  );
}
function _simplegal_installed_instances() {
  return array(
    'simplegal_gallery_dir' => array(
      'field_name' => 'simplegal_gallery_dir',
      'label'       => t('The directory of the gallery'),
      'widget'      => array(
        'type'    => 'text_textfield',
      ),
    ),
    'simplegal_thumb_width' => array(
      'field_name' => 'simplegal_thumb_width',
      'label'       => t('Width of thumbnails'),
      'widget'      => array(
        'type'    => 'text_textfield',
      ),
      'default_value' => variable_get('simplegal_thumb_width',120),
    ),
    'simplegal_thumb_height' => array(
      'field_name' => 'simplegal_thumb_height',
      'label'       => t('Height of thumbnails'),
      'widget'      => array(
        'type'    => 'text_textfield',
      ),
      'default_value' => variable_get('simplegal_thumb_height',120),
    ),
  );
}


texts: I know how to check if a site is built with Drupal, but is there a way to tell if a site is built with Drupal 7?


texts:
I need an address field to filter nodes with depenent selectors or autocomleted inputs. There is no needs to have any database of countries, regions, cities. It is enought if admin will able to add ones manually. But it is required to have simple dep.selectors in widgets while setting values or filtering.

I tried https://www.drupal.org/project/address but there is no selector for the city subfield. May be it is possible to show selector here based on existing values?

Also, I tried to create several taxonomies (country, region, city) with custom fields(region have country reference, city - region and country refs), but I do not know how to link them really at input widgets, so I can select country and cities selector will show only this country cities, or I when selected city, the country selected automatically, based on its refs.

Thank you!


texts: View query alter joins view_joins construct() with condition

texts:
We are trying to alter view query, by joining table with extra condition related to other table in the query to avoid duplicate,

$join2 = new views_join;
$join2->construct('mls_state', 'data_field_mls', 'mls_value', 'mls_sid');
$join2->extra = array(array('table' => 'mls_state', 'field' => 'state_code', 'operator' => '=', 'value' => 'data_field_state.state_value'));
$view->query->add_relationship('mls_state',$join2,'data_field_mls');

But in view it default takes the value in quotes
Result

LEFT JOIN {mls_state} mls_state ON data_field_mls.mls_value = mls_state.mls_sid AND mls_state.state_code = 'data_field_state.state_value'

How would we check condition with other referenced table fields value?


texts: How to show all content type images in a gallery

texts:
I would like to realize a View that shows, randomly, 5 images taken from Image field in y content type.
I've tried but i only see the images from a single record, i would need to show ALL of them together. Is it possible?


texts: Views grid output is top-to-bottom, not left-to-right?

texts:
I have a view outputting a grid of fields sorted by title, however the sorting is not what I expected:

What i'm getting:

A  D  G

B  E  H

C  F  I

What I want:

A  B  C

D  E  F

G  H  I


texts:
What's the best approach at adding a node above a view. Right now i'm using the views html (before) to add 3 links to pdf's and some text.

I'm not interested in using panels; primarily, because the content has to appear below the view header.

Would it be best to add each file as nodes and join the view with a relationship?


texts: If user leave comment, print "You have already written a comment"

texts:
how to show this 'You have already written a comment' if user have comment in this node -)

Thanks for any help)


texts: How do I include composer.libraries.json in root composer.json without using the wikimedia/composer-merge-plugin plugin?

texts:
In the recent update to Composer 2.0 the advice is to get rid of the wikimedia/composer-merge-plugin, which was even removed from the dependencies of Drupal core.
There is documentation on how to include custom module's composer.json in the root composer.json, for example Managing dependencies for a custom project, but I cannot find documentation on how to include composer.libraries.json in the root composer.json.
Can anyone explain how to get the Webform module compatible with Composer 2.0?


texts:
Added jquery library, it works fine, but when i click on node edit, jquery does not work for this page. I need to style some inputs inside this edit page. I am using theme zen.
For example i want to change color of edit-title

(function($) {
$(document).ready(function(){

    $('#edit-title').css('color', 'red');

  });
})(jQuery);

not working. Its loaded i see in firebug. But any code does not work(only inside edit or admin menus).


texts:
How can I get the last saved vid. taxonomy_vocabulary_save($vocabulary); is not returning the vid.
I have used the following way.

$vocabulary = new stdClass();
$vocabulary->name = 'Currencies';
$vocabulary->machine_name = 'currencies';
taxonomy_vocabulary_save($vocabulary);
// get the vid of currency
$vocabulary = taxonomy_vocabulary_machine_name_load('currencies');
//save a variable for vid
variable_set('currencies_vid', $vocabulary->vid);

Is there any better method?


texts:
In my user-profile.tpl.php file In print fields like this :

<?php

    global $user;
    $user_id = arg(1);

    $user_item = user_load_by_name($user->name);

    if($user->uid == $user_id) {
        echo 'I'm connected';
        print render ($user_profile['field_mon_statut']);
    }

 ?>

I wrote this exact same code in html.tpl.php but it does not appear..

Thanks for your help !


texts: Check Content Type in Paragraph Preprocess

texts:
I've written a paragraph preprocess function that is working perfectly. The only issue is that I need it to only work when that paragraph is embedded in a certain content type.

function mytheme_preprocess_paragraph__paragraph_type(&$variables) {
   // Do things here if content type == 'specified_type'
}

I'm unsure of how to check the content type, though. How can I accomplish this?


texts: How to properly alter a field description in hook form alter

texts:
I am altering a field description (help text) based on certain conditions. However, sometimes the description element to alter is set at $element['value']['#description'] = $new_description; And other times it's set at $element['#description'] = $new_description; I am doing this in a field widget alter hook:

/**
 * Implements hook_field_widget_form_alter().
 */
function my_module_field_widget_form_alter(&$element, \Drupal\Core\Form\FormStateInterface $form_state, $context) {
    // do the following based on some conditions:
    $html = \Drupal::service('renderer')->render($some_render_array]);
    /* @var Drupal\Core\Field\FieldFilteredMarkup $new_description */
    $new_description = \Drupal\Core\Field\FieldFilteredMarkup::create(t($element['#description'] . $html));
    // For some elements this works:
    $element['#description'] = $new_description;
    // For other I need to do this:
    $element['value']['#description'] = $new_description;
  }

}

Whats the difference? and do I have to use some logic to target the appropriate element?


texts: getting rid of Media Module Message "Media Folder: Media Root"

texts:
Why is the message "Media Folder  - Media Root" appearing on this article, and not on the other articles and pages that also use media to insert images on my site? How can i get rid of it, i don't like it.
http://notesmusic.be/node/3


texts: Referencing public files when editing nodes

texts:
Right now when I want to include an image into a node I have to specify a path like

The problem is if the Public file system path configuration setting changes, all the links will get broken.

Is there any way to say something like

to embed images?


texts: Easily theming Form Fields - How to get minimum HTML required for form field in Drupal 7

texts:
I'm using my own templates to modify forms, i.e. user registration form. In my custom template, I call drupal_render($form['field_email']); to get output for a text input used for taking user's Email.

However, this function returns so many outputs (including a Label which definitely I don't want, and a lot of divs) that break my design. What I require is a single <input name = "appropriate-name" /> but I'm getting:

  Email *
 <input type="text" id="edit-field-user-email-und-0-email" name="field_user_email[und][0][email]" value="" size="60" maxlength="128" class="form-text required" />

A lot of HTML!

Is there a way to get minimum HTML required for a form input field to work properly?

Perhaps, I may end up with editing the #theme property for this field, to specify a custom theme function. But That's a lot of work to do, I think. Besides, I have many other fields for which I may need to write custom theme functions to get simple HTML for the input. Is there a quick way to get minimum HTML for a form field?


texts: URL path settings not supporting more than one level

texts:
I'm trying to edit and create content on my inherited Drupal site and when I enter an address into the "URL Path Settings' URL Alias" field, it will not save the first part of the desired URL.
For example if I enter "firstpart/contentname"
it just saves "contentname" instead of the full hierarchy.


texts:
i have content type in Drupal 6 that has date field, that is date when some historical event happened.

I want to create a view that will show all historical events that happened today.

I created 2 computed fields that will take data from that date field, one for month and other for day. Also i created view and added this two fields as filter. And when i enter exact numbers in filter, like 9 and 20 it shows the articles that happened on this month and day.

But since its not exactly a date field i cant enter relative values like "now" or "today" and someone needs to change this manually every day.

What is best way to get this filter take todays day and month.


texts: How to display a date without hour, minutes, and seconds?

texts:
I have created content type and installed Automatic Entity Label and generated the auto label using field tokens of:

field_id
field_DOB
field_Gender

After saving the content DOB format is displaying with time stamp           56u 2015-10-13 00:00:00 Male but here I want to show only something like this 56u 2015-10-13 Male.

I want to remove this 00:00:00.

While creating the field DOB I have chosen the following settings but still getting the hour, minutes, and seconds. How to remove this? Any suggestion?


texts: How do I use a custom theme in a module?

texts:
As I know Drupal 8 removed theme(), which is still present in Drupal 7. There  is function hook_theme() to call and render the theme in a module.

Can anyone help with some of the examples? How do I use a custom theme in my custom module?


texts: How to manage editing and publication of content

texts:
The scenario is this:

Content is created or edited:

At that point, the content should be marked or moved to a state of "edited" If the content is new, it should not be published.
If it is an existing node, it the ORIGINAL version should REMAIN published until it is "approved".

Content is approved:

If the approved node is preexisting, the edited version replaces the old version.
Otherwise, it is new content and it is moved from not published to published.

I'm looking for suggestions on how to accomplish this. My hope was to use the module Workflow and integrate it with Triggers.

So far, I'm not seeing an obvious path to making this work as described above.


texts: How do you message/email the purchaser an order update?

texts: Previously in ubercart 3.x you were able to send messages and log admin notes on each order page. How can this be done using Drupal Commerce? I want to be able to message the purchaser in the order invoice page and also add internal notes if necessary. Which module(s) would I need to achieve this? Can you provide a screenshot of it in action?


texts: Mollom and Spamicide are not slowing down spam registrations

texts:
I have a drupal 6 site. I'm using both Mollom and Spamicide.

Mollom is doing a great job at stopping spam comments but spambots are registering at an extremely high rate over 6 per minute.

Registration uses a captcha from Mollom and Spamicide but they seem to be going right through both. Spamicide slowed them down for about half a day but now that seems to be doing nothing.

Additionally, about 80% of the spambot accounts are validating their accounts through email - they create tons hotmail accounts with generic names.

Any ideas or recommendations on stemming the tide?

I've been trying to find a way of automatically blocking IPs that are throwing a high number of registrations or other suspect activity.


texts: Context reaction : Exclude specific block?

texts:
I've got a website with 3 large contexts :
- internet
- intranet
- shop

These 3 contexts are "tight" (sorry about my english, I think this is the word).

My Block UI (admin/build/block) provides to every pages 2 blocks in my website first sidebar.

In my Shop context, I've got a specific header, footer, and about 6 blocks in the first sidebar.
The conditions are quite simples : Paths only.
- shop/*
- cart/*
and some others.

My node-product pages are in my Shop context conditions, and that's fine. (I don't want my users to lose the shop header, shop menu, shop footer and so on...) when they are on a product page.

Now, what I would like to do is to exclude 3 of my 6 side blocks on my node-product pages.

So I was thinking... What if we had an "Exclude Blocks" Reaction in context ?
That is exactly what I need to do what I'm expecting.

I tried to adjust visibility settings in block UI, but it seems that context UI overrides it...

Shall I duplicate my Shop context to have a Shop-product one ? Is that clean ?
I mean... All this context definition is correct, and I only want to exclude 3 blocks... Isn't that overkill to duplicate all my settings ?

Any Ideas ?
Thanks guys.


texts: Simple multi value text widget needed (non draggable)

texts:
I have a content type with a multi value text field. It renders as the table with sticky headers, draggable lines and "add more" button. I just want a text field and a link "add more" below, so the display fits better into the form and is not that ostentatious.

Isn't there a simple widget or do I have to do a form alter or other measures?

UPDATE1:

I tried

function MYMODULE_field_widget_text_textfield_form_alter(&$element, &$form_state, $context) {
if ($element['#field_name'] == 'field_rechner') {
  //dpm($element);
  //dpm($context);
  $element['value']['#type'] = 'textarea';
}

}

and that works; so how do I replace the widget itself?

UPDATE2

For a css only solution - I am not sure if this can be achieved : How can I keep the input tag but remove(hide) the stuff outside??

the html is the following:

Rechner 	Reihenfolge

  <input class="text-full form-text" type="text" id="edit-field-rechner-und-0-value" name="field_rechner[und][0][value]" value="" size="20" maxlength="20" />

  Weight for row 1
 <select class="field_rechner-delta-order form-select" id="edit-field-rechner-und-0-weight" name="field_rechner[und][0][_weight]"><option value="0" selected="selected">0</option></select>

<input class="field-add-more-submit form-submit" type="submit" id="edit-field-rechner-und-add-more" name="field_rechner_add_more" value="Weiteres Element hinzufügen" />


texts: Image style effect for removing empty space around image

texts:
There can be a lot of situations when e. g. set of logos in png format are not cropped regularly and some images can have different white spaces around the actual logo in the image.

Is there any module that adds an image style effect capable of cropping white space (transparent or white) around image?


texts:
I have a distro with many preinstalled features (Panopoly).

Since I have upgraded core to 7.24 I can see an additional setting at admin/structure/features/settings, see attachment.

On production, is it best to disable the "Rebuild features on cache clear"? This is active by default.


texts: How to pass field value to referenced node template?

texts:
I have content type A. It has field reference to content type B.

I'm rendering referenced node B from content type A twig template like:

{{ content.field_referenced_object }}

And that works well.

I also render some type A filed inside it's template like:

{{ content.field_some }}

which also works.

Problem is that I need that field_some value to be displayed from referenced object B template instead of object A template, to optimize page markup. How can I pass value from content type A twig template to content type B twig template?

It twig it can be done when including template like:

{% include 'template.html' with {'foo': 'bar'} %}

But is there some analogy for Drupal 8 theming?


texts: View Rewrite results Inline CSS for Newletter

texts:
I am trying to send a HTML newsletter with the simplenews plugin using views.
The mailing of HTML via the plugin works flawlessly (after tinkering). I included a View via the Twig Tweak plugin inside the corresponding twig template.
My main problem is very similar to this but for Drupal 8. HTML mails require (as far as I know) inline CSS to be displayed correctly in the majority of mail clients. As I use a View, inline CSS get stripped away ("sanititzed" for security I guess).

Is there any possibility for me to use Views with inline CSS as in Drupal 8 I couldn't find the correct line of code to disable this "sanitisation"?


texts: Install Meta Tags and Meta Tags Quick modules on the same site

texts:
Short: Are Meta Tag and Meta Tag Quick incompatible modules?

I am configuring a site that has Meta Tag Quick module but it doesn't allow me to have a meta description tag. It creates an Open Graph description meta tag instead.

Then I want to install Meta Tag module but I am afraid of my site crashing or some error. I know I have to do a backup, and I did.


texts: Printer Module: Show link base on Content Type

texts: Let say I have content type A, B, C and D. How can I show the Printer Module's Link on B and D only? The one with PDF version, and ePub Version.


texts: Tables are not creating with hook_schema

texts:
I need to create a module to save data of term page visits.

<?php

function term_count_schema() {
  $schema['term_search'] = array(
  'description' => 'Stores timestamp range..',
'fields' => array(
  'tid' => array(
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
    'size' => 'tiny',
    'description' => 'Taxonomy ID.',
   ),
  'vid' => array(
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
    'size' => 'tiny',
    'description' => 'Vocabulary ID.',
    ),
  'timestamp' => array(
    'type' => 'int',
    'not null' => FALSE,
    'description' => 'UNIX timestamp.',
   ),
 ),
 'primary key' => array('tid'),

  );

  $schema['term_count'] = array(
'description' => 'Total views.',
'fields' => array(
  'tid' => array(
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
    'size' => 'tiny',
    'description' => 'Taxonomay ID.',
  ),
  'vid' => array(
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
    'size' => 'tiny',
    'description' => 'Vocabulary ID.',
  ),
  'totalviews' => array(
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
    'size' => 'tiny',
    'description' => 'Total number of views which increments on every page load.',
  ),
),
'primary key' => array('tid'),
  );
  return $schema;
}

This is not creating tables term_search & term_count ind DB. Any thing wrong in my code.


texts:
I am using taxonomy menu module but I want to change the taxonomy path from
 taxonomy/term/tid to subject/term title.


texts: How can I create a view that consists of images that trigger a gallery of images (grouped by node ID) in a colorbox?


texts: Custom SQL: nodereference joins and latest VID

texts:
I'm having a heck of a time constructing a custom SQL query.  The query has multiple nodereferences and needs to return the latest node revision.
I understand joins pretty well, but for some reason the added complexity of returning the latest revision is tripping me up.

I would prefer to go this route over creating views and executing them programmatically, just because of the complexity of the WHERE clauses.

I've tried translating the output of an equivalent View, but the prefixing that Views tacks on is making it a huge chore to comprehend.  My instinct is that it shouldn't need that many joins either.

Would love to see a generic structure that people might start with, or for conversation's sake here's a massively simplified version of what I'm working with.  This version is in a bit of flux, I think I have the latest revision covered but now person1Name, person2Name aren't returning anything.

SELECT event.nid AS eventnid,
       event.field_event_date_value AS date,

       event.field_event_person1_nid AS person1Nid,
       person1.field_person_name_value AS person1Name,

       event.field_event_person2_nid AS person2Nid,
       person2.field_person_name_value AS person2Name,
FROM {node} n

LEFT JOIN {content_type_event} event
    ON n.vid = event.vid

LEFT JOIN {node} refevent
    ON event.vid = refevent.nid

LEFT JOIN {content_type_person} person1
    ON refevent.vid = person1.nid

LEFT JOIN {content_type_person} person2
    ON refevent.vid = person2.nid


texts: How to render webform element in twig file template for HTML display

texts:
I want to override the HTML display for webform submissions. So, I have copy this file "webform-submission.html.twig" in my template folder and rename it in: "webform-submission--testform--html.html.twig"

Now, how do i print every element of my webform?
It is written in the file:

Available variables:

elements: An array of elements to display in view mode.

webform_submission: The webform submission.

webform: The webform.

I tried with {{ elements.surname }} but it doesn't work.

I also installed the TWIG module.


texts:
Is it possible to prevent content being served from redis for certain roles in drupal 8 ?
I am using pantheon.

Settings.php:

   // Configure Redis

if (defined('PANTHEON_ENVIRONMENT')) {
  // Include the Redis services.yml file. Adjust the path if you installed to a contrib or other subdirectory.
  $settings['container_yamls'][] = 'modules/redis/example.services.yml';

  //phpredis is built into the Pantheon application container.
  $settings['redis.connection']['interface'] = 'PhpRedis';
  // These are dynamic variables handled by Pantheon.
  $settings['redis.connection']['host']      = $_ENV['CACHE_HOST'];
  $settings['redis.connection']['port']      = $_ENV['CACHE_PORT'];
  $settings['redis.connection']['password']  = $_ENV['CACHE_PASSWORD'];

  $settings['cache']['default'] = 'cache.backend.redis'; // Use Redis as the default cache.

  // Always set the fast backend for bootstrap, discover and config, otherwise this gets lost when redis is enabled.
  $settings['cache']['bins']['bootstrap'] = 'cache.backend.chainedfast';
  $settings['cache']['bins']['discovery'] = 'cache.backend.chainedfast';
  $settings['cache']['bins']['config']    = 'cache.backend.chainedfast';
}


texts: How to show list & thumbnail widget in plupload?

texts:
I have installed the following modules:

FileField Sources Plupload, FileField Sources, Plupload module and added latest plupload library.

While uploading multiple files it is showing only list of files but its not showing the widget for thumbnail & list view.

So how to show that widget.


texts:
I was trying to google the method to install a patch file, but the results keep returning as "issues encountered while patching", which isn't what I am looking for.

I was wondering how to use drush to install a patch file?

More specifically, I'm currently encountering a Drupal for Facebook module issue, about the q variable.

One of the answers suggests installing a patch file. How do i install this patch file from the command line?


texts: How to hide 'add to cart' button on content type full view?

texts:
How to hide 'add to cart' button, on full mode view of a specific content type?
It has to be done on condition if product is purchased for this content type.

I tried to add custom field template but for add to cart button could not find the right template name. I also found out the field name which displays add to cart "field-product-ref" but the template field--field-product-ref.tpl.php is not working.
Need help in either identifying correct template name or any other approach which is correct?


texts:
I have simple form, two fields one is checkbox and second is text. When checkbox is checked.
Text field is required, and when checkbox is unchecked textfield shouldn't be required...

To perform this need with AJAX, i have my working example like below:

function mycustom_form($form, &$form_state) {

      $form['ask_required'] = array(
        '#type' => 'checkbox',

        '#title' => t('required'),
        '#default_value' => "",
           '#ajax' => array(
            'callback' => 'ajax_required_callback',
            'wrapper' => 'replace_reqired_div',
        ),
    );

       if (!empty($form_state['values']['ask_required']) && $form_state['values']['ask_required']) {
    $form['vin'] = array(
        '#type' => 'textfield',
    '#required' => TRUE,
        '#title' => t('VIN'),
        '#default_value' => "",
          '#prefix' => '
',
        '#suffix' => '
',
    );

  }else{

       $form['vin'] = array(
        '#type' => 'textfield',

        '#title' => t('VIN'),
        '#default_value' => "",
          '#prefix' => '
',
        '#suffix' => '
',
    );
  }

    $form['next'] = array(
        '#type' => 'submit',
        '#value' => 'Dalej >>',
        '#submit' => array('mail_form_submit'),

    );
    //    dpm($form);
    return $form;

}

function ajax_required_callback($form, $form_state) {

     return $form['vin'];
}

Is there any more elegant way e.g. to change attributes of field not whole VIN field?

Second thing is that when i place above code in ...form_alter, its not working..., there are fields there is ajax callback but required star is not changed

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

    if ($form_id == 'user_register_form') {

        $form['account']['name']['#description'] = t('');
        $form['account']['mail']['#description'] = t('');

        $form['ask_required'] = array(
            '#type' => 'checkbox',
            '#title' => t('required'),
            '#default_value' => "",
            '#ajax' => array(
                'callback' => 'ajax_required_callback',
                'wrapper' => 'replace_reqired_div',
            ),
        );

        if (!empty($form_state['values']['ask_required']) && $form_state['values']['ask_required']) {
            $form['vin'] = array(
                '#type' => 'textfield',
                '#required' => TRUE,
                '#title' => t('VIN'),
                '#default_value' => "",
                '#prefix' => '
',
                '#suffix' => '
',
            );
        } else {

            $form['vin'] = array(
                '#type' => 'textfield',
                '#title' => t('VIN'),
                '#default_value' => "",
                '#prefix' => '
',
                '#suffix' => '
',
            );
        }
    }
}

why?


texts: Why can't I update core from 8.6.16 to 8.7.1?

texts:
I need to update my Drupal 8 site from 8.6.16 to 8.7.1, but when I run composer update drupal/core --with-dependencies it says "Nothing to install or update". I have been banging my head on the wall about this for 45 minutes, and haven't found anything on Google that fixes this.

Does anyone know why it says there is an update, but then says there is nothing to update or install?


texts: Custom home page not recognized by system

texts:
I have set up a Drupal 8 site with a custom home page using page--front.html.twig. The content displays at domain.com/front. When I go into Administration to change to the new home page, it says that the path is invalid. I've also tried leaving the field blank.

I also noticed that when I'm on /front, the browser tab displays "Page not found".

I've cleared the cache repeatedly (and every time it sends me to /user/1).

What am I missing here?


texts: How to load the images in views using ajax?

texts:
There is a website with rich content (high resolution images).

I wish to load that view block contents (3 view blocks), but not the image, during the page load. Image should load in AJAX after the page load, without any external DOM element trigger. How can I achieve that?

Note

The whole point is increasing the performance without giving up on the functionality.


texts:
i tried to update file cck field of a content type as below from another node as below.

<form action="" method="post" id="tfrm" enctype="multipart/form-data">
    <input id="tf" name="tf" type="file" />
    <input id="btn" type="submit" value="Submit" name="btn" />
</form>
<?php
if($_POST['btn']){
$node=node_load(32);

$filename = basename($_FILES['tf']['name']);
$image = file_get_contents($_FILES['tf']['tmp_name']);
$file = file_save_data($image, 'public://' . $filename, FILE_EXISTS_RENAME);
$filesinfo = (object) array(
          'uid' => 1,
          'uri' => $file->uri,
          'filemime' => file_get_mimetype($file->uri),
          'status' => 1,
 );
$node->field_ftest[LANGUAGE_NONE][0]=(array)$filesinfo;
print_r($filesinfo);
  node_save($node);

}
?>

file gets uploaded but results error in updating file field .

localhost
Error
The website encountered an unexpected error. Please try again later.
Error message

    Notice: Undefined index: fid in file_field_presave() (line 219 of C:\xampp\htdocs\drupal\modules\file\file.field.inc).
    Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 173 of C:\xampp\htdocs\drupal\includes\entity.inc).
    Notice: Trying to get property of non-object in file_field_presave() (line 220 of C:\xampp\htdocs\drupal\modules\file\file.field.inc).
    Warning: Creating default object from empty value in file_field_presave() (line 221 of C:\xampp\htdocs\drupal\modules\file\file.field.inc).
    Notice: Undefined property: stdClass::$uri in file_save() (line 601 of C:\xampp\htdocs\drupal\includes\file.inc).
    Notice: Undefined index: fid in file_field_update() (line 261 of C:\xampp\htdocs\drupal\modules\file\file.field.inc).
    Notice: Undefined index: fid in file_field_update() (line 287 of C:\xampp\htdocs\drupal\modules\file\file.field.inc).
    Notice: Undefined property: stdClass::$fid in file_usage_add() (line 685 of C:\xampp\htdocs\drupal\includes\file.inc).
    PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'fid' cannot be null: INSERT INTO {file_usage} (fid, module, type, id, count) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => file [:db_insert_placeholder_2] => node [:db_insert_placeholder_3] => 32 [:db_insert_placeholder_4] => 1 ) in file_usage_add() (line 692 of C:\xampp\htdocs\drupal\includes\file.inc).


texts: I can't get the summary field of a custom content type to appear in the search result

texts:
I've been trying to get my custom content type to have its summary field display in my site search. Other content types like articles will display a summary, but my custom one won't. I've checked the search api settings and it displays everything as a listing.
Checking the display fields of the content type (/admin/structure/types/manage/custom-type/display/listing) shows that the summary field is selected as content to display.
Looking at the search api settings (admin/config/search/search-api/index/content/fields) doesn't show anything unusual. The field that I want to appear is listed on this page.
The only thing I could think of is that the search api block (/admin/structure/views/view/search_api) has the show field as a custom rendered entity. I've noticed that if I set the custom rendered entity to display the custom content type as "default" instead of "listing", then it will display everything on that node's page, which isn't very useful. However, it does contain the summary field, so I feel confident the problem does not lie with the summary field.


texts: Restrict view access of a group content node based on OG role

texts:
I'm using Drupal 7 and Organic Groups along with a number of popular contributed modules. My situation:

I have a group called 'Project'. There are multiple group roles that have access to this group; 'administrator', 'client' and 'contractor'.

There is also a group content node called 'invoice' targetted to the 'Project' group node.
How can I restrict a user from viewing invoice nodes that has been assigned the group role 'contractor'? I don't want to manage this through the User Permissions as a user may have different access rights to different projects, hence the requirement for viewing group content managed via OG roles.

Many thanks


texts: Social Networking buttons in a list of teasers generated using views

texts: I have generated a list of blogs with title and teaser , with a pager also , using views. I need to display social buttons like share on Facebook, twitter etc on each items of the list. How can this be implemented?


texts: In Drupal 6 there was the Modal Frame API which made it to Drupal 7 core. However, I'm not sure how leverage the Overlay independent of being an administration screen. Is there any information about this?


texts: How to conditionally show a views field?

texts:
I'm using the video and video embed field modules to display uploaded video and embedded youtube videos. I've added a video field and video_embed field to the video content type.

The user either uploads a video or embeds a video with the node.
A custom form validation makes sure that either a video is uploaded or embedded.
I have a template override for the video content tpl.php to hide an empty field on the node display page.

I'm using views to show various video previews. Both fields are added to the view and it shows up fine to the user. However, I'm getting a lot of "Unable to find the video thumbnail for ..." in the log. Those are errors when I have a youtube video embedded and nothing uploaded.

To come to the point:
How can I suppress the video thumbnail from showing in the view when no video is provided. The "Hide if empty" no results setting isn't doing the trick here.


texts: Views Display for a query that doesn't display view content to user

texts:
I need a views display type that will not output content to the user.

Essentially, I've got a view that simply performs a query, and I get the results of the query with views_get_view_result() and then emails the results of the query to a user with a spreadsheet.

It's being run during cron, so I have to turn off access checks for access, or the query displays no results.

Though I could use an alternate access check that ensures the view is being run during cron. Any ideas, Drupalers?


texts: I have a code where view is rendered programatically and it contains an image field. However usually images are coming from nodes where different image style is applied so location of image is in different folder. If I preview the view manually style is applied and images appear in the proper styles folder but if this is executed by code it doesnt happen. Anyone with ideas how easily to trigger application of image styles from the code without walking each returned image field, checking is image style applied and so on.


texts:
I'm work on updates modules in my drupal site. When i access localhost/authorize.php after linked in config, i recieve this:

Update failed! See the log below for more information. Your site is still in maintenance mode.

the log is...

views

    Error installing / updating
    File Transfer failed, reason: Unable to change to directory /drupal/sites/all/modules/views

views_bulk_operations

    Error installing / updating
    File Transfer failed, reason: Unable to change to directory /drupal/sites/all/modules/views_bulk_operations

webform

    Error installing / updating
    File Transfer failed, reason: Unable to change to directory /drupal/sites/all/modules/webform

jquery_update

    Error installing / updating
    File Transfer failed, reason: Unable to change to directory /drupal/sites/all/modules/jquery_update

simplenews

    Error installing / updating
    File Transfer failed, reason: Unable to change to directory /drupal/sites/all/modules/simplenews

entityreference

    Error installing / updating
    File Transfer failed, reason: Unable to change to directory /drupal/sites/all/modules/entityreference

ctools

    Error installing / updating
    File Transfer failed, reason: Unable to change to directory /drupal/sites/sites/all/modules/ctools

entity

    Error installing / updating
    File Transfer failed, reason: Unable to change to directory /drupal/sites/all/modules/entity

I have tried to fix permissions in folder using:
sudo chmod a+w and
sudo chown root sites/default and chmod 777 , every using folder sites/default and sites/all/modules, but i canot successfuly updates my modules using ftp and automatic.... how i fix this? thanks in advance


texts: Drupal 7: how to relate between 2 exposed filter, when one work stop the other?

texts:
I have two unrelated exposed filters in my view, one are completion for the other but in another design, like this:

and I want one filter work every click, which mean when click 'computer', only computer result  will display ,then when click 'physics', only physics result will be display .. so How can i stop one when the other work???

thank you


texts: Can I setup this contexual filter in a better way?

texts:
I have a 2 content type:
 - Organization
 - Department (the Departement have an entity reference to an Organization)
and the user have entity reference to an Organization too.

I want to build a view that show me the department of the Organization of the logged used.
I add a php contexual filter:

global $user;
$user_fields = user_load($user->uid);

return $user_fields->field_organization['und']['0']['target_id'];

and it works.

But i'm wondering: is this the only way to do that on Drupal 7? There is a better solution?
I know that insert php code in db is not a good idea but how can I do this view without doing this?

Thank you


texts: Form API multiplie file upload validation error

texts:
I have a simple form with a multiple file upload field. I am trying to validate the documents against extensions and file size. The validation seems to work, but now if I don't select any file (field is not required), the validation fails and I get an error:

  Fatal error: Call to a member function getError() on a non-object in /home/www/test/core/modules/file/file.module on line 726

Here is my validation function:

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

  $validators = array(
    'file_validate_extensions' => array('pdf doc docx xls xlsx txt jpg jpeg png gif'),
    'file_validate_size' => array(7 * 1024 * 1024), // 7MB file size limit
  );

  /** @var File[] $documents */
  $documents = file_save_upload('documents_upload', $validators, 'public://');
  $error = false;
  if(null !== $documents) {

    foreach($documents as $i => $document) {
      if ($document === FALSE) {
        $error = true;
      }
    }

    if ($error === true) {
      $form_state->setErrorByName('documents_upload', 'Error: could not upload file.');
    }
  }
}

Any idea?


texts: Show node for specific content type using views contextual filter

texts:
Let me explain the issue in detail. I have created two views. The first view displays listing of content for content type named Invoice. The View has a page display. This view is working fine.

I want when a user clicks on any content item the resulting page should use the another view which I have created to show the items for a specific content item based on the node id passed.

How to pass the node id as a contextual filter for second view. I have given the path for second view as node/%, but then the view just work for all content types. I don't want that thing to happen. I just wants to have that view called for Invoice content type items.

I have also used validation criteria for contextual filter, but that doesn't work.


texts: Help with finding field reference to node title within webform select options view? field reference issue

texts:
so I'm trying to implement a similar "sample request" feature like the one in Drupal Steve's tutorial. Drupal 7 Sample Request.

The issue I'm having is that I'm not sure how the field reference is made to the node title within my view. Right now the select list is being generated and is available to my webform, but the list appears unpopulated. I'm provided with an empty select list widget, but no actual options to select

The issue is that the view itself is of a custom commerce content type "posters," with a relationship set on flag, such that I'm not sure what the field reference is to get the title field from my view. Steven mentions reference the node's owner, but I'm not sure what that means. Here is the code from Steve's implementation modified to meet my needs. I basically want to know how to pull the title field out of the view of flagged items, just no idea where to find what the reference to that would be...

    function webform_hook_webform_select_options_info() {
   $items = array();
   if (function_exists('webform_hook_user_flag_sample_requests')) {
     $items['webform_hook_user_flag_sample_requests'] = array(
      'title' => t("Sample Requests (User Flag list)"),
      'options callback' => 'webform_hook_user_flag_sample_requests',
     );
   }
   return $items;
 }
 function webform_hook_user_flag_sample_requests() {
   $view = views_get_view('webform_flag_views', TRUE);
   $view->set_display('webform_options');
   $view->execute();
// dpm($view);
   $options = array();

   if ($view->result) {
     $row_class = $view->style_options['row_class'];
     $attributes = $row_class ? " class='$row_class'" : '';
     foreach($view->result as $item) {
       $options[$item->nid] = '' . render($item->field_field_img[0]['rendered']) . ' ' . $item->field_title . ' (' . $item->node_title . ')' . '';
     }
     dpm($item);
   }
   else {
     $options[0] = t("Nothing");
   }
   dpm($options);
   return $options;
   }

Here is the result of my dpm statement on the $item variable

(Object) stdClass
    commerce_product_title (String, 9 characters ) The Rapid
    product_id (String, 3 characters ) 354
    field_data_field_image_commerce_product_entity_type (String, 16 characters )       commerce_product
    _field_data (Array, 1 element)
    field_field_image (Array, 1 element)
    field_field_img (Array, 1 element)

I've tried most of the obvious options, but I've been hitting a brick wall.

The DPM of the $options variable only returns the a tag

... (Array, 1 element)
(String, 11 characters )  ()

Again, many thanks in advance.


texts: Combine Webforms to export multiple form results in a single CSV

texts:
I need to be able to select multiple webforms and then be able to export all of their results in a single CSV download.

I am considering using this module (Views data export) but I'm not yet sure it will fit the task.

Any suggestions on the approach you would take would be appreciated.

UPDATE:
I approached this using the 'Webform Mysql Views' module but the process is incredibly time consuming as each Webform needs to have a view created for its submissions. These fields then need to be associated in the Webform Submissions view and duplicate fields need to be merged.


texts: How to map path aliases when migrating from Drupal 6 to 8?

texts:
When migrating from Drupal 6 to 8 i can simply map path aliases with the mapping:

process:
  path: alias

I have the problem that the path alias is not set properly when pathauto is activated for a node-type. The alias always gets generated automatically instead of using the old alias. How can I override this behaviour?


texts: Get render array or output for any route I pass?

texts:
I need the ability to get the rendered HTML output or even just the render array simply by passing the route and nothing more.

Is this possible?  Can't seem to find any way to do this.

Thanks

EDIT: more info on what we are trying to do:

We are using the elasticsearch_connector module and we want to index pages created via views or via custom modules.  There are a list of about 10 items specifically we want to index so that they are returned via search results.

None of the things we are trying to index return anything different depending on whether we are logged in or not.  None of them require parameters, either.

If there's a better way to handle this other than just indexing the rendered HTML directly to elasticsearch, that would be great if someone could help with that, too.


texts: Message showing You are not authorized to access this page

texts: I have checked access content permission for both anonymous as well as authenticated users. But when i access a node content without logging in it shows the message "You are not authorized to access this page". Could i reset permission to default permissions. Any idea what is going wrong


texts:
I had an issue in my project, so I changed some code in one of contribute modules I was using. Once the change was done and it was all okay, my client asked to put it on drupal.org for their reference and for future help.

I have created the patch from the changes I have done. I applied it to a fresh clone of that module. I got a successful message saying Patch applied very cleanly.

When I uploaded the patch to community, It showed D7 CI error in test.

I researched about this "D7 CI error", but I didn't find anything.

What does that error mean? How can I fix it?

In https://www.drupal.org/node/1263934/qa, I am getting the same error message, even if I created ex novo the patch using a fresh copy of the module files I cloned from the project repository.


texts:
Iam new to drupal 8 and I was wondering if one can alter the html output once before it gets injected into the twig template file.
In my case I would like to remove some classes and add some tags to the search.
Could anyone provide some guids or documentation on how to do such things? That would be very helpful, just found some drupal 7 things on it, but they seem to be outdated.

Thanks in advance!


texts: On Rules Event Present Splash Screen To Flagged User

texts:
Hello i was wondering what would be the best path to take to achieve my goal. I am working on a website. I am using Rules and Flag modules. I was hoping to set up a rule that when a member has been flagged then an event would happen that would be like a big cartoon splash YOUVE BEEN FLAGGED (with an image and maybe possibly sound)

Im sure that this could be within the scope of drupal. Could anyone suggest a possible way of doing this?

Thanks


texts: Installing new module in Drupal 8.3.2 link is not exist in xampp

texts: I installed drupal 8.3.2 in xampp (localhost). But i can't add new modules like themes,image slider etc.. What I want to do?


texts: Accessing values entered in custom fields added to install_configure_form

texts:
In my installation profile, I have added a text field to the install_configure_form by including:

if (!function_exists("system_form_install_configure_form_alter")) {
  function system_form_install_configure_form_alter(&$form, $form_state) {
    $form['site_information']['site_name']['#default_value'] = st('Organization name');
    $form['site_information']['org_short_name'] = array(
      '#type' => 'textfield',
        '#title' => st('Short name'),
        '#description' => st('This will be used as a casual reference to the association throughout the site. If left blank, the Site name will be used.'),
      '#attributes' => ['placeholder' => 'e.g. FBI'],
        '#size' => 60,
        '#maxlength' => 60,
    );
    // Move the email to the bottom
    $form['site_information']['site_mail']['#weight'] = 1;
  }
}

Now, I'm trying to read and persist what the user entered using a _submit function:

function my_profile_install_configure_form_submit(&$form, $form_state) {
  $values = $form_state['values'];
  $name = !empty($values['org_short_name']) ? $values['org_short_name'] : $values['site_name'];

  variable_set('short_name', $name);
}

Unfortunately, I don't think the my_profile_install_configure_form_submit function is getting called because the short_name is not getting created. How should I be accessing and persisting the custom elements in that form?

Thanks!


texts:
So I'm struggling with the concept of trees in Drupal. I have a form that presents a user with a drop down of number 1 - 27 depending on what they pick the form renders out an equal number of text fields. The goal is to collect all the values put into the text fields into an array even if it's a single element. Right now all that seems to happen is the last field is written as a string to the variable.

What I have:

if (!isset($form_state['values']['number_subscribers'])) {
$form_state['values']['number_subscribers'] = 0;
}

for($i = 0; $i < $form_state['values']['number_subscribers']; $i++){
$form['subscribers_wrapper_container'][]["#tree"] = TRUE;
$form['subscribers_wrapper_container'][]['UCM_SUB'] = array(
'#type' => 'textfield',
'#size' => 30,
'#title' => t('Subscriber IP Address'),
'#required' => TRUE,
);
}

End goal would be to read $form_state['values']['UCM_SUB'] and have it return an array.


texts: Load a custom block and render with subset of data

texts:
I am loading a block programmatically in a theme preprocess function, and trying to render that block in twig using without to remove some fields. However, the block is still printed in full.

This is the code I am using.

function my_preprocess_node(&$variables) {
    $footer_narrow = \Drupal\block\Entity\Block::load('my_block');
    $variables['my_block'] = \Drupal::entityManager()
      ->getViewBuilder('block')
      ->view($my_block);
}

The template code is the following one.

{{ my_block|without('field_1', 'field_2') }}

I also noticed while debugging, that while the result in twig of my_block is a render array, it does not include the keys I'm expecting (the problem, I assume?).

This is the dump() output.

array(3) {
  '#cache' =>
  array(4) {
    'keys' =>
    array(3) {
      [0] =>
      string(11) "entity_view"
      [1] =>
      string(5) "block"
      [2] =>
      string(17) "my_site_footer"
    }
    'contexts' =>
    array(3) {
      [0] =>
      string(28) "languages:language_interface"
      [1] =>
      string(17) "my_theme_section"
      [2] =>
      string(14) "my_theme_site"
    }
    'tags' =>
    array(2) {
      [0] =>
      string(10) "block_view"
      [1] =>
      string(36) "config:block.block.my_block"
    }
    'max-age' =>
    int(-1)
  }
  '#weight' =>
  int(0)
  '#lazy_builder' =>
  array(2) {
    [0] =>
    string(42) "Drupal\block\BlockViewBuilder::lazyBuilder"
    [1] =>
    array(3) {
      [0] =>
      string(17) "my_site_footer"
      [1] =>
      string(4) "full"
      [2] =>
      NULL
    }
  }
}


texts:
I would like to sort my results by proximity in Drupal 7 Views.

I have already read the geofield proximity in views topic.

But that tutorial is using a location provided by the user (exposed filter) and I would like to use the location provided by the HTML5 API call for an anonymous user, and want to order the results by distance.

Using the "current user" as source does not work, although the page asks for location from the browser.

Any help would be appreciated!


texts:
I manage a drupal 6.x site for someone, sometimes some weird content is posted which is a mixture between Dutch, English and vague words. E.g:

  Ik ARE-op zoek WHAT

We delete these kinds of messages and contact the owner of the post, as they're not really spam but just ... weird messages. This happened a couple of times now.

According to the owners, they have not posted the message in that way (which I highly doubt). So my question is; has anyone ever ever heard of Drupal changing messages that way? Perhaps through some kind of translating feature?


texts: How do I get queries and query count for a page?

texts:
In Drupal 7 the query log of the Devel module contained a table which had a query log with a much better overview than what Webprofiler is offering for Drupal 8.

In Drupal 8 there's no aggregation or sorting possible. (How many of the same queries are there? How much time are they taking? Which is the heaviest query to address?)

Is there a better view for Drupal 8 than this one?


texts: How can I place a link to flag a user inside an e-mail sent by rules?

texts:
I have an "abuse" flag and I want users to be able to flag abusive users via e-mail. I have been consulting the documentation for adding flag links to pages.

Problem No. 1: I can't get the link to generate properly in the message.  My code, placed in the Message field of the rules Send mail action, looks like this:

REPORT ABUSE:
<?php
$account = $node->uid;
print flag_create_link('abuse', $account); ?>

The $node variable is provided for PHP evaluation by the rules module itself.  I checked the value of $node->uid by printing it out and it is printing the correct UID value.

However, this generates a link that looks like this:
flag/flag/abuse/6?destination=node/add/ad-reply%3Ffield_reply_orig_node%3D7&amp;token=EYchAT6nusUXcMtnoLwA2vrGb5bphDX0oGQmjBV3LC4

And gives the error:

  Bad token. You seem to have followed an invalid link.

How can I print a flag link in the e-mail?

Problem No. 2: E-mails are sent in plaintext, but flag_create_link() generates an HTML link.  At worst, I can live with this.


texts: How can I setup multiple database connections?

texts: Can anyone help me to setup connection with multiple databases connection in Drupal 8? I have database on the same server and I want to access it along with default Drupal 8 database.


texts: How to display a Views block based on the current page?

texts:
I've created a new content type "banner" (title,description, image, price) that I would like to display on certain pages (limited to parent pages). I'm using the Views module and was looking for a contextual filter or something like that but I'm a noob at Drupal and can't figure out my way.

For example, I have 2 content types: rooms and activities, 2 page listings respectively my rooms and my activities and finally I've created two banners, banner-rooms and banner-activities.

How can I create a Views block which displays the right instance according to the current page ? How can I limit it to the parent page (ie: do not display the banner on rooms/roomA, only on rooms)?


texts: How can I get a views exposed filter to persist across multiple views?

texts:
I have 2 separate views that return a set of results for each of my content types. The fields are different, but the filters are exactly the same - Sort by Location / Distance. This Distance / Proximity filter is exposed, and it is set to 'remember' the last entry. I followed the tutorial here http://drupal.org/node/359463 to be able to filter results by distance. It works great.

In views, to remember the last entry, Views uses sessions. But, each view has its own individual $_SESSION variable. That means what I set for one view does not carry over to the next, and even each view can have different values, which is not what I want. Here is a dump of the session after they have been set:

[views] => Array
    (
        [search_pages] => Array
            (
                [default] => Array
                    (
                    )

            )

        [baby_clothes_pages] => Array
            (
                [default] => Array
                    (
                        [distance] => Array
                            (
                                [postal_code] => 11211
                                [search_distance] => 100
                                [search_units] => mile
                            )

                    )

            )

        [baby_gear_pages] => Array
            (
                [default] => Array
                    (
                        [distance] => Array
                            (
                                [postal_code] => 22343
                                [search_distance] => 100
                                [search_units] => mile
                            )

                    )

            )

    )

What I would like to do is create a small module or snippet of code that will simply allow someone to type in their 5 digit zip code and then it update all the values across all my pages with this filter. If it is changed on any page, then it changes it for the rest of the pages as well. It also needs to work so that it affects the results on the next page load so that it correctly shows them filtered.

Here is a snippet of code I was experimenting with to try to set this value, but it's the wrong direction.

 $all_views = views_get_all_views();            // get an array of all views in use on the site

foreach ($all_views['category_pages']->display as $key => $value) {
 //check to see if the structure exists I am looking to modify
if(array_key_exists('postal_code', $all_views['category_pages']->display[$key]->display_options['filters']['distance']['value'])) {

//if so, set its value
$all_views['category_pages']->display[$key]->display_options['filters']['distance']['value']['postal_code'] = '28152';

//try setting the session instead
$_SESSION['views']['category_pages'][$key]['distance']['postal_code'] = '28152';
    }

What's the correct direction? How do I get this value changed? Could it be done in the template.php file with preprocess function? Should I do it in a module, and if so, what do I need to alter?

Very lost at this point. Thanks for the direction!


texts: Search text box for Search API + Database + Search Views + Facets API + Facets Bonus

texts:
I have check boxes and radio buttons (after a few patches) in my facets, using Search views.  I want to be able to present the user with a text search box so they can search for a title and another text field.  I can't seem to find this, however.

Do I need to create a new facet, or am I just missing this functionality?


texts: How to allow drupal/core-composer-scaffold to copy files in dev but not live site

texts:
How can I have drupal/core-composer-scaffold behave differently when doing composer install on my live and my dev sites?

my live site's sites/default directory and its contents are write-protected. my dev site is not write-protected. I do not wish to copy all scaffolding files into the live site; but I do on the dev site.

The following is overkill as it prevents the latest scaffolding files being copied into the dev site as well as the live site.

"extra": {
        "drupal-scaffold": {
            "file-mapping": {
                "[web-root]/sites/default/default.services.yml": false,
                "[web-root]/sites/default/default.settings.php": false
            },
            "locations": {
                "web-root": "web/"
            }
        },


texts:
I want to make some rules in twig based on current page path. To be precise I want to make the page template look a little different when node is in edit form, revision history page and translation overview.

I want to do something like this, but doesn't seem like working;

{% if path('<current>') is path('entity.node.edit_form') %}

I want to make rules for all these paths;

entity.node.edit_form
entity.node.version_history
entity.node.revision
entity.node.content_translation_overview
entity.node.content_translation_add
entity.node.content_translation_edit

Are all available at any page template where a node will be rendered?


texts: Edit the picture field of registration form

texts:
I am building a Drupal 7 site, and using the Hybridauth module and Media module

When user login with Hybridauth - their picture is saved under the core picture field of the user registration. Thus, I can't create new image field for the user registration form.

I used the reg with pic module to allow users that register in the normal way, through the registration form, to upload their picture.

Now, I want to use the core Image type field on the core picture field of the user, so I can edit the picture field. In addition, it will be great if I could use the media module on this picture field of the users, for better experience when uploading pictures in the registration form.

How can I change the picture field of the users to be "Field Type: Image"?
How can I use the media module with it?


texts:
For a website I need to show nodes with a flexible grid. There will be several rows (no specific number) and each row can contain:

1 full width image
2 50% width images
1 50% width image (left/right) and 1 50% width text block
1 full width text block

The administrator should be able to change the order of these blocks easily. I'm planning to do this with the Field Collection module, I think with this I can get this to work. But i was wondering, is there a better way to do this?

Here are two examples of what the node could look like, but ofcourse there are hundreds of different options.


texts:
I want to get:

/mytheme-directory
  /front-slides
    /views-view--front-slides--block.tpl.php
    /views-view-unformatted--front-slides--block.tpl.php
    /views-view-fields--front-slides--block.tpl.php
  /front-4-cats
    /views-view--front-4-cats--block.tpl.php
    /views-view-unformatted--front-4-cats--block.tpl.php
    /views-view-fields--front-4-cats--block.tpl.php

instead:

/mytheme-directory
  /views-view--front-slides--block.tpl.php
  /views-view-unformatted--front-slides--block.tpl.php
  /views-view-fields--front-slides--block.tpl.php
  /views-view--front-4-cats--block.tpl.php
  /views-view-unformatted--front-4-cats--block.tpl.php
  /views-view-fields--front-4-cats--block.tpl.php

Can I use different 'template path' or do something else? easy way please :)


texts:
I keep getting the following error for some reason:

  Fatal error: Cannot redeclare media_views_invalidate_cache() (previously declared in /var/www/html/sitename/sites/all/modules/media/media.views.inc:140) in /var/www/html/sitename/profiles/dkan/modules/contrib/media/media.views.inc on line 140

Is there any reason I'm getting the error?

I'm using Drupal 7.54.


texts:
I need to implement two select field in a content type.Currently cck modules allows only one select field. So how can I implement two select fields using cck.

Eg:- select field value for months and year.

Tks in adv
Vil


texts: Make feeds importer to replace instead rename file path

texts: I am using commerce_feeds module to import products. It works well except the image fields url gets renamed by adding _0, _0_5, etc at the end of the image paths. How to turn this off? I would like to have path the same at all times no matter if the file is present with the particular path or not. Thank you for any help you can give in this regards.


texts: Order won't programmatically mark as completed

texts:
I am struggling to get an order to be marked as completed in Drupal 7 Commerce.

Customers will go through the checkout process inside of Drupal, gets marked as "Awaiting shipment" (a custom order status), but then a fulfillment team goes through a different program and the order should be getting updated programmatically as "Completed".

However, when I use commerce_order_status_update it doesn't seem to want to get marked as completed.

Here is the code I am working with:

$order_entity = commerce_order_load($orderId);
commerce_order_status_update($order_entity, 'completed', false, true, 'Order updated via warehouse');
watchdog('warehouse', 'Order status updated %o', array('%o' => $order_entity->status)); //Does not equal 'completed'

I know this code is firing because of two reasons:

When I set 'completed' to be different status messages, it works
I see the revision message "Order updated via warehouse", but the status has not changed.

Is there something I have missed? Am I marking the order as completed in a wrong way?

I have also tried EMW

$order_wrapper = entity_metadata_wrapper('commerce_order', commerce_order_load($orderId));
$order_wrapper->status->set('completed');
watchdog('warehouse', 'Order status updated %o', array('%o' => $order_wrapper_status->value())); // Does not update to 'completed'
$order_wrapper->save();

EDIT
I added the watchdog statements that I have used to echo out of the operation was successful.
It should also be noted that there are no Rules modifying the order status at this point. I have gone through my list of Rules and verified that nothing is modifying it, and the order history shows no new revision created from Rules.
Error logs also show no error happening on save process. The operation is successful if I change 'completed' to any other status.


texts: Using Bootstrap theme and anonymous user, ajax form submit results in "call to undefined function bootstrap_form_process"

texts:
Context

We have a subtheme based on the Bootstrap theme and we're rendering a form inside of a modal. The submit button uses an ajax callback to handle form submission.

Problem

When logged in as an admin in Chrome, the form submits perfectly.

When logged out (accessing the site as an anonymous user) in Chrome, submitting the form results in a 500 Server error.

The server logs are reporting "Call to undefined function bootstrap_form_process()".

Research

It seems that this might be related (https://www.drupal.org/node/2156371) but I'm not sure what to do to fix it.

I have a hard time following issue discussions on drupal.org. I have a decent amount of Drupal knowledge, but still struggle to figure out what they are saying.

Things I've Tried

Some people in the thread linked above got around the issue by setting max_input_vars to 2000, so I gave that a shot. It didn't help.

I thought maybe I needed to increase it even more, so I set it to 5000, but still no change. I then switched it back to the default 1000.

I also tried adding "drupal_static_reset('element_info');" to my theme's template.php file, but it didn't seem to do anything.


texts:
Team,

I'm trying to Clone my Cloud website and use it in Dev desktop.

I have generated 4096 keygen and add public key in Acquia Cloud.

I am using Latest Acquia Dev Desktop on Windows 10.

I am getting below error-

  Blockquote
  SSH authentication failed, please provide another key- Acquia
  Blockquote

Anyone facing similar issue?

Thanks,
SS


texts: Show markers on gmap from all nodes exposed in view

texts:
I'm using gmap module to mark job locations on a map. It now shows all locations of content type: jobs. Is there any way I can only mark the displayed jobs from my view block? I filter the jobs through exposed filters.

EDIT:

Just going to add this code here, might be useful for some. It puts the attachment in a block so you have more control over it.

<?php
//Puts gmap attachment in block so it's easier to theme

function gmap_block_block_info() {
  $blocks['gmap_attachment'] = array(
    'info' => t('Gmap Attachment'),
    'cache' => DRUPAL_NO_CACHE,
  );
  return $blocks;
}

function gmap_block_block_view($delta = '') {
  $block = array();
  if ($delta == 'gmap_attachment') {
   // $block['subject'] = t('Gmap Attachment');
    // Load the view.
    $view = views_embed_view('jobs_view_block', 'gmap_attachment');
                        //('machine_name_view', 'machine_name_display)
    if ($view) {
      $block['content'] = $view;
    }
    else {
      $block['content'] = t('The view is empty');
    }
  }
  return $block;
}


texts: How to set up no result behavior of View field that uses "Views field view"?

texts:
Im using "Views field view" module to display a secondary view inside a main view. The secondary view has a contextual filter. The problem is that when Im trying to set up no result condition it doesnt show up. I have tried this cases:

Secondary view no result: nothing

Main view no result (In settings of the field with sec. view): text

Output: nothing
Secondary view no result: 0

Main view no result (read "0" as no result option enabled): text

Output: nothing
Secondary view no result: text

Main view no result: nothing

Output: text

In the last case views display the text but if it is an html with arguments from the main view the tokens wont be converted.
If no result case is set to display 0 it will display nothing.

Views           7.x-3.0-rc3
Views Field View    7.x-1.x-dev
Drupal          7.9