texts: How to hide taxonomy terms from node display and still have them indexed by Drupal search?

texts:
I use content type with a term reference field.
I would like users to search by taxonomy terms in that field so I keep the field visible in the main node display.
However due to other reasons I would like to hide these terms from the view but keep the content searchable by these terms.

For example I would like to have synonyms searchable I will keep in my term reference field but I don't want users to see all possible variant of the word.

How to hide taxonomy terms from the node display and still have them indexed by Drupal search?


texts: How to make CSS and JS both load in the footer

texts:
We have a library slick_carousel in our mytheme.info.yml and mytheme.libraries.yml defined in our sub-theme (see below).

How can we make the CSS and JS both load in the footer? Currently only the JS file is showing in the footer.

Current mytheme.libraries.yml:

slick_carousel:
  css:
    theme:
      //cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css: { type: external, attributes: { async: true } }
  js:
    //cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js: { type: external, minified: true  }
  dependencies:
    - core/jquery

We have tried, but didn't work. We need to do this without a module.

Removing dependency on core/jquery.
Change theme to component under css.


texts: How do I set up a Drupal view with two relationships?

texts:
I have "Event," "Session," and "Download" content types. Events can have many sessions, and each session can have many downloads. I have used node references to link the downloads to the sessions, and sessions to the events. Can I create a view of the downloads which will show session information and also the event information? I know I can use a relationship to link two node types in a view, but can I do it for three node types?

I'm using Drupal 7, and Views 3.


texts: how to show teaser view of my content types in search result page in drupal 7

texts: I have customize my teaser view of my content types. Now i want to show that teaser view in search result page also. How can i do this? If anyone can give me a example with code will great help.


texts: How to customize the front page for each user of specific role?

texts: For my Drupal 8 website I would like to display for the user after login some page  /related-content/% where % is a contextual filter and needs to be replaced by the current user id. I have downloaded some modules (Login destination, User Default Page, Home links) to customize the front page per user role. But I can't figure out how to use the token [current-user:uid] in the right way to display customized front page per user.


texts: I've get CSRF token from url /rest/session/token. After have CSRF token, I can send request (get, post) to API and working fine. But after time, when I send request. It's doesn't work. I'm getting error permission denies. I think maybe CSRF token expire time. So I want know time life of CSRF token. And how to change time life of CSRF token.


texts:
Before running a User migration, I need to get some additional information. As stated on Events added to the migration process, it should be implemented using events; an example can be found on Migration pre-import event/event-listener.

Let's say I got my information in my EventSubscriber class. How do I access this data in the migration class?


texts: entityFIeldQuery on user table, how can I add a condition for $user->data

texts:
I have tried extending EntitiyFieldQuery to add a condition that would be able to match on a $user->data["somevar"], but to no avail. I am not sure this is even possible, as  $user->data is serialised.

I have just the base class working, returing users with status set to 1:

class SubscriberEntityFieldQuery extends EntityFieldQuery {
  // define some defaults for the class
  public function __construct() {
    // now we don't need to define these over and over anymore
    $this
      ->entityCondition('entity_type', 'user')
      ->propertyCondition('status', 1);
  }
}

Would anyone have an idea if this is even possible? Or would I need to resort to using db_query for a case like this?


texts: Drupal mobile theme doesn't display image

texts:
I am working on a mobile version of a drupal  website and I am using mobile tools to switch theme between desktop version and mobile version based on url. I am using fusion mobile theme on the mobile side.
Now the matter is that no images are displayed in views in the mobile version. There is some kind of filtering that disables images on the theme but I can't find out where is that.


texts:
I have a link that uses Drupal's use-ajax CSS class to AJAX-load some node teasers. The callback for the link uses arguments to set a range in the Entity Field Query used to return the teasers:

function marketplace_ajax_list_menu() {
  $items = array();
  $items['marketplace_ajax_list_callback/%/%/%'] = array(
    'page callback' => 'marketplace_ajax_list_response',
    'page arguments' => array(1, 2, 3),
    'access callback' => 'user_access',
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK
  );
  return $items;
}

function marketplace_ajax_list_response($type='ajax', $collection_nid, $start, $page_limit) {
  if ($type == 'ajax') {
    $output = marketplace_ajax_list_collection_latest_content($collection_nid, $start, $page_limit);
    $commands = array();
    $commands[] = ajax_command_append('#ajax-target', $output);
    $page = array('#type' => 'ajax', '#commands' => $commands);
    ajax_deliver($page);
  }
}

function marketplace_ajax_list_collection_latest_content($collection_nid, $start=0, $page_limit=10) {
  $q = new \EntityFieldQuery();
  $q->entityCondition('entity_type', 'node')
      ->entityCondition('bundle', array('story', 'reader'))
      ->propertyCondition('status', 1)
      ->fieldOrderBy('field_date', 'value', 'DESC')
      ->fieldCondition('field_ref_collection', 'nid', $collection_nid, '=');

  // Get the matching items within the range
  $q->range($start, $page_limit);
  $result = $q->execute();
  $nids = array_keys($result['node']);

  // Make node teasers
  $nodes = node_load_multiple($nids);
  $teasers = node_view_multiple($nodes);
  $build = render($teasers);

  return $build;
}

When the node teasers are appended to the list, I have a jQuery function that updates the arguments in the AJAX link in order to update the range used in the query:

(function ($) {
  var page = 1;
  var page_limit = 10;
  var collection_nid = 12345;

  Drupal.behaviors.marketplace_ajax_list = {
    attach: function(context, settings) {
      page++;
      var link = '/marketplace_ajax_list_callback/nojs/' + collection_nid +'/' + (page_limit * page) + '/' + page_limit;
      $moreBtn.attr('href', link); // $moreBtn is the AJAX link
    }
  };
})(jQuery);

The link's href changes correctly, with the updated arguments, but the new arguments aren't used in the callback's query - the same arguments are used each time, so the same items appear on each click.

If I take the value that jQuery sets in the href and open the link in another tab, I see the correct items.

So I think the issue has to do with the AJAX behavior getting attached to the link and that's not updated each time the function runs. Is there a command I can add to make that happen?


texts: Custom PHP code in Rules differs from Devel's one

texts:
I'm facing an issue which is quite boring since the result displayed into Devel's PHP executer differs from the results of the Custom PHP code. What I want to do is sending private messages (thanks to privatemsg module) to certain users that I can't select with privatemsg Rules integration.

To send a new private_msg, we have to use the function "privatemsg_new_thread($recipients, $subject, $body)".

So I have to write a custom PHP code which is (I made it very simple) ; this one works in Devel but not in Rules.

$recipients = array(user_load(1));
$subject = 'hello';
$body = 'ok';
privatemsg_new_thread($recipients, $subject, $body);

When i write this ; it works with both modules

privatemsg_new_thread(array(user_load(1)), 'hello', 'ok');

Is there a problem with loading variables or sth ?
And i don't have any error log...

Any help would be highly appreciated !

Thanks in advance


texts: user_profile_form doesn't show profile2 information

texts:
I'm trying to modify the user_profile_form, but it isn't working. My regular user edit information shows up, but not my profile2 information.

    function MY_MODULE_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'user_register_form' || $form_id == 'user_profile_form') {
    $form['#attached']['js'][] = drupal_get_path('module', 'conduit') . '/js/jvectormap.min.js'; // You should place jvectormap js files into MYMODULE/js folder
    $form['#attached']['js'][] = drupal_get_path('module', 'conduit') . '/js/jquery-jvectormap-mi-counties.js'; // This is US counties generated file (see #1).
    $form['#attached']['js'][] = drupal_get_path('module', 'conduit') . '/js/county-select.js';
    $form['mi_container'] = array(
        '#type' => "container",
        '#states' => array(
            'visible' => array(// action to take.
                'select[name="profile_main[field_states][und]"]' => array('value' => 187),
            ),
        ),
    );
    $form['mi_container']['micounties_markup'] = array(
        '#markup' => '

', // Define own width and height.
    );

  }
}

Why wouldn't this work?


texts:
I want to write some JavaScript code for my project. I need to use Drupal.t(), but it seems that Drupal.t() only accepts English, and I don't want to write my JavaScript in English.

Is there any way to inform Drupal.t() that my string is not in English, just like t() that let you specify the language code.


texts: How to display a link field with its link text in a twig template

texts:
A content type includes a link field link that accepts Link text.

A user inputs the URL /target with the Link text "Go to target".

How do I get twig to generate

   `<a href="/target">Go to target</a>`

I have tried what I've found by reading, including

{{ node.field_link }} (crashes)
{{ node.field_link|render }} (crashes)
{{ node.field_link.value }} (does nothing)
{{ node.field_link.0.url }} (displays /target but not as a link and ignores the link text)
{{ node.field_link.uri }} (displays internal:/target but not as a link and ignores the link text)

Seems like there must be a one-step way to accomplish this.


texts: Get media image url in views-view-unformatted template

texts:
I'm using drupal 8, in my template I created a file named views-view-unformatted--block-12.html.twig and this is it's content:

{% for row in rows %}
  {%
    set body = row.content['#row']._entity.get('body').value|striptags|render
  %}
  {%
    set title = row.content['#row']._entity.get('title').value
  %}

{{ title }}

{{ body|length > 70 ? body|slice(0, 70)|raw ~ '...' : body|raw }}

            Read more

    {{dump(row.field_images)}}
{% endfor %}

I try to dump(row.field_images) but null and dump(file_url(row.content['#row']._entity.get('field_images').value['0']['target_id'])) but url is /id_sample. How do I fix it?


texts: How can I break into my own Drupal site?

texts:
I was doing a Media module tutorial. Half way through it I decided to install the tutorial companion files and foolishly replaced my files. In the companions readme it says the admin login is username - admin and password - admin.

But it is not! Now i’m completely locked out. Can someone tell me how I might break in to my tutorial site? I have access to the DB via PHPMyAdmin.

I was thinking a MySQL update command to the password field for the admin. Can someone tell me what I could use to reset the admin password?

I changed the admin email address then requested a new password but it has not fired off an email.
I believe the password encryption method is sha1().


texts: Minutes in date value displayed never the same as value entered

texts:
I have a weird bug.  On many content types, I have a Date field using the Pop-up calendar widget with the format "February 3 2014 - 2:35".

When that date is displayed, the minutes are never the same as the minutes that I entered when I saved my content. If my date field has the time value 4:15, the time displayed will be 4:12. If I change the minutes again for let's say, 4:52, the time displayed is still 4:12. And when I edit that content, the time I entered is still there, so I know it's saved correctly. If I change the hour, that change is displayed properly but the minutes stay the same.

Also, when I check recent log messages, for a given hour, the minutes displayed are always the same. Like every event that happened between 2PM and 3PM has the time 2h02.

Does anybody know what the problem might be ?

I'm on Drupal 7.34 and using Date 7.x-2.8.


texts:
I have a white screen "The website encountered an unexpected error.". The
"update.php" is not working.

I deleted a module that still was installed (big mistake).
I moved the module back into the folder. But has the white screen.
The watchdog table in SQL says that the used module is still missing.

Is there a chance to fix this?

Maybe in SQL? (I use Sequel Pro in place of myPHPadmin).
Installing Drush seems to be complicated. I'm no programmer but a little experienced in coding with Drupal.

I looked many links online, but did not found the right solution.
Thank you.


texts: Form Permissions not working in Module with Multiple Forms

texts:
This works great in a module with a single form, however in a module with multiple forms the form does not show up in the permissions list. Is there something that I need to do differently for modules with multiple forms?  For example, do I need to add security to each form before it will recognize it for any forms in the module?

I add this to hook menu:

'access callback' => 'user_access',
'access arguments' => array('Spring Grove Scorecard Access'),

Then use this function:

function form_scorecard_permission() {
    return array(
       'Spring Grove Scorecard Access' => array(
       'title' => t('Spring Grove Scorecard Access'),
       'description' => t('Allows users to access the Spring Grove Scorecard.'),
    ),
  );


texts: Subscribe/unsubscribe user from mailchimp list after purchase

texts:
I am using mailchimp 7.x 3.3 Module and ubercart is integrated for role selling,
also I have rules module installed.

I have users subscribed to the mailchimp list, my requirement is when a user from my list purchase any order he should be unsubscribed from one list and subscribed to other mailchimp list, so that I can track the users from the list who did not purchase any order.

I am thinking of doing it using rules, In rules I have an event "when the user completes checkout", I want to add the action on same event, the action should be "unsubscribe from one list and subscribe to other list" but unfortunately I dont have any way to select the list there.

Please find the screenshot of rules interface below, help would be greatly appreciated.

This is event interface

This is Action Interface


texts: How to clear image (or file) field data for specific node programmatically?

texts:
I need to clear/remove image (or file) field from specific node.
I have before:

I want to get after code execution for the field:

What code should I use to properly clear image (file) field data?


texts: BOA Aegir Octopus, APC disabled: Module's php files seem to be cached, changes are not reflected. Why?

texts:
I installed BOA on a VPS and everything seems quite alright except the fact that when I change a module's php file, the changes are not reflected in the website.

When I change something in drupal's index.php I can see the changes.

My first thought was APC which I disabled globally in php.ini for testing but that didn't help.

It looks like the file is never called, though I double checked that I'm working in the right directory and drupal setup.

Obviously I'm missing something and even Google didn't shed light no this.

Do you know what this could be?


texts:
I tried to use below code to add reset button in webform,but its not working.I think that is not calling to "contact_form_reset" this function.Please help me out..

function cap_academy_contactus_form_alter(&$form, &$form_state, $form_id) {
       if ($form_id == 'webform_client_form_860'){
        $form['actions']['reset'] = array(
          '#type' => 'submit',
          '#value' => t('Reset fields'),
          '#submit' => array('contact_form_reset'),
          '#prefix' => '
',
                '#suffix' => '
'
        );
        return $form;
      }
    }

    function contact_form_reset($form, &$form_state){
      $form_state['rebuild'] = FALSE;
    }


texts: How to insert the image field in the menu links? I've added an image field in the vocabulary I've created and uploaded image on each terms. I am able to display those images and the other fields I require using the views and I've used the taxonomy_menu to add the terms in the menu links, but one of my requirements is to display those image into the menu links. I don't think that the menu_icons module is the solution, I don't want to double up the work in uploading the image. Please bear with my English and hoping that I explained it well. Thank you.


texts: in multi-site do you set base url for each sites settings?

texts: Have just enabled security review module and it's alerting to base url not being uncommented and set. This is a multi-site so do I need to set the base url in each settings file for each site? I set the base url in settings for the root site but the alert still came up for subdomain of multisite where have not changed its settings file.


texts: Programmatically set the value of a multi-value field from multiple arrays

texts:
I have 3 taxonomy vocabularies:

Fruits
Vegetables
Drinks

On the Article content type, I have set a multi-value entity reference field field_article_all_items referencing all of Fruits, Vegetables and Drinks taxonomy vocabularies.

Using the Webform module, I have created a webform with 3 elements:

fruits_category which is a non-required, multi-value Entity Checkboxes element referencing the Fruits Taxonomy Vocabulary
vegetables_category which is a non-required, multi-value Entity Checkboxes element referencing the Vegetables Taxonomy Vocabulary
drinks_category which is a non-required, multi-value Entity Checkboxes element referencing the Drinks Taxonomy Vocabulary

Now on webform submit, I want to:

Create a new node of type article.
Set the values of field_article_all_items equal to all selected values
from fruits_category, vegetable_category and drinks_category.

In my customhandler.php file, I have tried:

// Get an array of the values from the submission.
    $values = $webform_submission->getData();

// Get 'Fruits Category' Value.
    $FruitsCategory = $values['fruits_category']; // Multi-value tid

// Get 'Vegetables Category' Value.
    $VegetablesCategory = $values['vegetable_category']; // Multi-value tid

// Get 'Drinks Category' Value.
    $DrinksCategory = $values['drinks_category']; // Multi-value tid

// Put all values in an array().
    $AllItems = array($FruitsCategory,$VegetablesCategory,$DrinksCategory);

// Create a new "Article" node.
    $article = \Drupal\node\Entity\Node::create([
        'type' => 'article',
        'title' => Test,
        'langcode' => 'en',
        'uid' => '1',
        'status' => '1',
        'created' => $current_time,
        'field_article_all_items' => $AllItems,
        ]);
// Save the created node.
    $article->save();

the above code created a new node but with field_article_all_items field empty.

Also I have tried:

// Get an array of the values from the submission.
    $values = $webform_submission->getData();

// Get 'Fruits Category' Value.
    $FruitsCategory = $values['fruits_category']; // Multi-value tid

// Get 'Vegetables Category' Value.
    $VegetablesCategory = $values['vegetable_category']; // Multi-value tid

// Get 'Drinks Category' Value.
    $DrinksCategory = $values['drinks_category']; // Multi-value tid

// Put all values in an array().
    $AllItems = array($FruitsCategory,$VegetablesCategory,$DrinksCategory);

// Create a new "Article" node.
    $article = \Drupal\node\Entity\Node::create([
        'type' => 'article',
        'title' => Test,
        'langcode' => 'en',
        'uid' => '1',
        'status' => '1',
        'created' => $current_time,
        //'field_article_all_items' => $AllItems,
        ]);
// Save the created node.
    $article->save();

foreach ($AllItems as $Item) {
  $article->field_article_all_items[] = $Item;
}

// Save the created node again.
    $article->save();

// Also I have tried the below method.
//   $article->field_article_all_items[] = ['target_id' => $AllItems]

  //Save the created node again.
//   $article->save();

But also this code created a new node but with field_article_all_items field empty.

How to set the values of field_article_all_items equal to fruits_category + vegetable_category + drinks_category ?


texts:
If I've got a page that originally has a node (ie node/20) for the URL and then if I've assigned its own custom URL (ie website.com/landingpage) I'm finding that I can still access the page by using its node number.
Ideally I'd like to have it so a user can only access the page via the custom URL and never the node so is there a way I can configure a node so it cant be used in the URL to reach the page?


texts: Theming main menu with block--menu.tpl.php not working

texts:
My template file block--menu.tpl.php is not catching my main menu block. It works for custom menus. Am I missing something on this? I don't have any other specific block overrides.

I'm running Drupal v7.10


texts: create tabs with hook_menu() for custom module

texts:
since two hours im trying to create tabs in my custom modules backend.

I've tried severals suggestions but couldn't get any of them to work.

this is my current hook_menu() :

    function social_links_menu() {
  $items['admin/config/system/social_links'] = array(
    'title' => 'social_links',
    'description' => 'Configure to fit clients needs',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('social_links_settings'),
    'access arguments' => array('administer site configuration'),
    'file' => 'social_links.admin.inc',
  );

  return $items;
}

I simply want two tabs called: 'tab1' and 'tab2'.

Can someone give me an working example? This should be really simple, but right now it seems impossible


texts: How to get multiple value with token_get_values()?

texts:
I have a field which accepts unlimited values so the values of the field get saved in an array.  If I use token_get_values() to get the corresponding field value, I only get the first element of the array.

How can I read the whole array value or get an imploded string of values with token_get_values()?


texts: how to send a exposed filter when use Service views

texts:
I create a exposed filter of field field_nick_name.

and I visit this link

http://drupal/daxuebao/api/views/user_search_by_nick?filters[field_nick_name]=a

and this link

http://drupal/daxuebao/api/views/user_search_by_nick?field_nick_name=a

this above 2 can not work, is there someone can tell me how to use Service View with exposed filter?


texts: Allow comments only for author of the node and certain role

texts:
I'm using Drupal 7. It is possible to disable the comment form for a specific node type for authenticated users? What hooks should I use if I want to allow only the author of the node and the administrator to post comments. The normal users (authenticated role) should only read them.

Thank you


texts: When should I use DependencySerializationTrait?

texts:
I have noticed that some classes contain the following line:

use DependencySerializationTrait;

I know this trait is used for serialization, but I don't get when to use it and what kind of classes need to support serialization.


texts:
When building a bespoke site a pet hate is that you start with a front-end layout that is semantically sound and robust, but when you try and create said layout as a theme in Drupal, by default the system adds <div> markup around whatever node, field or general piece of information it can find.

The result is that I usually begin with Mothership as a base theme to reduce the noise of excess markup.

Will Drupal 8 (both core modules and shipped themes) adopt cleaner HTML semantics? If so, how might the new front end HTML compare to its Drupal 7 predecessor?

HTML5 is an obvious assumption. The game is no longer "wrap it in a div" as HTML 5 empowers front end developers to a wealth of possible tags in order to best convey meaning  (e.g. aside, header, navigation). How will Drupal change to allow this new level of semantics choice to be controlled by developers?


texts: Subtheming -  what happens with parent theme's style.css

texts:
Trying to pin down in better details the steps involved when sub-theming, I can manage to get a sub-theme up in D, but there is  a question I still have, concerning the style.css that is unfortunately not clear in my head. Is the sub-theme's style.css supposed to come from the parent theme or from subtheme?

The example I have show the subtheme as having no style.css. I tried the advice and flushed style.css, created an empty simpleblueMaster.css, added it to file[] in the .info file.

Author stated that css styles from parent theme will be loaded to be overridden if needed by sub-theme, and this totally makes sense.  Unfortunately this is not the case on my installation and I would of liked to confirm the expected behavior.

THe author erases all css and images in his sub-theme, except if I do that in mine, nothing works. Parent theme's style.css does not seem to load and I assumed it should be. Anyone know what happens to style.css in sub-themes?

Or what could be preventing parent theme's style.css from not loading, if it should be?

Any insight appreciated, Thanks all!

Update:

Basically, there are 2 main ways (ok, probabably more I don't know of!) for a sub-theme  to override the parent theme's css.

One involves copying the whole style.css in sub-theme and hacking on that. This works but a much cleaner approach as also mentionned in the answer is to not have a style.css in subtheme, and override with css in a sub-theme specific file.  If there is a better way, I'd be very happy to know!

Thanks all


texts: How to count the number of nodes with a certain taxonomy term, based on a list of nids?

texts:
The users on my website have an integer field My medals, which can contain an unlimited amount of values, representing nids from nodes of the type Medal. Every Medal node contains one term of the taxonomy Colour (either Gold, Silver and Bronze).

Given a certain uid, I would like to create a View that shows the total number of nodes per taxonomy term, based on the user's field My medals.

Example. Suppose the nodes with nids 1, 2 and 3 have a Gold term, the node with nid 4 has a Silver term, and the node with nid 5 has a Bronze term. Let user 1 have a My medals field with values 1, 2, 4, 5. Then the View should return "Gold: 2, Silver: 1, Bronze: 1" when the uid 1 is given.


texts: Separating user edit form into small descent form

texts:
I am developing a Community website in Drupal 7,where users got profiles with many fields, but these fields are grouped for Example: Basic informations,Hobbies, Education,Experience and So on..
In normal drupal, when user wants to edit his profile, he/she will be present with a huge form with lots of fields.
What i need is to separate these categories in different small forms, if possible using a custom module so the forms can be called like
   drupal_get_form('basic_informations');
   drupal_get_form('Hobbies');
If This will be possible then i will be able to opens this small forms in modal dialogs(ctools).

Any suggestion will be Appreciated.


texts:
I have customers filling out an entry form before sending them to checkout.  Is it possible to store, or serialize, the $form_state array in the order?  There is a 'data' field in the order.  Is it simple as me calling:

$order->data = serialize($form_state);
commerce_order_save($order);

EDIT:

The data field in the order is an array that gets serialized.  So, it looks like I can do:

$order->data['myform'] = $form_state;


texts:
This is a hard one to explain, so thanks for taking a look.  I've created a menu in views of all the nodes associated with a particular taxonomy term.  The problem is that some of these nodes have children associated with them that I do not want to show in the views menu.  BUT, they should still display the menu.

  Node 1
  Node 2
  - (child) Node 2a
  - (child) Node 2b
  Node 3

In that example, the menu would show up on all 5 pages, but would only have 3 items in the menu.

I am able to make a menu of all the items associated with a term, but can't figure out how to add depth.  Any ideas?
-JB


texts: Custom Date Format Not Available to my Date Field

texts:
I'm sure I'm missing something super simple, but for some reason, my date field that I've created cannot make use of the "custom format" option in Views. I'm using D7 7.22 and the Date Module, 7.x.2.6

I've noticed that the field that I created is labelled differently than a normal date field which is "content: post date".

Mine is labelled, "Choose how users view dates and times"

The regular field is labelled simply "date format"

I've created a content type that has a date field with day, month, year, and time specified for each node. It doesn't matter which formatter I select - plain, time ago, date and time -  I do not have the option for a custom format for this field and I'm baffled. I can see the custom formats I created at admin/config/regional/date-time but no option for a custom format in Views.

I need to reformat the output of the values in contained in that field so that I can theme it appropriately, and will roughly be following this: http://highrockmedia.com/blog/theming-views-post-date-drupal-7-date-parts

Any ideas on why this would not be an available option? I've cleared all caches, removed and recreated the field - everything I can think of but I can't find anything on why I cannot use that field in Views.

You can see the difference in this screen grab: http://bit.ly/1cGQMkY

Thanks in advance


texts:
i made my own module in my drupal 7 website to hide a boolean when its value is "0"
but something won't work

this is the code

   function MYTHEME_node_view($node, $view_mode, $langcode) {
if($node->content['field_members_only']['#items']['0']['value']=="0") {
                      hide($node->content['field_members_only']);
                    }
}

what's wrong?
i think the conditional part is wrong
if i save the statement without the IF part it's working perfectly

thanks


texts: Feeds importer not importing when image does not exist

texts:
I am importing a productfeed with Feed Importer.

All the items that has working images, will import. All the items where the images give a 404 and do not exist, it wont import the product at all.

How can i import these products, and set a default image?


texts:
I am new to Drupal and I am trying to create a menu (top navigation links) where a small description would be visible under the main Title.

I am trying to replicate this sites menu.

Is there any module that would allow me to do this? Or is there something I missing that would allow the Description that you type to show up the way I am looking for. Any help with this would be greatly appreciated!!


texts: How to increase the value of the field nid in the node table in database?

texts:
I'm using Feeds to import nodes from another system. This system uses very long number for its node id, like: 17675272378. As you can see this number has 11 digits. The problem is that Drupal only allows a nid value up to 10 digits, then the import just fails.

I thought of changing the length value for nid for the node table directly in the database. But it is not that simple there are a lot of other tables which has this field like: the entity_id field for the field_data_body table.

Maybe I can get to change the values in the database if I export the table and then find and replace the value '10' for '15' and then after I replace the database which the new one. But my question is: will I get other problems if I do this?

How can I sort this out?

Here are my captures:


texts:
I need to present multiple graphs in a single page. Is it possible to do this using the Charts module? Up until now I have been using the following to return a chart to the page.

return theme('chart', array(
                      'chart' => $chart,
                    ));


texts: Drupal Deployment to Dev & Prod and Git Code Repository Setup

texts:
I have a dev and a prod server with 4 other developers. What is the most efficient way of setting up a development code push environment without the need to have to get too involved in the process? I know the term these days is called CI (continuous integration). But the thing is that it can involve many moving parts during deployment I've read some setups have automated testing in the process. I don't believe I would need that as that's an extra system to manage.

My sites are just mainly information sites and its mainly used internally which is less than 1000 hits a day.

What is the simplest way some people approach this issue?


texts: I want to import static html reports generated for source code by code analysis tools like doxygen, understand. Is there any module that can import the html reports generated by these tools directly into drupal? I tried import html without any success. Any tried and tested procedure to achieve this feature ?


texts: Override default node form submit handler

texts:
I retrieve a node form and replace it's submit callback like this:

$node = entity_create('node', array('type' => 'my_type', 'title' => ''));
$node = entity_metadata_wrapper('node', $node);
$node = my_node_handler($node, 'some_operation') // It's an object factory
  ->ekran()
  ->getEntity() // It returns a DrupalEntityWrapper
  ->value() // Node's stdClass from wrapper;

form_load_include($form_state, 'inc', 'node', 'node.pages');
$form_state = array();
$form_state['build_info']['args'] = array($node);
$form = drupal_build_form('my_type_node_form', $form_state);

// Remove save, preview, delete, ....
remove_default_actions_from_form($form);
$form['actions']['send'] = array(
  '#type' => 'button',
  '#value' => t('My Button'),
  '#submit' => array('my_callback'),
  '#executes_submit_callback' => FALSE,
  '#name' => 'name_here',
);

But Form API does not care what my submit callback is or even, #executes_submit_callback, It always sends the node form to node_form_submit and the node is saved.

Even changing the callback like this:

$form['actions']['send'] = array(
  '#type' => 'button',
  '#value' => t('My Button'),
  '#submit' => array('some_non_existing_function_hahaha_hohoho'),
  '#executes_submit_callback' => FALSE,
  '#name' => 'name_here',
);

Will not produce an error. What's wrong here? I used entity_form(args...) for retrieving the form and this thing happened, And changed it to drupal_build_form, Still the same thing.

Also along all these, I have added:

  $form['#submit'] = 'die';

Which wont happen (not even an error about die not being callable from call_user_func...);


texts:
I have views like this:

I want use module UI Pattern Views. I defined UI Pattern. File card.ui_patterns.yml with content

card:
  label: Three column fluid
  description: Three column fluid
  fields:
    image:
      type: render
      label: Image
      description: Media image.
      preview:
        theme: image
        uri: http://lorempixel.com/900/500/sports/1
        width: 150
        attributes: {}
    title:
      type: link
      label: Title
      description: Media title.
      preview:
        type: processed_text
        text: Etiam iaculis nunc ac metus
        format: basic_html

and file pattern-card.html.twig have content:

    {% if image is not empty %}

            {{ image }}

    {% endif %}

{{ title }}

I don't know how can use multil image style for this case. Any suggetion?


texts: Filter Criteria "Workbench Moderation: Current" only works on published revisions?

texts:
I added the following filter criteria to a View:

Workbench Moderation: Current

However, after not seeing the output I expected, I realized that this filter only displays a revision if the revision is both current AND published. If a draft is currently current, then it is ignored by the filter.

Is that a bug?

Thanks,

Stephen Gilson


texts: Alter webform messages found in WebformMessageManager

texts:
List item

Is there a way to change the hardcoded webform messages from /webform/src/WebformMessageManager.php?

for example, the one on line 284

  case WebformMessageManagerInterface::DRAFTS_PREVIOUS:
    $t_args = [':href' => $this->requestHandler->getUrl($webform, $source_entity, 'webform.user.drafts')->toString()];
    return $this->t('You have pending drafts for this webform.') . ' ' . $this->t('View your pending drafts.', $t_args);


texts:
I am using module - jplayer (http://drupal.org/project/jplayer), in the jplayer.module i've found this piece of code, since i am very weak in php i need a help :)

/**
 * Add the jPlayer library to the page.
 *
 * @param $add
 *   By default this function will add jPlayer to the page JavaScript array
 *   directly. If wanting to store the jPlayer file as an #attached property,
 *   set this to FALSE and jplayer_add() will only return the needed array
 *   suitable for use as an #attached property.
 */
function jplayer_add($add = TRUE) {
  static $added = FALSE;

  $directory = variable_get('jplayer_directory', 'sites/all/libraries/jplayer');
  $return = FALSE;
  if (file_exists($directory . '/jquery.jplayer.min.js')) {
    $filepath = $directory . '/jquery.jplayer.min.js';
  }
  elseif (file_exists($directory . '/jquery.jplayer.js')) {
    $filepath = $directory . '/jquery.jplayer.js';
  }

  if (isset($filepath)) {
    $jplayer_js = jplayer_get_file_path('jplayer.js');
    $jplayer_css = jplayer_get_file_path('jplayer.css');
    $settings = array('jPlayer' => array(
      'swfPath' => base_path() . variable_get('jplayer_directory', 'sites/all/libraries/jplayer'),
      'autoPlay' => (int) variable_get('jplayer_autoplay', ''),
    ));
    if ($add) {
      drupal_add_js($filepath);
      drupal_add_js($jplayer_js);
      drupal_add_css($jplayer_css);
      if (!$added) {
        drupal_add_js($settings, 'setting');
        $added = TRUE;
      }
    }
    $return = array(
      'js' => array(
        array('data' => $filepath),
        array('data' => $jplayer_js),
        array('data' => $settings, 'type' => 'setting'),
      ),
      'css' => array(
        array('data' => $jplayer_css),
      ),
    );
  }

  return $return;
}

What should i modify in this code to show .js files on every page, not only when a node with a player loaded.

UPDATED. The question is - what to modify in this code to attach jplayer js files on every page, not when im viewing a node with a jquery player.


texts: Where is place $content in node--product--type.tpl.php be generated and manipulated in drupal commerce?

texts:
I am a beginner of drupal commerce, I know Drupal Commerce display product with node--product--type.tpl.php, "render($content)" does this work.

I need to add a property "monthly sales" to each node(product display) so that I can display it in node page.

With drupal core, I can use hook_load and hook_view to display custom properties, but it seems Drupal Commerce doesn't work by this way.

Where is place the array $content be generated and manipulated in Drupal Commerce? Which hook can I use?

Appreciate for any help or comments.


texts: Change default format for date field on user register form

texts:
I'm new to Drupal 8. In the user registration form, i've added a Date field via manage fields in user account settings. However, I need to customize this field and change its format. I tried 'manage display' but it's not taking effect. Is there something I'm missing. (Ideally, it should look and behave just like field datetime in Drupal 8 webform)

Appreciate any help given.

Thanks


texts: Using addExpression and GROUP_CONCAT gives null result

texts:
This has been bothering me for a few days now.

Using Migrate module, I am using a GROUP_CONCAT in an expression and the prepareRow always has a null value for the expression.

For example, heres how my query looks at the moment;

$query = Database::getConnection('default', 'custom_migrate')
         ->select('Articles', 'a')
         ->fields('a')
         ->condition('a.SiteID', 'site-id', 'LIKE');

// Join our tags. Use LIKE again.
$query->leftJoin('TagAssociation', 'ta', 'ta.InstanceId = a.id AND ta.Class LIKE :param', array(':param' => 'article'));
$query->leftJoin('Tag', 't', 'ta.TagId = t.id AND t.SiteId LIKE :param', array(':param' => 'site-id'));
$query->addExpression("GROUP_CONCAT(t.Tag)", 'customTags');

// Join our show data.
$query->leftJoin('ShowContent', 'sc', 'sc.ContentId = a.id AND sc.Type LIKE :param', array(':param' => 'article'));
$query->leftJoin('Shows', 's', 's.Id = sc.ShowId');
$query->addField('s', 'id', 'ShowId');

$query->groupBy('a.id');

Pretty simple stuff, but in both prepare() and prepareRow() I get a null value for $row->customTags. Even If I leave the alias off and use $row->expression. Null.

"Make the join a subquery!" I hear you say. Same thing.

Dumping the $query object (cast as string to see query) and putting my params in, I can query the db and get the values I expect.

SELECT a.*, s.id AS ShowId, GROUP_CONCAT(t.Tag) AS expression
  FROM Articles a
       LEFT OUTER JOIN TagAssociation ta ON ta.InstanceId = a.id AND ta.Class LIKE 'article'
       LEFT OUTER JOIN Tag t ON ta.TagId = t.id AND t.SiteId LIKE 'fiveaa'
       LEFT OUTER JOIN ShowContent sc ON sc.ContentId = a.id AND sc.Type LIKE 'article'
       LEFT OUTER JOIN Shows s ON s.Id = sc.ShowId
 WHERE (a.SiteID LIKE 'fiveaa')
 GROUP BY a.id
 LIMIT 20; // Added by me.

Yep, the expression column is populated with comma separated tags, as expected.

SO, somewhere between me creating this query and the prepareRow method, the value is being lost.

Now, before I dig into the module code I thought I'd get a sanity check from anybody that can to see if I'm doing something dumb that I've missed.

Note The field mapping for this field has been removed while I work out what is going on.

UPDATE Ok, so, the file sql.inc in the migrate module where it executes the query looks like this (around line 335);

migrate_instrument_start('MigrateSourceSQL execute');
$this->result = $this->query->execute();
migrate_instrument_stop('MigrateSourceSQL execute');

If I add some debug ...

var_dump($this->query->getExpressions());
var_dump((string)$this->query);
migrate_instrument_start('MigrateSourceSQL execute');
$this->result = $this->query->execute();

$row = $this->result->fetchAssoc();
var_dump($row);

I can see my expression ...

array(1) {
  ["contentTags"]=>
  array(3) {
    ["expression"]=>
    string(19) "GROUP_CONCAT(t.Tag)"
    ["alias"]=>
    string(11) "contentTags"
    ["arguments"]=>
    array(0) {
    }
  }
}

And I can see my query (as above) but ... null result on that col.

  ["contentTags"]=>
  NULL

UPDATE 2
So, if I change my leftJoins to joins, I get no results at all ... While running the query manually with joins returns rows.

FINAL UPDATE
I am now doing a separate query in the prepare method to get these values. I couldn't work out what was going on or the best course of action. I'll leave this open incase others have issues and post in here.


texts:
Is there a way to determine if you are on a view page, similar to   \Drupal::request()->get('node') used to check if the current page is a node page?

I need to adjust breadcrumbs for view generated pages with hook_system_breadcrumb_alter().


texts: How to add a view with contextual filters in a panel

texts:
I created a view with some contextual filter and relationships. When i add this view to a menu tab from a node, the view is working ok.
But when i add this view to a panel, it gives me the message that there are no items added yet (my own custom text when the view is empty).

Like it should be:

And how it is through panes:

Can somebody help me with this? Tnx!


texts: Using jQuery to communicate to Drupal 7 via AJAX

texts:
I've been learning how to use AJAX with Drupal 7. I already know how to use the '#ajax' attribute with a form and also how to use the 'use-ajax' class with a link.

I have a nice jQuery slider on my page that emits a jQuery event (called 'slide') every time the slider moves to a new picture. The event also contains which slide number we will be viewing. I can bind to the event using jQuery like this:

$('.slider').bind('slide', function(e, data) { alert(data.slide); });

That will pop up an alert showing the current slide. Instead I want to make an AJAX call using Drupal 7's AJAX and pass this current slide number to Drupal.

I've been searching for an answer and I think it might have something to do with the Drupal.ajax DOM object but I'm not sure.


texts: Is it possible to change the location and size of the blocks/tabs in Drupal?

texts: This is my first time using Drupal. so I am not too familiar with it. My question is that is it possible to change the location, size etc. of blocks/tabs that are available as default through Drupal? The blocks/tabs I am talking about are shown in the following snapshot.


texts: Does db_affected_rows() works well with PostgreSQL?

texts:
This is a clean installation and I was starting to develop a module.
So I have the following code (and nothing more apart from the hook_menu()):

$result = db_query("SELECT * FROM {variable}");
return db_affected_rows();

I used the variable table as an example since it was likely to be populated (and it is, of course!). Well, to my surprise db_affected_rows() always returns 0.
Is there any reason why it doesn't work? Are there any reported bugs that I may have missed?

Setup:

Drupal 6.22
PostgreSQL 8.4
PHP 5.3.8


texts: What is needed to support NTLM proxy in the Google Analytics Reporting module

texts:
I applied patches to support proxy for the Google Analytics Reporting module. But as per issue 1801996, it is confirmed that the proxy patch is not applicable for NTLM proxies.

Please advise how much effort will be required to change the code and what all files to be changed for this are. Or how can support for NTLM proxies be added to the module.


texts: How do you override Commerce checkout pane output?

texts:
I downloaded the commerce bitcoin module and I'd like to override the current output of the pane. There is no theme_ function to override. How can this be done?

The code is below:

 1 <?php
  2
  3
  4 /**
  5  * Implements base_checkout_form()
  6  * Display the bitcoin address at the checkout
  7  *
  8  */
  9 function commerce_bitcoin_pane_checkout_form($form, $form_state, $checkout_pane, $order) {
 10
 11
 12
 13
 14   $output .= t('Total amount %total BTC', array('%total' => $bittotal)) . '
';                                                                                15   $output .= t('Check Blockchain.info Payment Status') . '
';
 16   $checkout_form['commerce_bitcoin_pane_field_display'] = array(
 17     '#markup' => $output
 18   );
 19
 20   return $checkout_form;
 21 }


texts: How can I display the list price field in product page?

texts:
I am new to commerce Kickstart. I can add the list price field in hats content types. But i can't to show the list price field in product page. I don't want to show the SKU field in product page.In node--product-type.tpl.php

.. But it doesn't work it..


texts: Disable the overlay for admin using a feature?

texts:
Every time i spawn a new website the first thing i need to do is disable the very slow overlay in /user/1/edit?destination=admin/people

Is there a way to export admin user settings each time after an install?


texts:
How to disable shipping or delivery pane by rules on checkout page?
i am developing a sytem using ubercart in drupal 7.


texts: Is there a module provides UI to create field index?

texts: My views are quite slow in some cases, needs create indexes on field tables. Is there a module for that?


texts: How to place an image on a specific page

texts:
I have created a page, page-5. I want to insert an image only on this page through .tpl.php not through the CMS itself. I have created an empty document page--page-5.tpl.php.
What content would go in there and how would I place my image?

For the front page, I was able to do with the following code:

<?php if (drupal_is_front_page()) {?>

<?php }?>

How to do for a specific page?


texts: Using jQuery .ajaxstart with views exposed filter

texts:
To start with, my goal was to alter the ajax loading behavior in views exposed filter (Druapl 7 and Views 7.x-3.3) and this question pretty much sorted that one out: How do I change the ajax loading behaviour in Views?

Here comes the problem, the jQuery .ajaxStart and .ajaxSuccess doesn't seem to fire when i change the exposed filter in the view.
I get my custom.js file to load correctly and this simple code works just fine:

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

      alert('message');

    }
  };
})(jQuery);

but replacing my alert message with this does not:

$('#views-exposed-form-produkter-3-kol-page', context).ajaxStart(function(){
        $('#views-exposed-form-produkter-3-kol-page,div.view-id-produkter_3_kol', context).fadeTo(300, 0.5);
      });
      $('#views-exposed-form-produkter-3-kol-page', context).ajaxSuccess(function(){
         $('#views-exposed-form-produkter-3-kol-page', context).fadeTo(300, 1.0);
         $('div.view-id-produkter_3_kol', context).css('opacity', 0.5).fadeTo(300, 1.0);
      });

I have also tried to use $(document).ajaxStart without success.
The fading also works if i remove the ajaxStart and allow it to fade when page is loaded.

So, if i could get the ajaxStart and Success to fire, everything else should work like I wanted it.

(This is my first question here, so I hope I've managed to do it the right way)


texts:
Trying to get non-object error appears. What must be changed or added to the code in order to give the license access to the author of product?

function commerce_license_access($product, $op, $license = NULL, $account = NULL) {
  if (!isset($account)) {
    $account = $GLOBALS['user'];
  }

  if(commerce_product_current_user_is_author($product->uid)) {
    return TRUE;
  }
  ...
}
  ...
function commerce_product_current_user_is_author($pid1) {
  global $user;
  if ($pid1 == $user->uid) {
    return TRUE;
  }
}

Original code (without $product) is in http://cgit.drupalcode.org/commerce_license/tree/commerce_license.module?id=da6e1bf7320513883f0e681ec3f4acaf974e6b10


texts: How to format CCK fields printed in custom template

texts:
I have managed to print date and dollar amount CCK fields on a custom print.tpl.php template file (associated with the Printer, email and PDF versions module), but they are showing up in a different format than how I have them displayed in the CCK field itself.

The date is showing up like this:  2012-06-01 00:00:00
Instead of like this: June 1, 2012

And the dollar amount is showing up like this: 10000
Instead of like this: $10,000

Here are the code snippets:

    <?php if(isset($node->field_invoice_due_date['und'][0]['value'])) {
          print $node->field_invoice_due_date['und'][0]['value'];
   }
 ?>

    <?php if(isset($node->field_invoice_amount_to_bill['und'][0]['value'])) {
          print $node->field_invoice_amount_to_bill['und'][0]['value'];
   }
 ?>

Can anyone direct me on how I can change those two snippets to output their values in the formats I need?

Thanks!


texts: Unique form per user with custom form class

texts:
Not sure if this is a related/duplicate of Generate unique form ID based on context

I am hoping I can render a unique form per user with the Form API using a custom form class.

What I've seen with \Drupal::formBuilder()->getForm(), you must provide your Form::class and this does not allow for something like:

public function getFormId() {

  $userID = \Drupal::currentUser()->id();
  $userFormID = 'form_settings' . $userID;
  return $userFormID;

}

and returns an invalid form with \Drupal::formBuilder()->getForm().

Ultimately trying to render a unique form via hook_preprocess_page() for the user to interact with.

An idea of what I have so far is a simple form with two submit items.

MYMODULE\src\Form\Form.php:

public function buildForm(array $form, FormStateInterface $form_state) {

  $config = \Drupal::config('MYMODULE.MYMODULE_settings');

  $form['description'] = [
    '#type' => 'item',
    '#markup' => $messageMarkup,
  ];

  $form['time'] = [
    '#type' => 'hidden',
    '#default_value' => time(),
  ];

  $form['form_delay'] = [
    '#type' => 'submit',
    '#value' => $this->t('Remind Me'),
    '#submit' => ['::submitFormDelay'],
  ];

  $form['form_ignore'] = [
    '#type' => 'submit',
    '#value' => $this->t('Ignore'),
    '#submit' => ['::submitFormIgnore'],
  ];

  return $form;

}

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

  $values = $form_state->getValues();

  $this->configFactory->getEditable('MYMODULE.MYMODULE_settings')
    ->set('time', $values['time'])
    ->save();

  parent::submitForm($form, $form_state);

}

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

  $this->configFactory->getEditable('MYMODULE.MYMODULE_settings')
    ->set('time', NULL)
    ->save();

  parent::submitForm($form, $form_state);

}

Then grabbing the time value to see if I should show the form

MYMODULE.module:

function MYMODULE_preprocess_page(&$variables) {

  $config = \Drupal::config('MYMODULE.MYMODULE_settings');

  // Comes from another form controller in the module.
  $reminderDelay = $otherFormConfig->get('reminder_delay');

  $timeAtInteraction = $config->get('time') ?: NULL;

  $timeForm = \Drupal::formBuilder()
    ->getForm(\Drupal\my_module\Form\Form::class);

  if ($timeAtInteraction != NULL) {

    if ($timeAtInteraction < (time() - $reminderDelay)) {
      // Provide our form to page.html.twig.
      $variables['timeForm'] = $timeForm;
    }

  }

}

The form works, but of course, a single user sets it for everyone. I'd like the form/values to be unique per user.

Is it possible using the Form API?

(Working on cache contexts as suggested below, but not included above.)


texts: InnoDB gone missing as database type - has anyone seen this error before?

texts:
I'm working on the Drupal 7 site that's currently on Dreamhost.

Since this morning, the site is showing the following error message:

  Error
  The website encountered an unexpected error. Please try again
  later.
  Error message PDOException: SQLSTATE[42000]: Syntax error or
  access violation: 1286 Unknown table engine 'InnoDB': SELECT expire,
  value FROM {semaphore} WHERE name = :name; Array ( [:name] =>
  variable_init ) in lock_may_be_available() (line 167 of
  /home/mysite.com/includes/lock.inc). Uncaught exception thrown in
  shutdown function.

  PDOException: SQLSTATE[42000]: Syntax error or access violation: 1286
  Unknown table engine 'InnoDB': DELETE FROM {semaphore} WHERE
  (value = :db_condition_placeholder_0) ; Array (
  [:db_condition_placeholder_0] => 7584349655055df9b66b5c9.36234254 )
  in lock_release_all() (line 269 of
  /home/mysite.com/includes/lock.inc).

Has anyone seen this sort of error before? Yesterday, my database showed as InnoDB in PHPMyAdmin; today there's nothing showing as "type."


texts: Services + Entity Reference - New revision vs. published revision

texts:
I'm using Services to deploy nodes from Site A to Site B, using UUID as the key to keep them synced. If the node exists on Site B, I do a PUT to update it, and if it doesn't exist, I do a POST to create it. This allows me to "push" nodes from Site A to Site B, but my issue is with entity references.

For example, I have Node X on Site A, I publish it to Site A which fires a rule which sends Node X to Site B via services. Now, I have an unpublished revision of Node X on Site B and any related entity reference field values.

Then, I publish Node X on Site B.
So, I have a published revision of Node X on Site B. It has 2 "related nodes"...call is Node A and B.

I go over to Site A and update Node X and add another related node, Node C.

It deploys to Site B via the services resources and updates via Services PUT.
The new draft/revision on Site B now has 3 referenced nodes, Node A, B, C. Good.

But, the published revision also shows the 3 referenced nodes, but should only have 2 since I don't want to update the published revision until a user explicitly publishes it.


texts: Why is the content of existing blocks not editable?

texts:
I have inherited the Administration of a Drupal 6 site with major funkiness going on. In this case I can't even figure out where to look.

There are a few dozen blocks configured and for the most part they are displaying what they are supposed to. However, a few of them are either blank or need tweaking. When I go to the block admin page, I am able to configure the blocks and bring up the Block specific settings tab, however the normal fields are all missing. Only Block Title shows up and that appears to be blank across the board.

Strangely enough, if I go to add a new block of my own, the form shows up correctly with all the fields.

What could cause these fields to not be displayed for existing blocks or where would I find the content of these blocks to be edited?


texts: Using jquery-match-height to set two blocks to equal height

texts:
I'm new to jquery and adding it to Drupal. I'm trying however to add this library to my Drupal site so I can set two of the blocks on my home page to equal heights. But it's not working and I'm not sure why.

Here's the library:

https://github.com/liabru/jquery-match-height

The items on the home page to make equal are in two different regions in the zen subtheme. They are separated by a third region in the middle. Here's how the regions look in the tpl:

  <?php print render($page['featured_resource']); ?>
  <?php print render($page['hp_video']); ?>
  <?php print render($page['whats_new']); ?>

Note: because I'm using Zen I've used Zen grids to make all these items be on the same 'row' (the same zen_clear()). Not sure if this might cause problems with the way the jquery is coded.

I want to set the blocks within the 'featured_resource' and 'whats_new' to the same height. The blocks contained within those regions I've given the same class as each other: 'feat-res'.

I've added my jquery library and code file to my pages using drupal_add_js in my template file like so:

function mytheme_preprocess_page(&$vars) {
    drupal_add_js(drupal_get_path('theme', 'my_theme') . '/js/jquery.matchHeight.js');
    drupal_add_js(drupal_get_path('theme', 'my_theme') . '/js/matchHeightHP.js');
}

I think it's calling it correctly because when I firebug the page those .js files are showing up in  tags.

The code I've put in the file matchHeightHP is simply this:

(function() {
    $('.feat-res').matchHeight();
})();

So that's where I get especially unsure. I tried to model it after the examples given on the link I referenced at the top, but as a jQuery newbie I really don't know if this is correct or not. Any help would be appreciated.

The blocks on my home page continue to look very uneven as the content on one is much great than the content on the other. I want them to both be equal to the height of the block that has more content.


texts: Returning all items in Views for Dates with Start dates AFTER Now as well as no date set

texts:
I have some items that have dates and some that do not. For items that have dates I do NOT want to show items that are past due (ie. events that are before today's date (or 'now' is fine). However I also want to display items that have no dates set.

In my view if I filter on dates I can choose to display events that are on today or later, and that works fine. But then it doesn't display any items that have no dates.

So, my question is, how can I customize my filter to show items with no value for event date as well as items that start on or after 'now'?


texts: How can I alter (theme) the default content feed?

texts:
How can I alter (theme) the default content feed on the front page (the list of node teasers) so that my 'thumbnail' image style is used instead of my 'medium' style for the images contained in the nodes.

All I can think of is to create my own page--front.tpl.php file or use is_front in node.tpl.php. Either way it means creating a custom listing for the front page.

Thanks.


texts: Drupal Commerce: IPN received - When order paid in full not triggered

texts:
Problem

I'm testing on a live website and the trigger "When an order is paid in full" is not triggered by Paypal. I'm receiving the IPN and the payments are successful. Is there some set-up I'm missing?

Set-Up

I have Drupal Commerce and Commerce Paypal installed, I've got the latest versions of both of them and rules.

I'm using Paypal Sandbox for my payments and it's the only payment method. It's set-up according to http://www.drupalcommerce.org/user-guide/paypal-standard.

The payments are being paid and received in the sandbox.

I'm receiving the IPN's (here's the latest one from admin/reports/dblog) so why is the trigger not firing?

[mc_gross] => 12.38
[invoice] => 21-1380584852
[protection_eligibility] => Ineligible
[item_number1] =>
[payer_id] => ARQWQ9YGG73F4
[tax] => 0.00
[payment_date] => 16:46:30 Sep 30, 2013 PDT
[option_selection1_1] => 1
[payment_status] => Completed
[charset] => windows-1252
[mc_shipping] => 0.00
[mc_handling] => 0.00
[first_name] => Dominic
[mc_fee] => 0.62
[notify_version] => 3.7
[custom] =>
[payer_status] => verified
[business] => captain12a@msn.com
[num_cart_items] => 1
[mc_handling1] => 0.00
[payer_email] => captain14a@hotmail.co.uk
[verify_sign] => AiPC9BjkCyDFQXbSkoZcgqH3hpacAQf5aelWDuTPmoMQ5vx5hMDCzulp
[mc_shipping1] => 0.00
[tax1] => 0.00
[option_name1_1] => Product count
[txn_id] => 7Y390707M1183591C
[payment_type] => instant
[last_name] => Woodman
[item_name1] => Order 21 at drupaltest2
[receiver_email] => captain12a@msn.com
[payment_fee] =>
[quantity1] => 1
[receiver_id] => 2FHV6QVKKQXY4
[txn_type] => cart
[mc_gross_1] => 12.38
[mc_currency] => GBP
[residence_country] => GB
[test_ipn] => 1
[transaction_subject] =>
[payment_gross] =>
[auth] => A41o8UNEox9bol5SH7hvw4jIMV-gR-9qubh3WKMZ9hmLr7oTiHMUATibYSUjrjlHHqDUlwDOlwNt10ZLGJt8xDw

(I checked the trigger using ZioBuddha's idea and it works fine for cheque's)


texts: How to display an image field next to the title on the profile pages?

texts:
My users have an image field, called 'Avatar', that's displayed as an icon. I can easily add it to the users' profile page in the content section, but now I'd like to show it next to the title (the default one prints the username).

As I didn't try to do this before, I surfed around the internet for a while. It seems that lots of similar requests were solved by a template file. Therefore, my plan was to add a user-profile.tpl.php, copy all the code from page.tpl.php to it and add

<?php
print render($user_profile['field_avatar']);
?>

before the title.

I'm not sure whether this might work. Is this a good approach?


texts: How add related nodes to content profile?

texts: In Drupal 6, I am trying to list the links to nodes created by that user and/or nodes which have her name in their tags below the profile. But I could not figure out how to do either. I appreciate your help.


texts: Do not include certain pages from Search

texts: I have 3 pages I wish to exclude from search. Is there a way to exclude them from coming up in the search results? Incidentally, is it also possible for other content types other than Pages alone?


texts:
I have a field that accepts a date range using the Date module.  This is the theme function for outputting the date (found in sites/all/modules/contrib/date/date.theme):

/**
 * Returns HTML for a date element formatted as a range.
 */
function theme_date_display_range($variables) {
  $date1 = $variables['date1'];
  $date2 = $variables['date2'];
  $timezone = $variables['timezone'];
  $attributes_start = $variables['attributes_start'];
  $attributes_end = $variables['attributes_end'];

  // Wrap the result with the attributes.
  return t('!start-date to !end-date', array(
    '!start-date' => '' . $date1 . '',
    '!end-date' => '' . $date2 . $timezone . '',
  ));
}

I somehow need to override that and replace the 'to' in the return with a hyphen... I know, it's nitpicky but it underlines a more important point - I honestly have no way to alter this.  I've tried overriding it in my template.php but that doesn't take.  I literally just copy and pasted this code but replaced theme in the function with the actual name for my theme.

So yeah... how do I alter this theme function "the Drupal way"?


texts:
I am trying to integrate with a third party API using REST. I want to make a few calls to the API without waiting for the result to be back (The calls are action calls ie they perform some operation in the third party software and hence I don't need to wait in Drupal).

In short I want to make a non blocking http call in php. (similar to asynchronous call in java-script.)

Please let me know if this is possible.

Note : I know of httprl module. But it is not of much use as I do not want to make calls in parallel. I rather want to make a non-blocking call and then carry on with my Drupal specific actions.


texts: How to add wysiwyg (like CKeditor) to Disqus module textarea?

texts: As shown in the following image the input textarea of the Disqus is just plain. Is there a way so we can add wysiwyg (like CKeditor) to it? And that input textbox always located at the top of comments, Is there a way so we can shift it to the bottom of the comments (like core comment module of drupal 7)?


texts: How to assign multiple author names for one article?

texts:
Is there any way to mention two or more author names for a particular article in Drupal 7?

I need to add two author names for one article.

I tried to add two author names in the Author text box, separating them by commas, but it did not allow me to do this.

Is there any module or other way to do this?


texts: Failing to create thumbnail, medium and large images

texts:
When using a new installation of Drupal 7.10, I have set the directory for public uploads to sites/uploads.

When I then add an image to a content instance, I get the original uploaded to sites/example.org/files/imagename.png as expected. However, the other images (thumbnail, medium and large) do not get created at sites/example.org/styles/*.

The directory is readable and writeable by the PHP5-FPM user, and so there should be no issue permissions wise.

Why does this happen? How can I fix it?


texts:
I have the CK profile installed and found a strange behavior in Views installed along with it (no Term ID filter criterion available), so I decided to upgrade Views to the latest dev build. I deleted the Views folder from the profiles/commerce_kickstart/modules and now my admin won't work. The error messages vary over time, but they relate to include files missing, such as:

Fatal error: require_once() [function.require]: Failed opening required
 '//profiles/commerce_kickstart/modules/views/plugins/export_ui/views_ui.inc'
 (include_path='.:/:/usr/local/php/pear5') in /profiles/commerce_kickstart/modules
 /ctools/includes/plugins.inc on line 468

How do I resolve the situation? And, most importantly, how should I proceed next time to perform a safe update of individual modules from the profile.


texts: hook_field_extra_fields: hidden by default

texts:
When implementing hook_field_extra_fields(), can I make the extra field hidden by default?

Sometimes it is friendlier to offer the extra fields as an option, instead of displaying it immediately after a module is enabled.


texts: $base_url set to an external domain causes problems when logging in

texts:
I am developing a conference site with Drupal 7. The site is hosted at domain1.com. The conference is covered by another organization, and they require the conference page to be accessible from their own domain, something like organization.com/conference2014.
Fortunately, Drupal has the $base_url variable and the site is accessible from organization.com/conference2014.

My problem is when I want to access administration interface of Drupal from organization.com/conference2014?q=user/login. After I enter my credentials, Drupal redirects me to the organization.com site which is administrated by the organization administrator. When I access again organization.com/conference2014, it still asks me for the password.

What I need to achieve is, after entering the credentials, being redirected to organization.com/conference2014, and being to perform any administration task.

Do you have any idea on how to tackle this problem?


texts: how to alter exposed form values before submit for filters in drupal7 view

texts: I want to do left and right trim when end user enters data in textbox for filter list of rows in drupal 7 views


texts:
I need to make a form read-only under certains conditions : what I did is to not add the $form['submit'] button.

This way I can't submit the form. But I wonder if it is enough ...

Do you know if I ca be 100% sure that nobody could find a way to submit the form ?

Thanks !


texts: I am hitting 150lb per package limit on UPS with Commerce Shipping on D8

texts: I have a project that needs to get quotes (via UPS) of 4 50lb packages. I'm hitting the 150lb per "package" limit/error. Are there any solutions for changing the shipping request to UPS be for multiple packages or per package and then add the total?


texts: How to download webform data to an Excel file?

texts:
I'm using the Webform module (version 7.x-4.8), which I only enabled (I didn't change any configuration). I have 10 records in the database.

I want to download the data from Webform to an Excel file, using the typical screen to do so, as in this screenprint:

I tried using these Export Formats:

Microsoft Excel: I can't open the download with with Microsoft Excel 2007.
Delimited text: No data in the file.

I also tried using these Download Range Options (which didn't help either):

Set All submissions (10 total).
Set Submissions by number from '1' and optionally to:(blank).

Any suggestions about what the problem might be?


texts: Perform a query with an entity field condition with multiple values

texts:
I have a content type that has a entity reference field that allows users to add multiple taxonomy terms in that field. I'm attempting to perform queries that grab nodes that have a specific set of taxonomy terms within that field.

Using one value in that field works fine, like so.

    $query = \Drupal::entityQuery('node')
        ->condition('status', NODE_PUBLISHED)
        ->condition('type', 'custom_type')
        ->condition('custom_taxonomy', 2)
        ->sort('field_last_name', DESC);

Where 2 is the id of the term I'm searching for. However when I attempt to search for nodes that contain two specific terms like so,

    $query = \Drupal::entityQuery('node')
        ->condition('status', NODE_PUBLISHED)
        ->condition('type', 'custom_type')
        ->condition('custom_taxonomy', [2,8])
        ->sort('field_last_name', DESC);

I receive the error

  Invalid parameter number: number of bound variables does not match
  number of tokens:

I've also attempted

    $query = \Drupal::entityQuery('node')
        ->condition('status', NODE_PUBLISHED)
        ->condition('type', 'custom_type')
        ->condition('custom_taxonomy', [2,8], 'IN')
        ->sort('field_last_name', DESC);

Which doesn't fail, but doesn't provide the intended results. It displays every node that has either term 2 OR term 8. Instead of term 2 AND term 8 as intended.
How would I perform a query that checks if a node has multiple specific values in an entity reference field?


texts: Views exposed filters do not display in front end

texts:
I created a view block. I can see the view block on my page (node/30) no problem. Edited the view by adding filter criteria. I also changed "use Ajax to Yes". I can see the exposed filter in views edit page but I dont see the views at all on my actual page when I add the filter criteria. After I remove the filter criteria, I see the views again on my page. When i added the filter criteria, I also checked "exposed to user option.." I am not sure what I did wrong.

Please help.

D


texts:
Can anyone advice me on how I can include a settings/configuration form for my custom module within Panelizer?

I'm working on a custom module which uses an API to display data to a user.
The block contains a form which is placed on a page via Panelizer.

My block displays with no problems but I need to allow some settings to be made on each occurrence of the block on the same or different pages.


texts: Is there a way to return "Drupal root" value that is faster than running drush status?

texts: I'm trying to add something to my shell that shows the current Drupal root value so that we can use drush use more, but the only way I can see to return the current Drupal root value is to run drush status which is quite slow


texts:
I want to add Emoji smiles in Drupal 7 comments without using a sandbox project like https://www.drupal.org/sandbox/mparker17/2078481.

Does anyone have any idea how to add Emoji smiles in comments?


texts: Is it possible to add the Browse Server button on Link Field? So user can link to and see internal file or image? I have tried the Linkit module, but that is not really what I want.


texts: Twig Template print field - if not node number

texts:
I can print an image field in my node template like this:
{{ content.field_big_image }}

But can I say "print this field but not if the node number is node/45" ?


texts: How to hide the (-) sign from facet filter block?

texts:
I am displaying faceted blocks and current search block on the search page.

When I select a filter from any faceted block, it appears in the current search block and also in that faceted block with this sign (-).

When I click on this sign it removes the filter from the search.

It is fine in current search block. But It should not appear in the faceted block.

Suppose If I select category1 from the facet block. In the current search block and in its facet block it appears like this (-) category1.

And I want that in the current search block it should appear like (-) category1 and in its facet block it should on display its name like category1 without the (-) sign.

Any one who know how to hide this in the facet block?


texts:
I have two node types: Item and Order. I have an entity reference (field_items) set up on the Order content type which references Item (1 Order to N Items).

The Item has a field (field_reservation_status) which is a drop-down list of strings.

I am trying to set up a rule so that when I allocate an Item to an Order on the Order form, the reservation status on the related Item will be set to "Reserved".

I am doing this with a reacting rule and a rule component as follows.

Rule component

Condition: Node is of type "Item"

Action: Set a data value (this should set field_reservation_status on the node that the component is actioning to "Reserved")

Reacting rule

Event: When a content node is saved

Condition: Node is of type "Order"

Action: Add a variable (this should store field_items for the current Order node)

Then

Action: Call the rule component

Questions

In the rules config UI I can't see any "Add Loop" button - is this to be expected in version D8 Alpha 3?
What data selector should I use for accessing field_items on the Order node that has just been saved?
What data selector should I use in the rules component to access field_reservation_status on the current object from field_items?
How do I set up a loop over the variable that is created in the reacting rule?

No doubt I'll have more questions.


texts:
I have this code:

$cache = \Drupal::cache();
$result = $cache->get('tdcf_00SPH46T');

Then, I got this notice:

Notice: Undefined index: tdcf_00SPH46T in Drupal\Core\Cache\DatabaseBackend->getMultiple() (line 92 of core/lib/Drupal/Core/Cache/DatabaseBanckend.php).
Drupal\Core\Cache\DatabaseBackend->getMultiple(Array, ) Line: 63
Drupal\Core\Cache\DatabaseBackend->get('tdcf_00SPH46T')_(Line: 46)
...

Is any way for check if this cid is defined, for example:

$cache->has('tdcf_00SPH46T');


texts: Using Contextual filter in Filtering attached view

texts:
Suppose I have these two node types, with the following fields:
Port
Name
Description
Voyage
Name
Port1
Port2
Port3
I used References to link the port fields in Voyage to the node ID of the Port nodes.
Now, in the page of any port node, I need to attach a display of voyages names that has calls to that port. How can I achieve that in Views with EVA?
Or to put it logically: "SELECT Name FROM Voyage WHERE (port1 = (urlid) or port2 = (urlid) or port3 = (urlid));" urlid is the ID of the port we are getting through the argument (contextual filter).
I have used contextual filter, but there seems to be no way to use OR in contextual filters...


texts:
I want to customize user profile page as per my own way.
I have created one file named as page--user.tpl.php, but after making changes in this file during user logged in, the changes reflects on sign up(register page) without logged in.
But i only wants to change the look and feel of individual user's page.

Please help me.

Thanks


texts: How to alter commerce cart view to show custom line item data - either through UI or custom module

texts:
In a custom module I am adding data to a line item added to the cart like this:

$user_to_add =_get_user_by_ain($ain);
$product = commerce_product_load($product_id);
$line_item = commerce_product_line_item_new($product, 1, 0, array('apply_to_user' => $user_to_add));
commerce_cart_product_add($user->uid, $line_item);

This data is used in Rules after checkout is completed.  What I'm struggling with now is being able to show that data in the cart view (default, Commerce provided, commerce_cart_form).  For example, if the $user_to_add contains the users first name, I'd like to be able to show that in the cart view next to the product label.

I've been going through the views api, testing the hooks available, and I can't figure out where to do this.  In the hooks that I've tried, the data is is available in $view->result[0]->_field_data['commerce_line_item_field_data_commerce_line_items_line_item_]['entity']->data['apply_to_user']


texts: Views slideshow with multi value imagefield

texts: I have created a content type and added an image field with unlimited option. Now I want to setup a views slideshow. Some nodes have single whereas others have multiple images. So my slideshow should show single image as well as all the images if the node has multiple images grouped together.


texts:
I have a site where there are multiple staff profiles, each of which are in a specific department; some times more than one. Parts of these profiles are then displayed in a grid view for each department.

What I need to do is have a method of setting their ordering in the grid view. My original plan was to just have a text field where they can enter the profiles position number & have the view order by that. The problem is they can be part of multiple departments so the numbers entered could conflict between departments.

Does anyone have any ideas on a way around this?

The other idea that has been suggested is to add a weighting to each profile and that would dictate its position, still kind of has the same problem as the text field though. If I was to use the weighting system what is the best way to add it? I assuming just creating a select field with the options -50 through to +50 isn't the best way?


texts: Failed asserting that two strings are equal in a patch

texts:
I have submit a patch on community but I am getting an error in result that Failed asserting that two strings are equal.
This is the patch.

index 31bf064..fa079cc 100644
--- a/advagg_css_minify/yui/CSSMin.inc
+++ b/advagg_css_minify/yui/CSSMin.inc
@@ -422,7 +422,10 @@ class CSSmin

         // restore preserved comments and strings in reverse order
         for ($i = count($this->preserved_tokens) - 1; $i >= 0; $i--) {
-            $css = preg_replace('/' . self::TOKEN . $i . '___/', $this->preserved_tokens[$i], $css, 1);
+            $preserved_tokens = $this->preserved_tokens[$i];
+            $preserved_tokens = htmlspecialchars($preserved_tokens);
+            $pt_replacepattern =  preg_replace('[^A-Za-z0-9@*.#:/ \-]', '',$preserved_tokens);
+            $css = preg_replace('/' . self::TOKEN . $i . '___/', $pt_replacepattern, $css, 1);
         }

         // Trim the final string (for any leading or trailing white spaces)
@@ -582,7 +585,10 @@ class CSSmin
         // one, maybe more? put'em back then
         if (($pos = $this->index_of($match, self::COMMENT)) >= 0) {
             for ($i = 0, $max = count($this->comments); $i < $max; $i++) {
-                $match = preg_replace('/' . self::COMMENT . $i . '___/', $this->comments[$i], $match, 1);
+                $comment = $this->comments[$i];
+                $comment = htmlspecialchars($comment);
+                $replacepattern =  preg_replace('/[^A-Za-z0-9@*. \-]/', '',$comment);
+                $match = preg_replace('/' . self::COMMENT . $i . '___/', $replacepattern, $match, 1);
             }
         }


texts: Drupal template files are not recognized

texts:
sites/all/modules/dc_wiwo
function dc_wiwo_theme($existing, $type, $theme, $path) {
  return array(
    'dc_wiwo_page' => array(
      'variables' => array('tweets' => array()),
      'template' => 'wiwo',
    ),
  );
}

function dc_wiwo_page() {
  return theme('dc_wiwo_page', array('tweets' => array()));
}

If I put a template file in sites/all/modules/dc_wiwo/wiwo.tpl.php it works, but if I put a file in sites/all/themes/media/wiwo.tpl.php it doesn't work. I thought you could override templates in the theme. Is there a setting I have to change to allow this?


texts: Synchronize users strategy for Drupal 7?

texts:
I am trying to think of a logical way to integrate another system's users with Drupal's. The actual integration is between Drupal and WHMCS. WHMCS has its own API so you can do things like getUser(emailAddress). What should be my strategy? Is there an easy way to make Drupal completely ignore the local "users" table and rather use another source for authentication? Perhaps auto-creating an entry on the Drupal side for non-existing users and automatically making users inactive that no longer exist on WHMCS's side?

UPDATE

I tried the suggested authorization providers suggested, but it seems my problem is the other way around. I don't want other sites to be authenticated using my drupal site's login details. What I actually want to do is use an installation of WHMCS, and use that as the authorized users list. In other words, when a user tries to log in using their whmcs details, it must log them into the drupal site. If they change their e-mail address on the drupal site, it must update it on the whmcs site. I know how write the api implemtation, I just don't know what I must use to do the groundwork. I would imagine there is already some kind of middleware that does the bulk of the work, and then I just have to code the implementation that does the lookup of a user, the call to update the details etc.

Is there something available that will allow me to easily integrate with a JSON Api like WHMCS?


texts: ob_start(), ob_get_contents()  do not work in preprocess functions?

texts:
I tried to catch some HTML output in preprocess function with ob_start() and ob_get_contents(), but the output seems to slip through them. Is output_buffering maybe disabled in Drupal?

This is the pseudo code from mytheme_preprocess_page():

ob_start(); ?>

    This is block

<?php $vars['my_block'] = ob_get_contents();

When I do this, I get the
 output directly and not dumped to $vars['my_block'], as one would expect. My guess is that output buffering is, for some reasons, disabled. I am wondering if that is the case and why.


texts: Can't override links__system_main_menu in Drupal

texts:
Im working on my custom theme (modified stark theme) and there is a main menu in page.tpl.php generated by:

<?php print theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 'gold')))); ?>

I want to define my own html for main menu so I created a template.php file with this function:

function budo_links__system_main_menu($variables) {
  $html = "
\n";
  $html .= "
\n";
  foreach ($variables['links'] as $link) {
    $html .= "
".l($link['title'], $link['path'], $link)."
";
  }
  $html .= "
\n";
  $html .= "
\n";
  return $html;
}

where budo is a name of my theme. But menu is still generated old way and not by this new function. It should work according to this explanation, but it doesn't even if I flush cache. Did I forget something?


texts:
In Drupal 7 theme settings, you can upload a logo.
How do you print the width and height of this logo in your theme?

Background Research:

theme_get_setting('logo') lets you get the path of a logo uploaded in the theme settings.

image_get_info lets you get the height and width of an image.

However, image_get_info(theme_get_setting('logo')) does nothing.


texts: Anyone know how to build a menu like this?

texts:
We are redesigning a site for a client and they're wanting to create a menu similar to the one found here (the big menu below the header, not the hamburger menu at the top left):

http://www.business.vic.gov.au/

Looks like it may have been built from scratch w/ jQ but thought someone might know of an existing module or theme that could get us started in the right direction.  Appreciate any advice or help.

Thanks!


texts: I have a custom block with text in the body field. I need to prepend some text to this body field, either using php in a theme_hook function or in a twig file. How can I get just the text of the body field of a custom block so that I can alter it?


texts: node type not getting in search template

texts: I am referring to document search-result.tpl.php on Drupal.org. Here they say $info_split['type'] has the node type information, but when I print in the file search-result.tpl.php in my theme folder, it does not print anything, as that key does not exist.  So is there something that I should do to get this info?


texts: CAS Authentication disable drupal invitation

texts: I am using the CAS module to authenticate my users. That is working fine and dandy, but I want CAS to be the only way a user can authenticate. Currently when the user goes to /login, it shows a page where it gives them the redirection notification message, a drupal login invitation message, and a log in button. Only when they click the login button, is CAS authentication conducted. Is there a way to have it so that the only way to authenticate would be using CAS?


texts: How do I replace a module with a dev version through the UI?

texts: I copy the reference to the dev release for a module and paste it into the "Install module" form, but Drupal complains that the module is already installed. Is there a good way of doing this through the UI or drush or do I just have to uninstall and reinstall?


texts:
I'm trying to override the title of a system provided local task. I have the following code which works for uid 1 but not authenticated users:

function test_controller_menu_local_tasks_alter(&$data, $router_item, $root_path) {
  if ($root_path == 'user/%') {
    foreach($data['tabs'][0]['output'] as $key => $item) {
      if ($item['#link']['path'] == 'user/%/edit') {
        $data['tabs'][0]['output'][$key]['#link']['title'] = t('Password and email address');
      }
    }
  }
}

According to this issue this is expected behaviour for the time being. Is there another way round this?


texts: adding the field tokens while creating the component

texts: I created the component, in body of the message i added the token based on machine name but i am unable to fetch the data of the fields of content i,e when email triggers to user in the body of the email field data is not showing based on the content created, i have followed this method Get the field data in email body. please give suggestion why is this happening?


texts:
I have a page for available job positions, which has some content but I'd like to also place a list of the jobs in the middle of this content.

I would like this list to be dynamic based on currently published "job" nodes. The problem is this content is within a block. I know about views and can easy create a list with views, but I don't want this list to be a stand-alone block. Is there a way to pull a dynamic list like this into a pre-made block?


texts: How do I make an archived-dump of my site?

texts:
I have multiple versions of drush and cannot make an archive-dump of my site.

drush8 ard/drush8 archive-dump returns

  [error]  The drush command 'ard' (and/or 'archive-dump') could not be found.  Run drush
  cache-clear drush to clear the commandfile cache if you have
  installed new extensions.

drush6 ard/drush6 archive-dump returns

  Drush 6.6.0 does not support Drupal . See
  http://drupal.org/project/drush for more information.
  [error] Command archive-dump needs a higher bootstrap level to run -
  you will need to invoke drush from a more functional Drupal
  environment to run[error] this command. The drush command
  'archive-dump' could not be executed.

drush ard/drush archive-dump returns

  PHP Fatal error:  Class 'Drupal\Core\Session\AccountInterface' not
  found in /var/www/mywebsite/core/includes/bootstrap.inc on line 60

drush8 = * remote origin
  Fetch URL: https://github.com/drush-ops/drush.git
  Push  URL: https://github.com/drush-ops/drush.git

drush6 = * remote origin
  Fetch URL: https://github.com/drush-ops/drush.git
  Push  URL: https://github.com/drush-ops/drush.git

drush =  Drush Version:6.2.0

If I run drush8 status on my local site it returns

  Drush:9.0-dev-g9bbddb2

If I run drush6 status on my local site it returns

  Drush 6.6.0 does not support Drupal . See http://drupal.org/project/drush for more information.

If I run drush status on my local site it returns

  PHP Fatal error:  Class 'Drupal\Core\Session\AccountInterface' not found in /var/www/mywebsite/core/includes/bootstrap.inc on line 60
  Drush command terminated abnormally due to an unrecoverable error.                                                                         [error]
  Error: Class 'Drupal\Core\Session\AccountInterface' not found in /var/www/mywebsite/core/includes/bootstrap.inc, line 60


texts: Drupal 7 - how to use jw player using videos located on a CDN

texts:
We are currently using Drupal 6 and are in the process of upgrading to D7.

When I went to see if the module created by LongTail had a version compatible with D7 I found out that they don't have one, but they recommended to use this one:

http://drupal.org/project/jwplayermodule

The problem I'm currently facing is that I can't figure out how to use this module with videos that we already have in our CDN.

Any way to do this without having to upload my videos to the site?

Thank you,

Onema.


texts: How to set the size attribute of a select field?

texts:
When you use a "select" field with multiple values Drupal generates this HTML:

<select multiple="multiple" name="..." id="..." class="...">

How can I inject the size="..." attribute? This will cause the box to show more values.


texts:
I am using the Modal forms (with ctools) module for registration and login in my Drupal 7 site.

When I click login/register, I am able to log in with an already existing username, but I am not able to create a new account. When I enter the registration details and create the account, nothing happens.

What is wrong with this?


texts: How to apply patches on Term Reference Tree

texts:
while using Term Reference Tree module it shows me following error. I have found the PATCH for this error.

I am new to drupal. I don't know how can I apply this patch. Please help me to solve this problem. Thank you very much.

Notice: Undefined property: stdClass::$vid in i18n_taxonomy_term_name() (line 461 of /home/lawand9/public_html/law/sites/spanish.lawandmoney.info/modules/i18n-7.x-1.11/i18n/i18n_taxonomy/i18n_taxonomy.module).
    Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 173 of /home/lawand9/public_html/law/includes/entity.inc).
    Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 350 of /home/lawand9/public_html/law/includes/entity.inc).
    Notice: Undefined property: stdClass::$vid in i18n_taxonomy_term_name() (line 461 of /home/lawand9/public_html/law/sites/spanish.lawandmoney.info/modules/i18n-7.x-1.11/i18n/i18n_taxonomy/i18n_taxonomy.module).
    PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.i18n_tsid' in 'field list': SELECT base.tid AS tid, base.vid AS vid, base.name AS name, base.description AS description, base.format AS format, base.weight AS weight, base.language AS language, base.i18n_tsid AS i18n_tsid, v.machine_name AS vocabulary_machine_name FROM {taxonomy_term_data} base INNER JOIN {taxonomy_vocabulary} v ON base.vid = v.vid WHERE (base.tid IN (:db_condition_placeholder_0)) ; Array ( [:db_condition_placeholder_0] => 1 ) in DrupalDefaultEntityController->load() (line 191 of /home/lawand9/public_html/law/includes/entity.inc).


texts: Views Image Field - Field Collection Show Only one Image

texts: I have a view that displays an image from a list of image field collections. However, it is showing all the images from the collection. I only want the first image to be shown and hide the others.


texts: Views Search API with Search API database, sort handler

texts:
I need to have a views handler for Views Search API that will allows empty (i.e. NULL) values in fields to be sorted last.
For the simple views there is a solution: Views Sort Null Field but I'm totally lost,  How to implement the same functionality for Views Search API?

More specifically - Views Search API provide only $query->sort() method that not allow you to add sort formula like $this->query->add_orderby(NULL, "ISNULL($this->table_alias.$this->real_field)", $this->options['order'], $alias)


texts: How can I override a node's post date theme?

texts:
HTML5 provides a time element, and a lot of modern sites are using the time element for their content post dates.

How can I override a node's post date theming, so I can change the rendering from a div element to a time element?

Currently, the markup looks like:

2015-01-17

I want it to render it as:

<time datetime="2015-01-17T12:00">2015-01-17</time>

I would like to handle this in my theme, since I have an Omega 4 subtheme I use as a base theme for client sites and want it to handle the functionality.


texts:
I am getting a warning when I use a new theme, I've got error that search form not found.

warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'search_form' not found or invalid function name in /......./...../includes/form.inc on line 377.
Line 377
$form = call_user_func_array(isset($callback) ? $callback : $form_id, $args);

I have tried changing some items on line 377.


texts: How to prevent Devel module to be installed on production environments

texts: Using the new Drupal 8 Configuration manager, how can I prevent it from installing the Devel module on certain environments? As far as I know, installing it on my local means the next time I export the configuration and move it to my other environments (dev, test, prod), it will automatically be enabled.


texts: Redirect to parent node after saving the field collection item

texts:
There is a field collection field for a content type, it is called field_item. I gave a direct link to the users to add content to this field based on the it's parent id. this is the url, /field-collection/field-item/add/node/$nid.

After saving the field collection field, the page is redirected to the field collection view page not the parent node and I need to accomplish this.

I tried a few solutions so far but non of them worked.

I tried to do this using rules module, the solution in  Redirect from a Field Collection to its Parent Node or Entity with Rules but it didn't work.

I tried this code to test whether altering the form would change the redirect page

function hook_form_alter(&$form, &$form_state, $form_id){
    if($form['#entity_type'] == "field_collection_item" && $form['#bundle'] == "field_item"){
        $form_state['redirect'] = "/user";
        kpr($form_state);
    }
}

This code prints the form state

But after saving the form it still goes to the field collection page.

From what I know field collection is an entity so I tried this to test the redirection

function hook_entity_insert($entity, $type) {
   $info = entity_get_info($type);
   list($id) = entity_extract_ids($type, $entity);
   db_insert('example_entity')
       ->fields(array(
        'type' => $type,
        'id' => $id,
        'created' => REQUEST_TIME,
        'updated' => REQUEST_TIME,
        ))
         ->execute();
   drupal_goto("/user");

}

But it didn't work again. The admin theme is seven but the users theme is something else. I inserted these functions in both seven theme's and my custom theme's template.php. I also cleared the cache.

How do I can redirect the user to the parent node of the field collection after saving/updating the filed collection?

UPDATE

The only solution I have found so far is this

function hook_form_alter(&$form, &$form_state, $form_id){
    if($form['#entity_type'] == "field_collection_item" && $form['#bundle'] == "field_item"){
       $form['#submit'][] = "field_collection_item_goto_item";
    }
}

function field_collection_item_goto_item(){
    $url = current_path();
    $array = explode("/", $url);
    drupal_goto("/node/".$array[sizeof($array)-1]);
}

Since the node ID of the parent comes at the end of the url, because the url is /field-collection/field-item/add/node/$nidso this code works.

But it is preferred to get the host entity nid of the field collection item in the hook_form_alter and send this nid to the submit function as a parameter. I did my best but I couldn't find host entity nid so I had to use the url.