texts: How can I add a new field to a node with a preprocess function?

texts:
I know that I can make new variables available in my node.tpl.php files by using preprocess functions, and I know that I can theme specific fields in a node by using field.tpl.php files. But how do I add a new field to a node programatically, so that it is displayed when print render($content) is called?

I specifically want to add a new field that includes the feed importer that generated the node. I know how to get this data and have hacked something together that works, but I'd like to know if there's a way that I should be doing this. Perhaps I should be adding the field in a custom module rather than in the theme layer?


texts: hook_commerce_shipping_service_info() rate callback: What does the 'data' array do?

texts:
hook_commerce_shipping_service_info() allows to specify a rate callback.

function snailmail_commerce_shipping_service_info() {
  [..]
  $shipping_services['snailmail']['callbacks']['rate'] = '_snailmail_rate';
  return $shipping_services;
}

function _snailmail_rate($shipping_service, $order) {
  return array(
    // Amount in EUR Cent
    'amount' => 250,
    'currency_code' => 'EUR',
    // What is this?
    'data' => array(),
  );
}

Question: What can I do with the 'data' array in the return value?


texts: I'm trying to remove id's from entity reference autocomplete fields but i got stuck at the initialization of a form where the default value is set to the user name , not the name of the profile2. I've successfully removed the id's when the user changes values but after it hits save the value is set back to user name and the id. What function should i override in entity reference module to be able to change the behavior of the autocomplete field ?


texts:
So I've been struggling with installing Aegir for about a week now, and trying to understand how it should work, and hopefully get it resolved. (BTW, here is a related issue if you're curious:  http://drupal.org/node/1202568 )

First, lay of the land:

RedHat 5.5
MySQL 5.5.13
Apache 2.x
PHP: 5.3.2

I am installing using this command

drush hostmaster-install --aegir_host=hostname --aegir_db_user=myadmin --aegir_db_pass=adminpasswd --aegir_root=/pathto/aegir

So my guesses of what needs to happen to get Aegir up and running:

Upon a successful install, there should be a sites/hostname directory where Aegir lives
This directory should contain a settings.php files
This settings.php file grabs the database credentials that are set in a file inside the vhost.d directory using SetEvn, right? The vhost.d directory is empty. But an entry is needed to get Aegir up and running, right?

Does this make sense? What am I missing?

KM


texts: What is the best way to import new changes from dev to live site using feature module

texts:
I have a live site and I have done many new changes on the dev site already.

I would drop the database on live and import the dev DB into it but there are users on live site.

I came across Features module . What will be best way if I:

create a huge feature with all the options selected (content types, permission, etc etc ) and import it to live site.
or create many little modules using feature and import them to live.

I don't know what changes I have made to dev. There is lot of work which I can't remember.


texts:
How can i add some data to drupal setting object using drupal_add_js withing some ajax callback?

For example I have ajaxified flag link on my page, and have implemented hook_flag in my module, how can I add JS within this hook?

function hook_flag($action, $flag, $content_id, $account) {
...
  drupal_add_js(array(
      'my_module' => array('color' => 'green')
    ),
    'setting'
  );
...
}


texts: How to receive JSON data in controller with Drupal 8?

texts:
I'm using AngularJS one of my module's settings page, so I have a javascript object in client side as a model. Could anyone help me please, how to catch this data in a controller if I send it as JSON with ajax?

This is the model I assembled is angular:

var model = {
  title: 'This is a title',
  url: '/random-custom-url',
  description: 'little descrp',
  blocks: [
    {id: 1, name: 'block1', description: 'blockdecrtiption1', terms: [{"tid":"1","name":"term1","vid":"tags"}]},
    {id: null, name: 'block2', description: 'blockdecrtiption2', terms: []},
    {id: 3, name: 'block3', description: 'blockdecrtiption3', terms: []}
  ]
};

I'd like to "catch" it in a controller's function(as a php associative array), so then I can process it and save to database(I have some own table in the database, created in the module's hook_schema()). What's the right route setup for this? In the controller's function how can I get the data posted with ajax and how to convert it to associative array?

Thanks a lot!


texts: I am using Drupal 6 with the Open Atrium distribution, as for now I am able to send email notifications every time I post or edit a news. However I'd like to create more message templates, specifically I'd like to use a different template based on the news tags. For instance if I publish a news with "gallery" tag I want to use a dedicated template and so on. Any idea on how I can accomplish that? Many thanks.


texts: Media module browser iframe opens with wrong domain

texts:
I have a site that is accessible from a subdomain and www. and when accessing from the subdomain the media module's file browser for file uploads/library opens using the wrong domain and so it fails due to security risks for cross domain iframe access. All I get is a white empty box in the modal. On the main site with www. it works fine.

I'm sure this is a fairly common problem, but I'm unable to find anything.

Anyone able to offer some help?


texts:
I installed the CDN module. In the UI, I set a wrong CDN path.
Now the site is broken and I cannot disable the module from the UI. I have administration access to the server, but I can't figure out how to disable the module. There is a cdn.settings.yml file, but the option isn't there.
I can't find any documentation for the module. Can you please help me?


texts: How can I theme a custom email notification?

texts:
<?php
/**
* Implements hook_mail().
*/
function <module_name>_mail($key, &$message, $params) {
 $options = array(
   'langcode' => $message['langcode'],
 );
 switch ($key) {
   case 'create_article':
     $message['from'] = \Drupal::config('system.site')->get('mail');
     $message['subject'] = t('Article created: @title', array('@title' => $params['node_title']), $options);
     $message['body'][] = $params['message'];
     break;
 }
}
/**
* Implements hook_entity_insert().
*/
function <module_name>_entity_insert(Drupal\Core\Entity\EntityInterface $entity) {
 if ($entity->getEntityTypeId() !== 'node' || ($entity->getEntityTypeId() === 'node' && $entity->bundle() !== 'article')) {
   return;
 }
 $mailManager = \Drupal::service('plugin.manager.mail');
 $module = ‘<module_name>’;
 $key = 'create_article';
 $to = \Drupal::currentUser()->getEmail();
 $params['message'] = $entity->get('body')->value;
 $params['node_title'] = $entity->label();
 $langcode = \Drupal::currentUser()->getPreferredLangcode();
 $send = true;
 $result = $mailManager->mail($module, $key, $to, $langcode, $params, NULL, $send);
 if ($result['result'] !== true) {
   drupal_set_message(t('There was a problem sending your message and it was not sent.'), 'error');
 }
 else {
   drupal_set_message(t('Your message has been sent.'));
 }
}

Please help me, I'm new in Drupal.
Above is my code which send email notification. How can I customize email notification messages without using SwiftMailer or other modules??


texts: How to automatically capture images from URLs?

texts:
My site is a bookmarking site where people share URLs.

First, if the page being submitted has Facebook open graph image information, Drupal should transfer that image to local files and display it (similar to sharing links on Facebook).

Otherwise, display a thumbnail preview of the page.

Thanks for help in advance.


texts: How to prepopulate a node reference field (checkbox)

texts:
On a node/add page I have a node reference. The widget type is "checkboxes" and I'm using the "View used to select the nodes" feature to show up to 5 checkboxes on the node/add page.

I would like to prepopulate a checkbox with the prepopulate module.

The checkboxes use this HTML name value:

name="field_tribe_content[und][18824]"

Usually prepopulate works by adding this to the url, but it doesn't work in this case.

?edit[field_tribe_content][und]=18824

There is some info in the issue queue and I have also tried

?edit[field_tribe_content][0][nid]=18824
?edit[field_tribe_content][0][nid][nid]=18824
?edit[field_tribe_content][nid][nid]=18824

How can I get it to work or what else could I do to preopulate those checkboxes?


texts: Remove HTML Markup from YouTube RSS Feed Import

texts:
Drupal newbie here- using D7 Commons on a WAMP Development setup (for now).

I am importing an RSS feed from YouTube (using Feeds & Media: YouTube modules). It's working great, except that the description text is inserting all the  markup tags in the description text. I have tried setting the field text to simple text and filtered html, but neither eliminates the markup tags.

Q: Is there a way to import the description text without all the HTML markup tags?

Thanks guys!


texts: Change position of submit button on form

texts:
This is my code:

function feature_contact_form_form_alter(&$form, $form_state, $form_id)
{
if ($form_id == 'contact_form_node_form') {
  $form['field_user_agent']['#type'] = 'hidden';
  $form['field_ip_address']['#type']      = 'hidden';
  $form['buttons']['submit']['#weight'] = -15;
}
}

I am using Drupal 6. I am trying to change the position of the submit button. I am using conditional fields also on this content type. weighting is not changing the position.


texts:
I am learning Drupal 8, i know how to create block programmatically in Drupal 7.

Can anyone please suggest how can u create block and render that block in more than one region in Drupal 8?


texts: db_query gives PDO Exception "General error: 1366 Incorrect integer value:" when I try to update table

texts:
I'm trying to execute the following SQL query

$tweet_id_int = intval($tweet->id);
$result = db_query("INSERT INTO tweetsDB (handle,tweet,time_string,tweetid) VALUES     ('%v1','%v2','%v3','%v4')", array('%v1'=>$twitter_handle,'%v2'=>$tweet->text,'%v3'=>$tweet->created_at,'%v4'=> $tweet_id_int));

from inside a Drupal module and getting the error

    PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '%v4' for column 'TweetID' at row 1: INSERT INTO tweetsDB (handle,tweet,time_string,tweetid) VALUES ('%v1','%v2','%v3','%v4'); Array ( [%v1] => davecohen [%v2] => taking it easy - Rosh Hashana [%v3] => Fri Sep 14 08:06:08 +0000 2007 [%v4] => 267918272 )

handle, tweet and time_string are VARCHAR

tweetid is BIGINT

The "TweetID" is the value I received from calling the Twitter API earlier to fetch some tweets. Twitter API returns the Tweet ID as a string, so I called 'intval' before passing it to the SQL query. If I try running the same query into the MySQL database directly via the Sequel Pro console

 INSERT INTO tweetsDB (handle,tweet,time_string,tweetid) VALUES ('davecohen','taking it easy - Rosh Hashana','Fri Sep 14 08:06:08 +0000 2007','267918272')

Then I get no problems at all.

Any help here would be MUCH appreciated!


texts: Menu does not set active trail when generating tree in theme file

texts:
I want to display the whole menu tree in my Drupal 8 theme to be able to show/hide submenus using javascript. To accomplish that, I added the following code to my theme file:

function pspartner_preprocess_page(&$variables) {

  $menu_tree = \Drupal::menuTree();
  $menu_name = 'main';

  // Build the typical default set of menu tree parameters.
  $parameters = new MenuTreeParameters();

  // Load the tree based on this set of parameters.
  $tree = $menu_tree->load($menu_name, $parameters);

  // Transform the tree using the manipulators you want.
  $manipulators = array(
    // Only show links that are accessible for the current user.
    array('callable' => 'menu.default_tree_manipulators:checkAccess'),
    // Use the default sorting of menu links.
    array('callable' => 'menu.default_tree_manipulators:generateIndexAndSort'),
  );
  $tree = $menu_tree->transform($tree, $manipulators);

  // Finally, build a renderable array from the transformed tree.
  $menu = $menu_tree->build($tree);

  // Make menus available in templates
  $variables['main_menu_tree'] = $tree;
  $variables['main_menu'] = $menu;
}

This works, but the active trail is not set.


texts: Keep line breaks when printing custom plain text textarea field

texts:
I'm using Drupal 7. I'm printing out a custom plain text textarea field in the node template using the following code:

print ($taxonomy_term->field_address['und'][0]['value']);

However, when I print it out I lose all the line breaks.  Is there a way I can keep the line breaks in when I print out the field value?

I have already changed the plain text format to add "limit allowed HTML tags" rule for <a> <br> <p>, and removed the "display any HTML as plain text" rule.

Many thanks,

Ben


texts: How do I use the Cufón module to change the title of a view?

texts:
I bought a new theme and I am not getting much support from the place I bought it from. My theme has nice fancy titles in blocks, which are implemented using the Cufón module to change the text. I was wondering if it was possible to do the same with the title of my views.

I have tried overriding the views-view-table-tpl and added <h2 class="title cufon"> around the title, but it didn't have any effect.

How can I achieve this?


texts:
Need to print the profile fields of author of a node in a particular  content type

I am using support tickets for my home owners association website. where in users can login in and create tickets for house keeping, electrical etc. Support tickets modules provides a content type support ticket which is been used for ticket creation. I would like to add profile fields to above content type  example:apartment no, contact nos of the user who creates the ticket node so that the support team looking at the ticket know the contact info.

I am presently on D7
Thanks


texts: Stop caching images in views, force reload of jquery image slideshow when images are externally updated

texts:
In D7, I have a panel that contains a view that contains a jquery image slideshow.

Every day, the images that compose the slideshow are updated by a cron job---ie, every day's new images override the old ones (they are given the same names).  So, say I have image1.png, image2.png and image3.png---every day these files are overwritten with new pictures.

I have added the following anti-cache protections in my meta section to both the page/panel and the view itself:

<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<meta http-equiv="refresh" content="300">

I have also turned off all caching on the server of any duration, and of javascript/css.  I also run the external cron with the cron-key after the image overwrite occurs.

Yet it seems that the only way my slideshow ever updates to reflect the new content of the image files is when I do an F5 or ctrl+r hard reload.

I don't want to ask my users to do this, so how can I force a reload and cache-clearing beyond the measures I've already taken above to get the browser to recognize that the images in the slideshow have changed on the server?

(I saw this recent similar post, How to tell if an image was updated, but it seems to apply to images created by Drupal, rather than created externally and pumped in.)

Update:

I have also added, in light of @mikeytown2's comment below, the following to my .htaccess file:

 # Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On

  # Cache all files for 2 weeks after access (A).
  # ExpiresDefault A1209600
  ExpiresDefault A600 #NOTE, this means ALL sites expire in 5 minutes by default!

  <FilesMatch \.php$>
    ExpiresActive Off
  </FilesMatch>

</IfModule>

The .htaccess is in my public folder.

Even with this, which should be telling Drupal that all caches from my page expire at 5 minutes, I am still not seeing an update when new images replace old ones of the same name in my slideshow.

I have made sure to completely clear my cache and await an external cron, and the old images remain cached in the browser and/or server.


texts: How to configure the Total Subscription module?

texts:
I'm taking a look at the Total Subscription module and have done the basic installation and configuration. But it's not evident how to get it to show up on any given node/page. I've been working from its documentation at https://www.drupal.org/node/2170825.

Any other suggestions about how to configure it?


texts:
My Bootstrap based theme doesnot open the Token browser dialog.
This is a custom node form, and I want to put a browse Tokens Link like this

$form['field_']['token_tree'] = array('#theme' => 'token_tree_link');

Any workarounds?

I tried it in my form_alter with

$form['#attached']['library'][] = 'core/drupal.dialog.ajax';

I'we added jquery ui css/js dependencies but with no luck.


texts: Is it possible to configure read count from Statistics module?

texts:
I am using Blogs in my website, so I want to display the read count of each blog when user viewed the blog. For this I used core module called Statistics. But my requirement is differ from this available feature of Statistics module.

I want to Pre-set the read counter, So that I can manually enter the number of read counter. For example if I enter 100, next count should start 100 onward like 101,102... So how can I achieve this, Please suggest any module or programmatic way to achieve this.


texts: How to add custom fields to views RSS so that feed must get validated?

texts:
I have added 2 custom fields in Views RSS following below tutorials :

Custom field in XML with Views RSS module

https://www.drupal.org/node/1346506

I want to add namespace such as :

  Namespace:  Social

  Fields : social:facebook and social:soundcloud

Code used for above is :

function custom_views_rss_item_elements() {
  $elements['social:soundcloud'] = array(
    'title' => t('soundcloud'),
    'description' => t('Provides a soundcloud to an item element in Views RSS.'),
  );

  $elements['social:facebook'] = array(
    'title' => t('facebook'),
    'description' => t('Provides a Facebook to an item element in Views RSS.'),
  );

  return $elements;
}

function custom_views_rss_namespaces() {
  $namespaces['social'] = array(
    'prefix' => 'xmlns',
    'uri' => 'http://my.site', // tried passing http://base.google.com/ns/1.0
  );
  return $namespaces;
}

Fields get added in feeds but on validation with such as : https://validator.w3.org/feed/ get error such as "Unexpected item "

Please suggest how we can add custom fields and make them validated as well.

Thanks!


texts: Creating several users in one request using Services/REST/Json

texts:
I'm using Services 7.x-3.12 and able to create a single new user using REST/Json post, and that works well.

Is it possible to create multiple new users in one request? I couldn't find any documentation on this and wasn't able to make it work. I tried separating the users with a comma inside the Json body, like so:

{{"username":"testuser27”,"mail”:"testuser27@gmail.com","pass”:"test","roles":"2","status":"1"},{"username":"testuser27”,"mail”:"testuser27@gmail.com","pass”:"test","roles":"2","status":"1”}}

but no success - I get this error:

[ "Missing required argument account" ]

Any help/pointers would be appreciated.


texts: Getting a 500 error with the Domain Access module

texts:
I use Drupal 7.22 with 7.x-3.9 Domain Access Module for multiple subdomains website.
Making of subdomains works fine, but I cannot access to subfolders on subdomains.

example.com works
example.com/admin/ works
sub.example.com works
sub.example.com/admin/ internal server error 500

This error is showing on every sub-folder (content) in every sub-domain. The root domain is fine with all content. Also, theme changing on sub-domains works fine. Am I missing something in documentation?


texts: DateTime field value is automatically adjusted for the timezone set in Drupal

texts:
I have a DateTime field in a content type. I set the value as 00:00:00 for the H:m:s. My timezone is set to Europe/Bucharest. Whenever I get the field the value changes to 21:00:00.

Obviously Drupal is adjusting to fit my timezone. I assume, I'm not sure.

I don't want any sort of adjustments to be made. I want the time I've entered.

How can I get the non-adjusted time or disable Drupal adjusting the time?


texts: Problem with views recent comments block

texts:
I have a problem with the recent comments block created with Views. I have overridden the view fields in the view template (views-view-fields--comments-recent--block.tpl.php) and printed out the fields:

print '
'. $fields['subject']->content .'
';
print '{  '.$fields['name']->content. '' .', '. ''. $fields['timestamp']->content .' }';

It displays the name of user that created that node. For example, I've created a node titled "blahblahblah" and I added a comment on my node; the block displays "blahblah - posted by heihachi." If another user (jessica) posts a comment in that node, the block still displays " blahblah - posted by heihachi," not "by jessica."
Why?


texts:
I have added a #submit handler to the default submit action on a node edit form:
$form['actions']['submit']['#submit'][] = '_app_submit_to_usercart';

and it works correctly. But I then add a 2nd submit button as:
  $form['actions']['save'] = [
    '#type' => 'submit',
    '#name' => 'Standard Save',
    '#value' => t('Print and Mail Check'),
    '#button_type' => 'primary',
    '#weight' => 6,
  ];

and for some reason the submit handler for the submit button gets run for this button as well. I am sure in my handler I can act depending on which button was pressed; but wondering why I need to do that.
EDIT
Apparently I am asking the wrong question. From my code above it seems that regardless of which button i click it is still submitting as if the main button is pressed. So question is how can i add another button (I have done this dozens of times in D7 and I thought a few times in D8; so not sure why this isn't working).


texts: Keep file download list of each authenticated users

texts:
I have a content type "Application" and each "Application" content has a downloadable file.

I'd like to keep the downloaded file list, actually node list, & count for each authenticated users.

Is there any ready-made module provided for this feature ?
Or
How can I achieve it by programming ?


texts: How to return a user's group access permissions?

texts:
I am trying to block a user from accessing certain content/blocks if they do not have permission to view content of a certain type within a group.

I have the user ID and the group ID, but how do I check the user's permissions for that group? I can't find any documentation.

To start, how would I print all the permissions for a given user and group?


texts: Exclude some, not all, user profiles from search engine results

texts:
Is there a way to let users choose if they want their user profile to be excluded from external search engine results? Any modules or hooks known?

It should be based on the de/selection of a boolean field "Display my user profile in search engine results".


texts: check whether a user downloaded a file from private system file?

texts:
What I wanted to do is to show a tick icon (just next to download link), after a member downloaded a private file, which implemented by Protected File Module (files are saved on private file system).

I am using Drupal 8, thanks for any help.


texts: Variable and domain_variable have stuffed up my menus

texts:
Variable and domain_variable modules fixed the front page issue, so I am now able to have two unique front pages. However, it has broken the main menus. I've had the original Main Menu displaying on the default domain, and created a new menu for the Secondary domain. The new menu was displaying fine, until I installed the domain_variable module and set the front pages.

My issue is: the Main Menu is being displayed on both the domains, even though I've got a different menu which should be displaying on the secondary domain.

How do I get the menus to display correctly? How do I get the secondary meny to display on the secondary domain (as the main menu across the top)?


texts: How to use a standalone page with a module

texts:
I'm working on a website that communicates with a bank API.
During the process, the API sends a request to a callback page. I, therefore, created a "callback_bank.php" file, and put it at the root of the drupal folder (along with index.php, cron.php, etc.) so it's accessible by http://www.mywebsite.com/callback_bank.php

How would I go about packaging/deploying that file with the custom module I created, that does the rest of the work ?

Thank you!


texts: ajax update seperate page when a button is clicked on a popup

texts:
I created a content type that is used to display a list of videos hosted on brightcove. I have a module that is setting a cookie for the anonymous user when they watch one.

I created a module that will display the video that they clicked in a popup. Inside this popup window there is a button to go to the next video. When they clicked the video that launched the initial popup I can use jquery to change a div class to get a viewed icon to appear next to the video link no problem.

When the "next video" button is clicked I have it play the next video in the same popup. However, I would like to have the "video viewed" icon appear without a refresh on the originating page.

You can see this in action at http://www.lynda.com when you watch one of their videos. You click a video on the course list, a popup appears and you can click the next video button. A viewed icon will appear without refresh on the course list (not the popup).

How do I use ajax in such a way that when a button is clicked it updates a different page? In the pop-up I am passing a video ID as well as the drupal node id of the course the video belongs to.


texts: Unable to remove label field from the registration form

texts:
I am unable to remove the label from a form element of the registration form.

I have:

Enabled the kint module for debugging
Implemented hook_form_alter() and tried to change the form variables

function drupalfresh_form_user_register_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  kint($form);
  $form['field_company_name']['#attributes']['widget'][0]['#title'] = t('');
}

This doesn't change the form.

This is how the form element appears.


texts: What is causing Views to consistently but intermittently not find a view provided by the Advanced Forum module?

texts:
I'm getting a frequent, intermittent error from the Advanced Forum module that causes a 500 error when it occurs (WSOD). On production, it's happening about 20 times per hour, on probably 2-3% of all forum page loads per hour. It is consistently intermittent. Locally, I cannot consistently reproduce the error, but it does occur.
The error is on

Line 232 o f sites/all/modules/contrib/advanced_forum/includes/core-overrides.inc`:
Call to undefined method stdClass::preview()

The problem lies with the advanced_forum_get_topics() function:
function advanced_forum_get_topics($tid, $sortby, $forum_per_page, $sort_form = TRUE) {
  $term = taxonomy_term_load($tid);
  drupal_add_feed('taxonomy/term/' . $tid . '/feed', 'RSS - ' . check_plain($term->name));

  // Views handles this page
  $view = views_get_view('advanced_forum_topic_list');
  $view->sort_form = $sort_form;

  return $view->preview('default', array($tid));

}

Essentially views_get_view() fails to find the view and the object isn't created as expected on the return line. So the problem seems to lie with Views occasionally not knowing the view exists. This makes me think it's a hook problem.
Where it starts to get odd are the implementations of hook_views_default_views() and hook_views_plugins(). According to views.api.php hook_views_default_views() should be in a file called MODULENAME.views_default.inc and hook_views_plugins() should be in a file called MODULENAME.views.inc. However, both files are in the MODULENAME.views.inc file.
From views.api.php:

hook_views_plugins()
This hook should be placed in MODULENAME.views.inc and it will be auto-loaded.
MODULENAME.views.inc must be in the directory specified by the 'path' key returned by MODULENAME_views_api(), or the same directory as the .module file, if 'path' is unspecified.

hook_views_default_views()
This hook should be placed in MODULENAME.views_default.inc and it will be auto-loaded.   MODULENAME.views_default.inc must be in the directory specified by the 'path' key returned by MODULENAME_views_api(), or the same directory as the .module file, if 'path' is unspecified.

I tried splitting up these routines into the seemingly correct files. This caused Views to consistently find the Advanced Forum view (as indicated that it appeared in the Views GUI list) but not see the plug-in. The pages in Advanced Forum ran fine, but the views were blank because they referenced a style plugin provided by Advanced Forum that Views was no longer seeing.
I assume I'm missing something about Views hooks, but I'm totally stumped.

Stack: Drupal 7, Views (7.x-3.3), CTools (7.x-1.0), Advanced Forum (7.x-2.0)
PHP FPM, APC, nginx, Redis
I didn't find anything helpful in this d.o issue

UPDATE 1: While I have not solved the root cause, it does appear that disabling Redis and reverting to Drupal's default database-based cache storage mechanism stops the problem from occuring.
UPDATE 2: I can reliably replicate the issue on local by doing a flushall in Redis. The first page load of looking at a forum listing will fatal out. The second page load (and all subsequent) work fine. UPDATE: I have to hit the admin Views listing page to clear the error.
UPDATE 3: On further troubleshooting the issue appears to be caused by the Views cache not properly being rebuilt after a cache clear, only when using Redis. The issue does not occur when reverting to standard Drupal cache. When the issue occurs only 2-4 cache entries exists for Views, as opposed 100+ when the cache is properly built. Visiting the admin views list page causes the cache to be fully built and the issue does not occur. I need to verify if hitting any View view page causing the issue, or just the advanced forum view.
UPDATE 4: A helpful user on IRC has suggested this might be a problem related to Views cache race condition issues: 853864, 1102252


texts:
I have a module in Drupal for getting the url extention via $full_url = $GLOBALS['base_url'];
Now, is it possible to make the full_url global so I can access it in the views module?

When I make a block using views I'm only getting 3 Global option:

Global: Custom text
Global: Math expression
Global: View result counter
here I want my full_url variable


texts: Plugin block not displayed in views page

texts:
I have a created views (page) to display the number of news articles created in each month (This displays month (number of articles) added in that month like May(12)).
I created a content page and linked that views.
Provided a menu link for that content page.
I have a plugin block that displays menu active trail (in sidebar) on a region in that page

Now the sidebar plugin block displayed correctly if I am on the content page. But if I click on any month that takes me to a views page which displays list of articles for that month. But in this page the left sidebar is not showing.

I placed my plugin block in left region and made sure it displays on all content types.

Anything else I need to do to display plugin block in a region if I am on a views page?


texts: How to make a contextual filter optional

texts:
I'm making a contextual filter, to pass along an argument from a panel to a view, using Content: Has taxonomy term ID.

This is so that it pulls in a keyword from a URL.

However, I want it to work so that when no keyword is passed in, it goes based on the last URL parameter.

For example:

www.example.com/tech/startup

It should pull ONLY things with both tech and startup if this is passed.

However, if the URL is just:

www.example.com/tech

Then it should show ALL articles with the tech taxonomy term.

How do I do this?


texts:
How do I get the base_path in Drupal 8? When I use the base_path() function it always returns just the /. I know in Drupal 7 you could set the base_url in the settings.php file, but how do I set it in Drupal 8?

I'm trying to create an absolute url for social media sharing.


texts: Pass block configuration item text field value to variable

texts:
I have a custom block module that has a configuration form of type text_field. If there is a value entered into the configuration form, I want to store that value in a variable.

Here is the configuration hook:

/**
 * Implements hook_block_configure().
 */
function roadmap_block_configure($delta = 'roadmap') {
  // This example comes from node.module.
  $form = array();

  switch($delta) {
    case 'roadmap' :
      $form['roadmap_configuration_form'] = array(
      '#type' => 'text_format',
      '#title' => t('Enter an alternative URL.'),
// the URL entered will be sanitized and attached to hook_block_view(), and ultimately passed to a custom JavaScript file.
    );
    break;
  }
  return $form;
}

If there is a value entered into the configuration form, how can I store it in a variable?


texts: How to put drop down list of content type page in to another content type pages

texts: I have crated two content type like A and B .some of field are similar .I don't want to repeat that field .I want to put drop down list on any one of A or B.


texts: Prevent users from editing a node if a CCK field has a specific value

texts:
I would like to redirect users to an access denied page, if they try to edit a page with a specific CCK field value.

Any tips?


texts: Javascript not loaded in loading ctools modal

texts:
I have a some modal forms, the link of those embedded in views result,
link are somethings linke share/nojs/2 , I register a menu in callback of the links,
It work correctly  for root user, but I test it with 2 authenticated user, It work correctly for one of them and in another when I click link instead open modal form redirect me to /share/nojos/2 and tell me Javascript required,according to my codes,It means the javascript not load,
I really confused what happening and what can be reason of this ?

my codes :

$items['share/%ctools_js/%'] = array(
    // 'page callback' => 'ym_alter_sharing_content',
    'page callback' => 'ym_alter_sharing_callback',
    'page arguments' => array(1),
    'access callback' => 'user_is_logged_in',
    'type' => MENU_CALLBACK,
);

function ym_alter_sharing_callback($js = FALSE) {
    global $user;
// If people aren't using javascript, then I just boot em. sorry. its 2011.
    if (!$js)
        return "Javascript required";
// Include your ctools crap here
    ctools_include('node.pages', 'node', '');
    ctools_include('modal');
    ctools_include('ajax');

// Create a blank node object here. You can also set values for your custom fields here as well.
    $node = (object) array(
                'uid' => $user->uid,
                'name' => (isset($user->name) ? $user->name : ''),
                'type' => 'share',
                'language' => LANGUAGE_NONE,
    );

    $form_state = array(
        'title' => t('sharing'),
        'ajax' => TRUE,
    );

    $form_state['build_info']['args'] = array($node);
// change this to your type node form
    $output = ctools_modal_form_wrapper('share_node_form', $form_state);

// This means the form has been exectued
    if (!empty($form_state['executed'])) {
        $output = array();
// Close the modal
        $output[] = ctools_modal_command_dismiss();
// I use this method a lot on pages that have views, so what I do is get the latest view content
// with the latest node and replace the current view. magic!
        /*
          $html = views_embed_view('my_view', 'my_display';
          $output[] = ajax_command_html('.view-display-id-my_display', $html);
         */
    }
    print ajax_render($output);
    exit;
}


texts: Undefined Index when adding a new field to any Content Type or Taxonomy

texts:
Every time I add a new field to a taxonomy or any Content type, I get this error message on the edit screen.

Notice: Undefined index: default_image in image_field_update_field() (line 439 of /var/www/html/modules/image/image.module).

I'm stuck on where to debug next. Drupal logs show this message? Other image related modules include BackgroundField. Has anyone come across this?


texts: Display paragraphs items in comma-seperated series

texts:
I have a series of paragraphs items representing two different types of contributors to a publication: staff (user link) and non-staff (text).  (See How to control the display of a user account connected via entity reference)

According to Paragraphs preprocess paragraphs handles building the render array for its items in the same way as nodes, comments, etc, so maybe my question is much broader, but here's what I'm trying to do:

I want to send up with a basic comma separated list of items:

Person 1

or

Person 1 and Person 3

or

Person 1, Person 2, and Person 3

with links on the items that should be links.  I guess I just am not getting render arrays and the theming functions well enough yet, that I understand how to do it.

The paragraphs preprocess question makes me think maybe I should be overriding the fields_formatter, but what I've been working on up to this point is theme_preprocess_paragraphs_items().  That seems like it should allow me to do what I want, I can see that I could loop through $variables['element']['#items'] or maybe the integer keys of $variables['element'], but how to change those so that they append ', ' or ', and ' or whatever as appropriate (outside of the link on link items is escaping me).  (I do understand how to determine what should be appended, just not where to append it to make drupal output what I want.


texts: Userpoints: Require userpoint for being able to create a node?

texts:
How would one go about requiring the user to have userpoints before creating a node?

Perhaps with some kind of Rules validation?

Cheers


texts: Adding a filter to a view "or" remove results?

texts:
I've got a view that is trying to show three different content types (Lesson, Drill, Exercise), each with three different flags(Lesson Flag, Drill Flag, Exercise Flag), each of those flags have 3 fields (Review Date, Review Date, Lesson Status).  I only want to display items that have a flag with REVIEW date <= today, OR learning status of Incomplete. But when I add the OR condition that the flags learning status = incomplete, all of the results of the other two content types are removed. (IE, before adding the filter I have 7 items, after adding the filter the view only shows one item that wasn't there before)

This seems to defy my understanding of how the "or" condition works, and I'm curious why this would happen.

Here's a picture with the filters I have set up:

Is there something I'm not understanding about how the OR condition works? Or an existing bugs in views 7x.3x that causes them to behave badly?


texts: Add Menu Block (module) Menu To Page tpl

texts:
Hello i am trying to avoid using the block system with drupal. Im using panels and i dont like having to add the main content if i use any block in a region. anyhow.... i was hoping to add a menu block i have to my page.tpl

The block i want to add has this url to it when i edit it-
block/manage/menu_block/2/configure

The code im using to add another block is

    <?php
      $block = module_invoke('md_megamenu', 'block_view', '1');
      print $block['content'];
    ?>

Ive tried a few things with not much success. If i was to choose my best effort it would be-

   <?php
             $block = module_invoke('menu_block', 'block_view', '2');
          print $block['content'];
        ?>

this just shows 'array' though.

could anyone suggest anything i should try?

Thanks


texts:
I have a view made up of nodes that include node reference fields. I would like to pull in a field from each of the nodes being referenced for display in my view.

I know that is a little confusing so let me give you an example.

My food content type contains the name of a food and the number of calories it has.
My diary content type contains a date and a node reference that accepts food nodes.
My view displays your diary nodes.
I would like to display the calories for each food item that is being referenced by diary
I would like to add the calories using views_calc (or something else).

The way I see it there are two ways to do this - either add a calories field to my diary content type that automatically pulls from the node that is being referenced, thus making it available to my view. The other option is for views to be able to pull in fields (sub-fields?) from a node reference field.

I don't know if either option is possible or, if it is, how I would go about doing it. Any help would be greatly appreciated.

Edit: Relationships will allow me to pull in the fields I need, so now I just need a way to add them. Views_calc does not support calculations on relationship fields.


texts: Give Role Permission to 1 Admin Configuration area?

texts:
Is there a simple way to give access to 1 panel of options within Administration Configuration? I made a custom module with settings under /admin/config/mymodule and it shows up as a block with links in the admin config area.

But I cant see how to easily say Role X can access that -- without giving global access admin configuration in Permissions, which lets them see everything there :(.

My example hook_menu is:

function predeparture_menu() {
  $items = array();
  $items['admin/config/eap-predeparture'] = array(
    'title' => 'Manage Site',
    'description' => 'upload the valid predeparture csv file from this page.',
    'position' => 'left',
    'weight' => -100,
    'page callback' => 'system_admin_menu_block_page',
    'access arguments' => array('administer site configuration'),
    'file' => 'system.admin.inc',
    'file path' => drupal_get_path('module', 'system'),
  );
  // Need at least one child item before your section will appear.
  $items['admin/config/eap-predeparture/list'] = array(
    'title' => 'Student Predeparture List',
    'description' => 'Upload, Revise or Rebuild the student perm list to administer access to the predeparture survey.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('predeparture_csv_admin_form'),
    'access arguments' => array('administer site configuration'),
    'weight' => 10,
  );
  $items['admin/config/eap-predeparture/incomplete'] = array(
    'title' => 'Not Yet Completed Orientation Report',
    'description' => 'These students have not completed the Predeparture survey based on those in the CSV file.',
    'page callback' => 'predeparture_incomplete_listing',
    'access arguments' => array('administer site configuration'),
    'weight' => 20,
  );
  return $items;
}


texts: Access denied on hello world custom module

texts:
Drupal 8 installed in Debian VPS server.
Some installed themes do not work, some do.
When tried to creat a simple 'Hello World' module,as described in a beginners book for drupal, installing of the module was fine; but when trying to open :              www.my***site.com/hello/world i got "Access denied" message.
After installing drupal i treated permissions using this and its comments through the command : chown -R www-data:www-data drupal/

The hello World module creation:
in drupal/module created custom/ and contrib/ folder as well as custom/hello_world/. Within hello_world/ created three files hello_world.info.yml, hello_worl.module, hello_world.routing.ymland hello_world/src/Controller/HelloWorldController.php

hello_world.info.yml

name: Hello World
type: module
description: 'A basic Drupal 8 Hello World Module.'
package: Custom Modules
version: 1.0
core: 8.x

hello_world.routing.yml

hello_world_settings:
  path: '/hello/world'
defaults:
  _controller: '\Drupal\hello_world\Controller\HelloWorldController::
myCallbackMethod'
  _title: 'Hello World'
requirements:
  _permission: 'access content'

hello_world/src/Controller/HelloWorldController.php

<?php
/**
* @file
* Contains \Drupal\hello_world\HelloWorldController.
*/
namespace Drupal\hello_world\Controller;
/**
 * Provides route responses for the hello world page example.
 */
class HelloWorldController {
  /**
  * Returns a simple hello world page.
  *
  * @return array
  * A very simple renderable array is returned.
  */
  public function myCallbackMethod() {
    $element = array(
      '#markup' => '
Saying Hello World in Drupal 8 is cool!
',
    );
    return $element;
  }
}

upon  opening www.my****website.com/admin/hello/world i got Access Denied. Looking further into My**website.com/admin/reports/dblog/event/***5 i got just that it is an Access Denied and Warning in the security field.
Can anyone please explain what is going on?


texts: maintenance mode after error occurs while running update

texts:
Error occurs While I'm running update for my drupal site.  And it stuck in maintenance mode.
I can't log in to it using /user/login.

I changed $update_free_access = TRUE in settings.php and run update.php.
And I see this screen.

It says ctools module is missing.
How can I re-install module when I can't login as administrator?

[Edit]
In the hope of getting the module back, I restored the database with my backup sql-dump via phpmyadmin.
After that, it came to 500 internal server error.

I don't know what was wrong?
Is there any way I can restore my site back on?

Thanks in advanced!


texts: Display the title of related nodes from taxonomy in block

texts:
How can I display the title of related news in a block shown in node page?

For example, I create the content type "news", and add "news" nodes that have taxonomy terms taken from the same vocabulary; now I want to show the list of the related node basing on the taxonomy terms associated with the nodes.

How can I display this bock only for "news" nodes?


texts: I'm searching for the spot, where the price field validation is done as I want to do some more checks here. But I only found the commerce_product_product_form_validate function which is only doing the sku check, but not price. If anyone can point me to the right file / function I would be very glad.


texts: Exposed Filter not shown in view which has a Custom Filter Handler

texts:
I have a view and I programmatically created a filter for this view. (I pasted the code below).

This filter works fine but I had other Exposed Filter created inside the view (created by clicking add filter in the view).

Now the filter added programmatically is working fine but the other one is not shown at all.

If I disable the filter added programmatically then the other one is shown correctly. So the problem is in the code I guess.

I need both filter working together.

here is the code which adds the filter:

/**
 * Implements hook_views_pre_view().
 */
function vouchers_views_pre_view(&$view, &$display_id, &$args) {

   if ($view->name == 'vouchers') {
    $info = array(
      'table' => 'field_data_field_labpoints',
      'field' => 'field_labpoints_value', // name of value field in that table.
      'value' => array('value' => userpoints_get_current_points()), // dynamic part.
      'operator' => '<',
      'id' => 'field_data_field_labpoints_vouchers', // unique id.
      'group' => 100, // new group.
    );
    $handler = views_get_handler($info['table'], $info['field'], 'filter');

    $handler->init($view, $info);
    $view->display_handler->handlers['filter'][$info['id']] = &$handler;

    unset($handler);
  }
}


texts: Forward authenticated user to user.page on /login uri

texts:
If an authenticated user navigates to /login on a Drupal 8 site, she gets the "access denied" error. I want the site to redirect that user to /user (route user.page) instead.
Unfortunately my RouteSubscriber doesn't work:

class RouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {

    /* @var \Symfony\Component\Routing\Route $route */
    if ($route = $collection->get('user.login')) {
      $route->setPath('/anmelden');
      $route->setRequirements([]);
      $route->setDefaults(array(
         '_controller' => '\Drupal\asdentbase\Controller\LogonController::login',
         '_title' => 'Anmelden'
       ));
    }

And my LogonController looks like

public function login() {

    if ($this->currentUser()->isAuthenticated()) {
      return $this->redirect('user.page');
    }

    $rc =
    ...

The route redirection to /anmelden works fine. But my LogonController::login function is never called for already authenticated users. There's seems to be any further magic in the core.

More detail:

I also have a route in mymodule.routing.yml like

asdentbase.login:
  path: '/anmelden'
  defaults:
    _controller: '\Drupal\asdentbase\Controller\LogonController::login'
    _title: 'Anmelden'


texts:
I'm using Drupal 7 with Views 3 module and Location 3 module installed.

I have a content type that has a Location type field and I would like to build a view that given a latitude/longitude input and a maximum distance i have to retrieve all the nodes that are in this range. Is that possible with views or I have to build something by my own (in this case can you show me the way on how to implement it).

Thanks a lot for your help

Danilo

Resuming the question problem is the following:

I have a problem setting a View to show the closest nodes of another (I'm using last dev version of views and locations on drupal 7). So my scenario is the following:
I have 2 differents node types (A and B) both with a location field. I want to build a view that given a node A (with a determinate location) a have to retreive all the nodes B in a distance of 2Km.
So to do that I created a view with the following filters:

Content: Type = B
Location: Distance / Proximity, with the parameters

{origin:"node's lat/lon from views nid argument"}
{Node ID argument to use: (it doesnt allow me to select any data)}
{Location to use:"CCK Location: field_A_loc"}.

I also added a contextual filter. I selected as contextual filter:

{Content: Nid}

and I added % to my path so now the pat is /myviewpath/%. This allow me to choose the value:

{Content: Nid} in the field "Node ID argument to use" of the filter "Location: Distance / Proximity".

So i try to run the view but I get no results when the view is called as mydomain.com/myviewpath/3 where 3 is a A node.

I also tried to do not use the contextual filter (that does not allow me to set the "Node ID argument to use" in the "Location: Distance / Proximity, with the parameters" filter) and running the view mydomain.com/myviewpath/node/3 but in this case I get the list of all B nodes..

What I'm doing wrong setting up this view??

Thanks in advance for your help


texts: Entity reference option limit refering a limited field

texts:
This is what I try to do:
I have a "master structure" built in taxonomy:
Vocabulary A: careers
Vocabulary B: courses, related to careers by a term reference field.

I have schools as nodes. "school" is a content type.
Each school must have the same master structure copied as nodes. Some schools have all careers, some have less. In each school the course structure for a career can differ.

So I created two content types: careers for schools and courses for schools. When a school is created the master structure will be copied to be modified after.

The "career for schools" content type has an entity reference field to the career taxonomy and an entity reference field to the school.

The "courses for schools" content type has an entity reference field to the school, and a "career" entity reference field to the career content type limited to the careers defined for the school. So far, it works.

Now for the course field I want to display only the courses in the school vocabulary that have the career I chose in the career field. But the field is not listed in the option limit settings because there is no matching field.

Is there any way to accomplish this?

Thanks.


texts: Render picture module image in a custom module

texts:
I am trying to render a responsive picture module image from within a module. I cant find any functions that I can pass the picture mapping into.
If I render the whole node from within the module it works fine but if I just render the image it does not work.
Any thoughts would be great.


texts:
I am using devel and <?php dpm($items); ?> in my field template file so the node looks like the following.

I can print the #theme element (which is a string) with the following code.

<?php print $items[0]['#theme']; ?>

What is the syntax to print elements in an array such as URLs, labels, titles?


texts: Is there a way to export ALL translations into a single .PO file?

texts:
To translate my website, I need to export translations one by one per group type.

This gets to be confusing as some fields share core terms ect...

Is there a way to do a consolidated ONE .po file for all translations?


texts: Create a view to list all contents that uses media through any entity reference field

texts:
I know it is possible to create view to list all content that is using media through a particular entity reference field.

Is it possible to create a view to to list all content that is using media thought any entity reference field?


texts: How do I pass an additional variable to function theme_item_list

texts:
I need an additional variable to be available to the function theme_item_list. How do I correcly pass my variable so that I can alter the function like so:

function theme_item_list($variables) {
  $items = $variables['items'];
  $title = $variables['title'];
  $type = $variables['type'];
  $attributes = $variables['attributes'];
  $MY_VAR = $variables['MY_VAR'];

Here is my render array:

  $node->content['list'] = array(
    '#theme' => 'item_list',
    '#items' => $items,
    '#weight' => 2,
    '#prefix' => '
',
    '#suffix' => '
',
  );

Thanks


texts:
I want to list All the images that are present in more than one article.

My setup is like this. I have a content type "article" and it has a field of type "Field Collection" (field_medias), the field_medias has the following fields: field_media (without "s") and field_caption.

I can select all the images with the following EntityFieldQuery

  $result = $query->entityCondition('entity_type', 'field_collection_item')
                  ->entityCondition('bundle', 'field_medias')
                  ->fieldCondition('field_media')
                  ->execute();

And I can select all the articles with the following query:

 $result1 = $query1->entityCondition('entity_type', 'node')
                   ->entityCondition('bundle', 'article')
                   ->fieldCondition('field_medias') //has a image
                   ->propertyOrderBy('created', 'DESC')
                   ->execute();

How can I select all the images that belong to at least 2 articles. Is that possible using a single EntityFieldQuery?

As I have hundreds of thousands of articles and hundreds of thousands of images I have to avoid resource hungry queries.


texts: Entity metadata wrapper - how to get field value, NOT key

texts:
I hhave field_something which is a select field with multiple options:

key1|Value 1
key2|Value 2

I'm trying to get the value of this field using the Entity metadata wrapper.

$wrapper->field_something->value();

This will return the key, not the value as defined in the node's fields.

Any ideas?


texts: Render a menu block in current user's language

texts:
I have a multi-language site.

How this is supposed to work is that on /fr pages, everything except main navigation block should be in French. However, main navigation menu block should be in whatever currently logged user's language.

I tried to change language code in custom module using block or menu hook, but none of them worked.

Thanks in advance.


texts: How to aggregate document.ready actions?

texts:
This may be as much a style question as anything, but:  I'm building a site that uses the Bootstrap theme and a bunch of Bootstrap features -- popovers, dialogs, and the like. This means that I often need to run little bits of initialization code when the page loads; I'm doing these by using drupal_add_js to add the needed bits of jQuery, wrapped in a document.ready() handler.  The usual sort of thing, I think.

This works fine, but they are all being added to the page in their own SCRIPT and document.ready blocks.  Thus the page looks like:

<script>(function ($) {
        $(document).ready(function() {
            somejQueryCode();
        });
    })(jQuery);
</script>
<script>(function ($) {
        $(document).ready(function() {
            someMorejQueryCode();
        });
    })(jQuery);
</script>
<script>(function ($) {
        $(document).ready(function() {
            stillSomeMorejQueryCode();
        });
    })(jQuery);
</script>

as to what it seems like it might be:

<script>(function ($) {
        $(document).ready(function() {
            somejQueryCode();
            someMorejQueryCode();
            stillSomeMorejQueryCode();
        });
    })(jQuery);
</script>

You get the idea.  Like I said, the individual blocks are working, but it seems a little wrong -- you'd surely never write the code by hand like that.  I've explored various arguments to drupal_add_js, and have started experimenting with the AdvAgg module, but haven't found anything that works.  Is there a better way to do this?  Comments to the effect of "this isn't a big deal, don't worry about it" will also be accepted...  Thanks!


texts: Looking for an employee scheduling module

texts:
Using D7, I need to be able to schedule call center staff. Is there any "employee scheduling" module out there?

If not, are there a combination of modules I can use to create such a feature?


texts: Where does Drupal 7 clear my custom set cookies and how do I stop this?

texts:
I have parts of my website that are not controlled by drupal that set cookies.

When I access a drupal-run page, my cookies get cleared. I tried to investigate which script does this by placing print_r($_COOKIE) all over the place in html.tpl.php, but no luck.

Anybody know whats happening here and how I could set my own custom cookies with PHP in drupal template files?

cheers


texts: Is it possible to use Drupal with CouchDB?

texts:
I'm very big fan of CouchDB. I want to try Drupal, but it doesn't have built-in CouchDB support, and i guess it is not easy to add one, because Drupal's DB layer was designed for SQL-based databases. I found only one attempt to add CouchDB support but it is experimental. Is there any successful cases of using Drupal with CouchDB? Or i should ultimately give up on this issue?

There is also MongoDB support, but i just wanted to know all variants.


texts: drush.bat fails with Undefined class constant 'MYSQL_ATTR_USE_BUFFERED_QUERY'

texts:
I have a production apache server (which I have limited capabilities to fix) and I'm struggling to install drush on it. It's Win 2008 R2 server, the php is 5.3.8 and the Mysql server is 5.1.60. Clearly this has been running for years.

Because of the PHP version I cannot use Composer. I've downloaded the windrush folder from the drupal github page (7.0). I've set the Windows PATH to this folder and at least Windows CMD recognizes drush.

But when I attempt to run a command, (the prime mover for wanting to install drush so I can understand the errors in installing a custom module) it bails with the error in the subject line.

drush en mycustommodule

Googling for this command in context suggests that the PDO, Mysql extensions are not enabled in php.ini. Since this server has been running drupal for years, I can confirm they are enabled.

How else to troubleshoot what's breaking? The error is coming from the drupal's includes/database/mysql/database.inc

Thanks for your help to point me in the right direction, sam


texts: How can I show parents after child term inside a Views exposed filter?

texts:
I have a vocabulary with states and cities, where city are children of state:

I have an exposed filter with depth. How can I show parent term after child? For example, like this:

I'm confused because the array has no relation between parent and child. For example, this is the form array select box:

{
#type: "select",
#options: {
0: {
option: {
17: "Aragon"
}
},
1: {
option: {
21: "-Barbastro"
}
},
2: {
option: {
20: "-Calatayud"
}
},
3: {
option: {
19: "-Zaragoza"
}
},
4: {
option: {
16: "Cataluña"
}
},
5: {
option: {
22: "-Barcelona"
}
},
6: {
option: {
24: "-Girona"
}
},
7: {
option: {
23: "-Tarragona"
}
},
8: {
option: {
18: "Valencia"
}
},
9: {
option: {
26: "-Alicante"
}
},
10: {
option: {
27: "-Elche"
}
},
11: {
option: {
25: "-Valencia"
}
},
All: "- Any -"
},
#size: "",
#default_value: "All"
},


texts: How do I hide the title on a specific node?

texts:
How can I hide the title on a specific node?

I have tried the following three modules, but none of them do what I'd like.

Page Title
Exclude node title
Automatic Node titles

I added field_hide_title to the page content type, the code in hook_preprocess_node() function. It can't work fine.

The value shown from print_r($vars['node']) is the following:

stdClass Object(
  [vid] => 4
  [uid] => 1
  [title] => search_material
  [log] =>
  [status] => 1
  [comment] => 1
  [promote] => 0
  [sticky] => 0
  [nid] => 4
  [type] => page
  [language] => zh-hant
  [created] => 1339055801
  [changed] => 1339727555
  [tnid] => 0
  [translate] => 0
  [revision_timestamp] => 1339727555
  [revision_uid] => 1
  [body] => Array(
    [und] => Array(
      [0] => Array(
        [value] =>
        [summary] =>
        [format] => php_code
      )
    )
  )
  [field_hide_title] => Array(
    [und] => Array(
      [0] => Array([value] => 1)
    )
  )
  [rdf_mapping] => Array(
    [rdftype] => Array([0] => foaf:Document)
    [title] => Array(
      [predicates] => Array([0] => dc:title)
    )
    [created] => Array(
      [predicates] => Array(
        [0] => dc:date
        [1] => dc:created
      )
      [datatype] => xsd:dateTime
      [callback] => date_iso8601
    )
    [changed] => Array(
      [predicates] => Array([0] => dc:modified)
      [datatype] => xsd:dateTime
      [callback] => date_iso8601
    )
    [body] => Array(
      [predicates] => Array([0] => content:encoded)
    )
    [uid] => Array(
      [predicates] => Array([0] => sioc:has_creator)
      [type] => rel
    )
    [name] => Array(
      [predicates] => Array([0] => foaf:name)
    )
    [comment_count] => Array(
      [predicates] => Array([0] => sioc:num_replies)
      [datatype] => xsd:integer
    )
    [last_activity] => Array(
      [predicates] => Array ([0] => sioc:last_activity_date)
      [datatype] => xsd:dateTime
      [callback] => date_iso8601
    )
  )
  [cid] => 0
  [last_comment_timestamp] => 1339055801
  [last_comment_name] =>
  [last_comment_uid] => 1
  [comment_count] => 0
  [name] => admin
  [picture] => 0
  [data] => b:0;
  [entity_view_prepared] => 1
)

============================================================
UPDATE:

but I found one thing. before I change the title to NULL, the title has been displayed out...

print_r($vars) in mytheme_preprocess_page function:

[summary] => [format] => php_code ) ) ) [field_hide_title] => Array ( [und] => Array ( [0] => Array ( [value] => 1 ) ) ) [rdf_mapping] => Array ( [rdftype] => Array ( [0] => foaf:Document ) [title] => Array ( [predicates] => Array ( [0] => dc:title ) ) [created] => Array ( [predicates] => Array ( [0] => dc:date 1 => dc:created ) [datatype] => xsd:dateTime [callback] => date_iso8601 ) [changed] => Array ( [predicates] => Array ( [0] => dc:modified ) [datatype] => xsd:dateTime [callback] => date_iso8601 ) [body] => Array ( [predicates] => Array ( [0] => content:encoded ) ) [uid] => Array ( [predicates] => Array ( [0] => sioc:has_creator ) [type] => rel ) [name] => Array ( [predicates] => Array ( [0] => foaf:name ) ) [comment_count] => Array ( [predicates] => Array ( [0] => sioc:num_replies ) [datatype] => xsd:integer ) [last_activity] => Array ( [predicates] => Array ( [0] => sioc:last_activity_date ) [datatype] => xsd:dateTime [callback] => date_iso8601 ) ) [cid] => 0 [last_comment_timestamp] => 1339039221 [last_comment_name] => [last_comment_uid] => 1 [comment_count] => 0 [name] => admin [picture] => 0 [data] => b:0; [entity_view_prepared] => 1 ) )


texts: Create a field collection field programmatically

texts:
Is there a way to create a field collection programmatically? I saw this code:

$field_collection_item = entity_create('field_collection_item', array('field_name' =>'field_text')); // Create new field collection item.
$field_collection_item->setHostEntity('node', $node); // This is required, there shuold be a host entity, this case I used a node.
$field_collection_item->field_text[LANGUAGE_NONE][0]['value'] = 'Test Value';
$field_collection_item->save(); // Save the field collection item.

But when I run this code I get this error:

  Exception: Invalid field name given: field_text is not a Field
  Collection field.

I can't find a proper solution for this.


texts: How do I add fields to an existing custom entity?

texts:
I have a custom entity that fieldable. I need to add a field to it, and I want to do it through the UI. The entity was created in a custom module, which I can modify.
How can I make the entity fieldable?
/**
 * Defines the Quiz entity.
 *
 * @ingroup qwizard
 *
 * @ContentEntityType(
 *   id = "qwiz",
 *   label = @Translation("Quiz"),
 *   bundle_label = @Translation("Quiz type"),
 *   handlers = {
 *     "storage" = "Drupal\qwizard\QwizStorage",
 *     "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
 *     "list_builder" = "Drupal\qwizard\QwizListBuilder",
 *     "views_data" = "Drupal\qwizard\Entity\QwizViewsData",
 *
 *     "form" = {
 *       "default" = "Drupal\qwizard\Form\QwizForm",
 *       "add" = "Drupal\qwizard\Form\QwizForm",
 *       "edit" = "Drupal\qwizard\Form\QwizForm",
 *       "delete" = "Drupal\qwizard\Form\QwizDeleteForm",
 *     },
 *     "access" = "Drupal\qwizard\QwizAccessControlHandler",
 *     "route_provider" = {
 *       "html" = "Drupal\qwizard\QwizHtmlRouteProvider",
 *     },
 *   },
 *   base_table = "qwiz",
 *   revision_table = "qwiz_revision",
 *   revision_data_table = "qwiz_field_revision",
 *   admin_permission = "administer quiz entities",
 *   entity_keys = {
 *     "id" = "id",
 *     "revision" = "vid",
 *     "bundle" = "type",
 *     "label" = "name",
 *     "uuid" = "uuid",
 *     "uid" = "user_id",
 *     "langcode" = "langcode",
 *     "status" = "status",
 *   },
 *   links = {
 *     "canonical" = "/admin/structure/qwizard/qwiz/{qwiz}",
 *     "add-page" = "/admin/structure/qwizard/qwiz/add",
 *     "add-form" = "/admin/structure/qwizard/qwiz/add/{qwiz_type}",
 *     "edit-form" = "/admin/structure/qwizard/qwiz/{qwiz}/edit",
 *     "delete-form" = "/admin/structure/qwizard/qwiz/{qwiz}/delete",
 *     "version-history" = "/admin/structure/qwizard/qwiz/{qwiz}/revisions",
 *     "revision" = "/admin/structure/qwizard/qwiz/{qwiz}/revisions/{qwiz_revision}/view",
 *     "revision_revert" = "/admin/structure/qwizard/qwiz/{qwiz}/revisions/{qwiz_revision}/revert",
 *     "revision_delete" = "/admin/structure/qwizard/qwiz/{qwiz}/revisions/{qwiz_revision}/delete",
 *     "collection" = "/admin/structure/qwizard/qwiz",
 *   },
 *   bundle_entity_type = "qwiz_type",
 *   field_ui_base_route = "entity.qwiz_type.edit_form"
 * )
 */


texts: How to change an image field to a certain fid programatically?

texts:
Specifically, every time a comment is saved, I'd like to programatically change a comment field 'Picture' to an image field from the user who wrote the comment. I have the following custom module:

function MYMODULE_comment_presave($comment) {
    $user = user_load($comment->uid);
    $uid = $user->uid;

    $comment->field_picture['und'][0]['fid'] = $user->field_picture['und'][0]['fid'];
}

This doesn't work correctly, because the field_picture_alt, field_picture_width, field_picture_title and field_picture_height columns in my database don't get a value (they're NULL).

I've also tried

function MYMODULE_comment_presave($comment) {
    $user = user_load($comment->uid);
    $uid = $user->uid;

    $comment->field_picture['und'][0]['fid'] = $user->field_picture['und'][0]['fid'];
    $comment->field_picture['und'][0]['width'] = $user->field_picture['und'][0]['width'];
    $comment->field_picture['und'][0]['height'] = $user->field_picture['und'][0]['height'];
    $comment->field_picture['und'][0]['alt'] = $user->field_picture['und'][0]['alt'];
    $comment->field_picture['und'][0]['title'] = $user->field_picture['und'][0]['title'];
}

and that works perfectly.

However, I was wondering whether I always have to set the 'alt', 'title', 'width' and 'height' values manually as above.

Is there another faster way to inherit these caracteristics from the referred image? Can I for example inherit the 'height' and 'width' from an image style?


texts: How to resolve my warning in my custom service?

texts:
I am getting the following error:

  Warning: Missing argument 1 for Drupal\custom_forms\Service\CustomFormsService::__construct(), called in /drupal/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php on line 264 and defined in Drupal\custom_forms\Service\CustomFormsService->__construct() (line 13 of modules/custom_forms/src/Service/CustomFormsService.php).

And my code (service.php) is:

public function __construct($request) {
$this->cityname = \Drupal::request()->get('cityname');

if($this->cityname != ''){
  $result = \Drupal::database()->select('city_municipality','cm')
    ->fields('cm',array('municipality'))
    ->condition('city', $this->cityname)
    ->execute()->fetchAll();
    $result = json_encode($result);
    print $result;
    exit;
 }

custom_forms_services.yml

  services:
       custom_forms.custom_forms_service:
           class: Drupal\custom_forms\Service\CustomFormsService

But the form functionalities are working fine.

Can anyone help me out on this?


texts:
I added a new content type. How can I use tokens when editing a node of that content type?

For example, if I put "Hello [user:name]", the page shows the following:

As shown above, the "[user:name]" token in it is not replaced with the username.


texts: Fatal error: Class name must be a valid object or a string in .../common.inc on line 7924 on drupla site migration

texts:
I am migrating a site hosted on on Drupal 7.22, apache 2.2.22aa and php 5.6.9 from one linux server to another lunx server. I did a back up of mysql and apache htdocs folder and extract it on the destination server. But when I lunched the page on the server, I am getting the following error:

  Fatal error: Class name must be a valid object or a string in .../common.inc on line 7924

I enabled the debug as below

/*
 * Get the entity controller class for an entity type.
 */
function entity_get_controller($entity_type) {
  $controllers = &drupal_static(__FUNCTION__, array());
  if (!isset($controllers[$entity_type])) {
    $type_info = entity_get_info($entity_type);
    $class = $type_info['controller class'];

    // add debug.
    if(gettype($class) == 'string' || gettype($class) == 'object') {
      $controllers[$entity_type] = new $class($entity_type);
    } else  {
      print_r(debug_backtrace());
    }
    $controllers[$entity_type] = new $class($entity_type);
  }
  return $controllers[$entity_type];
}

Now I am getting the error as

Array ( [0] => Array ( [file] => ../includes/common.inc [line] => 7891 [function] => entity_get_controller [args] => Array ( [0] => node ) ) [1] => Array ( [file] => ../modules/node/node.module [line] => 952 [function] => entity_load [args] => Array ( [0] => node [1] => Array ( [0] => 15 ) [2] => Array ( ) [3] => ) ) [2] => Array ( [file] => ../modules/node/node.module [line] => 971 [function] => node_load_multiple [args] => Array ( [0] => Array ( [0] => 15 ) [1] => Array ( ) [2] => ) ) [3] => Array ( [file] => ../includes/menu.inc [line] => 593 [function] => node_load [args] => Array ( [0] => 15 ) ) [4] => Array ( [file] => ../includes/menu.inc [line] => 761 [function] => _menu_load_objects [args] => Array ( [0] => Array ( [path] => node/% [load_functions] => a:1:{i:1;s:9:"node_load";} [to_arg_functions] => [access_callback] => node_access [access_arguments] => a:2:{i:0;s:4:"view";i:1;i:1;} [page_callback] => node_page_view [page_arguments] => a:1:{i:0;i:1;} [delivery_callback] => [fit] => 2 [number_parts] => 2 [context] => 0 [tab_parent] => [tab_root] => node/% [title] => [title_callback] => node_page_title [title_arguments] => a:1:{i:0;i:1;} [theme_callback] => [theme_arguments] => a:0:{} [type] => 6 [description] => [position] => [weight] => 0 [include_file] => ) [1] => Array ( [0] => node [1] => 15 ) ) ) [5] => Array ( [file] => ../includes/menu.inc [line] => 472 [function] => _menu_translate [args] => Array ( [0] => Array ( [path] => node/% [load_functions] => a:1:{i:1;s:9:"node_load";} [to_arg_functions] => [access_callback] => node_access [access_arguments] => a:2:{i:0;s:4:"view";i:1;i:1;} [page_callback] => node_page_view [page_arguments] => a:1:{i:0;i:1;} [delivery_callback] => [fit] => 2 [number_parts] => 2 [context] => 0 [tab_parent] => [tab_root] => node/% [title] => [title_callback] => node_page_title [title_arguments] => a:1:{i:0;i:1;} [theme_callback] => [theme_arguments] => a:0:{} [type] => 6 [description] => [position] => [weight] => 0 [include_file] => ) [1] => Array ( [0] => node [1] => 15 ) ) ) [6] => Array ( [file] => ../includes/menu.inc [line] => 1755 [function] => menu_get_item [args] => Array ( ) ) [7] => Array ( [file] => ../includes/menu.inc [line] => 1770 [function] => menu_get_custom_theme [args] => Array ( [0] => 1 ) ) [8] => Array ( [file] => ../includes/common.inc [line] => 5292 [function] => menu_set_custom_theme [args] => Array ( ) ) [9] => Array ( [file] => ../includes/bootstrap.inc [line] => 2212 [function] => _drupal_bootstrap_full [args] => Array ( ) ) [10] => Array ( [file] => ../index.php [line] => 25 [function] => drupal_bootstrap [args] => Array ( [0] => 7 ) ) )


texts: Block showing users of a specific role is only showing up for the administrator

texts:
I have a view/block that is shown to all the users who have a specific role (RoleX, member and administrator), and I set the view to a specific page. Whenever I look at the page as an administrator, I can see the block and everything looks great. When I log in as a user with the role RoleX, as authenticated user, or as anonymous user, and I look at the page, the block doesn't appear. I thought that this only happened if I only checked off the administrator when you go to configure block and then roles yet I left all of the roles unchecked so the block would be visible to all.

Does anyone have any idea how I might go about solving this?


texts: Drupal 7 and google maps, distribution or modules

texts:
Throughout my apprenticeship with Drupal 7 I always wondered if it is able to do this:

http://www.teslamotors.com/findus
http://bigblogmap.com/

I mean inserting Google map and how it interacts with such websites.

For example: in Teslamotors page, at the top there are buttons: "N. AMERICA EUROPE and ASIA / PACIFIC "and that by giving clik in each, the map is changed geographical position.

Another example that I'm interested in this page (teslamotors) is seen as the pinmaps update when I press the buttons (which are at the bottom center of the map inside): "STORES & GALLERIES" or "service centers." Geographical points are updated and change color.

Similarly we can see the same for the second page I share, on the button: "All Blogs" and see how the updated pinmaps position icons and very dynamic.

Can this be done with Drupal 7? Maybe, I do not know, and there is a distribution which contains all this attached, so I can analyze it and go familiarizing myself more with this fascinating Drupal platform.


texts:
I am trying this for long time. I am trying to add additional class in panels region. I am using panel page to display one of my node. I want to add region class but I am not getting success. Is there any way to achieve this? Is it possible to rewrite layout template in my theme? If so I can achieve this quickly. For example I wonder if it is possible to override layout template based on my node content type.

Thanks a lot.


texts: How was this amazing drupal performance presentation done?

texts:
How was this amazing drupal performance presentation ( http://rupl.github.com/high-performance-theming ) was done? Which jQ libraries are needed? And what is the best place to ask?

Thanks

Amnon


texts: Node Referenced entity fields not showing in views?

texts:
I have created a content types "author detail and blog content".

In which author detail is having fields

1)author name

2)author picture

3)author designation

4)about author

Then i created a field "author details(node reference field)" in blog content

After creating a view block none of fields of author details(reference entity) is showing and also this block should be contexual filter based.

I have tried to achieve it by reading articles available on internet,Only one field is holding all the fields value ,i want to show field value in such sequence so that i can give specific class to each and every field.

1)author name

2)author picture

3)author designation

4)about author

How to achieve?


texts:
I have 3 content types

First is contest
Second is contest_applicants
Third is contest_results

People will submit contest_applicants for a contest (with references modules i assume)

When making the contest_results content, I need to be able to select specific contest_applicantsto display in the results. Kinda like nesting the nodes.

I been looking for a module that does something like this hut, had no success.

I would uses views but, it needs to be a content type since it will be multiple contest_results

Is there any module I can use to achieve the above setup? Any help is appreciated.


texts: how to add the radio button intead of checkbox in tableselect drupal 7

texts: How can I add the yes/no radio button instead of check box in the table-select module?


texts: update only a part of url path in database

texts:
I am migrating website and I changed my mind about url path where my images are stored. Before the path looked like: files/name-of-article/image.jpg now I would like to change it to files/img/name-of-article/image/jpg. How it is possible to replace "files" with "files/img" string? I found following sql code but it works only for replacing whole urll path.

UPDATE field_data_body  SET body_value = REPLACE(body_value,'src="/olddirectory','src="/newdirectory');

Thank you.


texts:
I am not sure if this can be done with core or Module settings, or require some tricky CSS work.

I have an image that is part of a slideshow that goes all the way across the page no matter how wide or narrow it is.  The images are around 1,140 x 698 pixels.

However, I want up to 700 px (on the page) to be visible.

So when the window is the same width as the image, the entire image is seen because it is only 698px tall.

When the window is wider than the image width (e.g. 1920 px and the image is 1,140px) the image is scaled up so the width is the 1920px and the hieight is increased proportionally, but the visible height is still only 700 px, and everything extra (below) is cropped off.

When the window is more narrow than the image width (e.g. 900px and the image is 1,140px) the image stays in proportion and the height will be less than 700px. Thus the entire picture will be seen.

Scaling will only stretch the image.

I am thinking that this will have to be done with some clever CSS work, but I am at a loss to what it can be called for me to look it up. It may also require JavaScript.

Thank you.


texts: Email sending doesn't work through Webform

texts:
I'm trying to get drupal webform to send confirmation emails to logged in users after they validated a booking form. (Windows and IIS Server)

I monitored Drupal Log reports/dblog and got this:

Notice : Undefined index: und in eval() (line 22 in   C:\.....\modules\php\php.module(80) : eval()'d code)

Also, after submitting the booking form it gives this error: Impossible to send mails, please contact administrator if problem persists.

And to add, generally Mail sending works when tryin to reset my admin password.

Apparently I'm not the only one with this problem.


texts: Views Slideshow - duplicated pager images (from Taxonomy Term parent) – NO RESULT BEHAVIOR field property

texts:
I need some help with Views Slideshow image gallery.

I'am using Drupal 7 with all latest updates for core, views etc.

I need image slideshow from Taxonomy term image fields with possibility to show parent term images if term (child) images are not available.

I've made a view with Slideshow format and 4 view fields (all are the same image field from taxonomy term). Slideshow have pager turned on, so the same images are used as pager items. I’m using one view filed (term image field) for pager and this field is hidden. Second one view fild is using the same term field for main image.

As I need parent images, I’m also using Taxonomy term: Term ID contextual filter with Taxonomy term ID from Url default value, and Taxonomy term: Parent term as Relationships. So I set another two hidden fields with relationship to parent term and these fields are called from input values in main image field - within NO RESULT BEHAVIOR property. So I have 3 hidden fields an one for main image. One from this 3 hidden is main pager image field, and two others are parent fields for NO RESULT... call.

When I test the view, if main images (targeted term) are not available, parent term images are loaded (this specific parent term has 8 images), this is OK. But the problem is if main images (targeted term) are available (for example 2 images are available), they are duplicated in pager, every image 8 times. I don’t know how to limit this duplication. Is this a Slideshow pager problem, or something else?
I have tried with Querry settings (Distinct) and with all combinations inside Relationship and fields properties, without luck.
Images below shows my view configuration, bad gallery, good gallery and parent gallery (it has ajax pager bellow (8 images)).

I don't have enough reputation for other links to show how gallery should looks like so last 2 png's are provided as they are (just add prefix).

http://www.innundo.net/dse/view.png

http://www.innundo.net/dse/bad.png

dse/good.png, dse/parent.png

Any help is appreciated.

Thanks in advance.

Danijel


texts:
I had created a field of type Date-ISO Format for a content type. I am creating the content programmatically. Everything was working fine when I was sending a unix timestamp and probably drupal was taking care of it and saving it in the field of DATE(ISO Format) but now all of a sudden it is not working. It either leaves the field blank or saves the current time instead. Can anyone explain this ?

Thanks


texts: Why does Rules event 'After updating existing content' not result in 'Create a new comment'?

texts:
I've used Create a new entity for the Rules event After updating existing content, but nothing happens.

Is it a bug?

Update:

Here is an export of my rule:

{ "rules_update_order" : {
    "LABEL" : "Update Order",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "ON" : { "node_update" : [] },
    "DO" : [
      { "entity_create" : {
          "USING" : {
            "type" : "comment",
            "param_subject" : "Something",
            "param_node" : [ "node" ],
            "param_author" : [ "node:author" ],
            "param_comment_body" : { "value" : { "value" : "Something", "format" : "filtered_html" } }
          },
          "PROVIDE" : { "entity_created" : { "entity_created" : "Created entity" } }
        }
      }
    ]
  }
}

It is a very simple rule. And I have a lot of rules which are easily fired apart from this one.

Some more Debugging information (contained in my Rules Logging):

0 ms Rule Update Order fires.
0.873 ms Evaluating the action entity_create.
33.717 ms Unable to create entity comment": Invalid data value given.
          Be sure it matches the required data type and format.
36.05 ms Unable to evaluate action entity_create.
36.099 ms Rule Update Order has fired.


texts: How to create revision for a node programmatically

texts:
I have node and i need to create revisions for that node programmatically . When i tried as follows :

$node = Node::create([
                'nid' => $nid, //my desired node id for the revision
                'type' => $bundle_type,
                'field1' => value1,
                'field2' => value2,
]);

$node->revision = TRUE;
$node->save();
$node->setPublished(true);
$nid = $node->id();
print 'Created revision for node' . $nid;

Its not working , instead its creating new nodes . Any solution for this ?


texts: Value modified with form_alter revert after check_cache

texts:
Using Drupal 7.x.  Not much experience with Drupal.

I have a core form in which I need to append some data to a field after it's been submitted by the site visitor.  I have found I can alter the submitted data with a form_alter function added to my own custom module.  It works fine as far as that, but after the "prepare", $check_cache reverts values.

Is there a way to make this work?

Is there a way to manipulate the "uncacheable keys" to include my item?

Is there a different way to massage submitted data other than hacking the code?

Any other suggestions?


texts: profile2 - change default edit path to custom profile

texts:
I use profile2 module. After visiting user account, user is able to edit account by clicking on edit tab. It leads to Account secondary tab (user/x/edit). User is presented with empty passwords fields and other fields which can be sometimes confusing.

Question: Is it possible to change this default path to direct user to main profile created by profile2 module? (user/x/edit/main)

Thank you


texts: Related Content with References in Drupal 7

texts:
I have made this website using Drupal 7 a year ago, where the References module plays a key role.

Say I have two content types movie and actor, and the content type movie has a references field which references actor nodes. Now, how do I have a block which lists other movies which the actors in this movie are referenced?

Something seems to be here: http://drupal.org/node/370227 but that doesn't seem to work for Drupal 7.

Also, as I have more than 1000 nodes in content type movie, I prefer not to move from References field also, my all my urls are like example.com/content-example

Thanks!


texts:
I'm running a Drupal 8 site behind a nginx webserver. All http request are redirected to https. My problem is that rss links on that site are http links only.

With Drupal 7 by setting the base_url all links are shown as https links. In Drupal 8 this option is missing. How can I set the whole site to https? Is there a config option for setttings.php?


texts:
I am running a Drupal 6 site using the SMTP (6.x-1.0-beta5) and the PHPMailer (6.x-2.2) modules for messaging. I configured SMTP and PHP  messages, successfully sent and received test messages.
I am using the Organic Groups module and trying to utilize the messaging functions in it, for example receiving notifications for administrator users regarding membership approval.
Drupal isn't sending any mail. When I checked the recent log entries, it reports this error.

Could not locate PHPMailer library

In /admin/messaging/settings I use HTML Mail (PHPMailer) as the default sending method.
Please help me to resolve this issue.


texts: Let user pick background Image/Color on node form

texts:
I would like to allow my users to choose a background image or color for a node. I created a content type with two fields: 'background image' of type image, and 'background color' of type color field.

I can retrieve the values of the fields on my module but how can I pass them to my stylesheet? Should I use the style attribute of my HTML elements?

The background color can be any color so I can't precreate css classes, or files.

Any idea on how to do this? Thank you!


texts: how to get parent tids of a taxonomy term

texts:
I used this code to get the parent ids , but the result is a huge object .  how do I get the parent id's and term names from the resulting object ?

 $ancestors = \Drupal::service('entity_type.manager')->getStorage("taxonomy_term")->loadAllParents($tid);


texts: How to create a custom markup for a views-block?

texts:
I'm trying to understand the templating system of Drupal 8, allready did some basic stuff. My next step is trying to create a template to mark up a list generated by a view.

Here's what I've done so far:

I created:

A Content Type, with 3 fields: Title, Body, Link
Some (5) content entries with this Content Type
A View (Block) that lists all of the entries of this Content Type.

In Block layout I placed the View-block in a custom Region (werk_items)
(configured in the my-theme.info.yml file.)

Than I created a page template (page--node--23.html.twig) that includes this region, like so

{{ page.werk_items }}

When I go to the corresponding URL all works well and all of the content is displayed.

Now my question is: How to extract the variables to create a custom markup for the view content?


texts: Drupal twig suggestions is not overriden

texts:
I am overriding twig suggestions for node, but it sometimes happen and sometimes not, I have added this code in my .theme file.

```

function mediumish_blog_theme_suggestions_node_alter(array &$suggestions, array $variables) {

  $route_name = \Drupal::routeMatch()->getRouteName();
  if ($route_name == "entity.taxonomy_term.canonical" && $tid = \Drupal::routeMatch()->getRawParameter('taxonomy_term')) {
    $suggestions[] = 'node__view__taxonomy_term';
  } elseif (preg_match("/^view.archive.*$/", $route_name)) {
    $parameter = \Drupal::routeMatch()->getRawParameter('arg_0');
    if ($parameter != null) {
      $suggestions[] = 'node__view__archive_month';
    }
  }
}

```


texts: How to change default message from user relationships module?

texts:
I am using User Relationships module. Its working fine. But I want to change a default message which get displayed on user site after getting request.

The message is like

  "John has requested to be your Friend. View your pending relationship requests to approve or decline."

I want same message to be displayed as

  "John has requested to be your Friend. View your pending friend requests to approve or decline."

Just want to replace the word relationship with friend. How can I do that?


texts:
Can any one say that how will i show my kickstart price slider in front.

I read many reference but still at no where . I use the multiblock module but the block produced is only shows in the search page.

Then I also try through view . I create another facet block using facet api but there is no option for changing the display widget.

is there any way or i am missing something .

Any help is most appreciable . thank you in advance.


texts:
I'm trying to create a module that generates a block with Dependent Selects to feed on taxonomies, I mean the first would be the term father Select first level and then display a Select with the children of that term and so on, this is the code that I have so far:

/**
     * Implements hook_block_view().
     */
    function bloque_busqueda_block_view($delta = '') {
        switch($delta) {
            case 'bloque_busqueda' :
                $block['subject'] = t('Criterio de busqueda');
                $block['content'] = bloque_busqueda_block_content();
                return $block;
                break;
        }
    }

function bloque_busqueda_block_content() {
    return drupal_get_form('ajax_dependent_dropdown');
}

function ajax_dependent_dropdown($form, &$form_state) {
    $options_first = _ajax_get_first_options();
    $selected = isset($form_state['values']['dropdown_first']) ? $form_state['values']['dropdown_first'] : key($options_first);

    $form["dropdown_first"] = array('#type' => 'select', '#title' => 'Seccion', '#options' => $options_first, '#ajax' => array('callback' => 'ajax_dependent_dropdown_first_callback', 'wrapper' => 'dropdown-second-replace', ), );

    $form["dropdown_next"] = array('#type' => 'select', '#title' => $options_first[$selected] . ' ' . t('Subseccion'), '#prefix' => '

    ', '#suffix' => '
', '#options' => _ajax_get_next_options($selected), );

    $form["submit"] = array('#type' => 'submit', '#value' => t('Buscar'), );

    return $form;
}

function ajax_dependent_dropdown_first_callback($form, $form_state) {
    return $form["dropdown_next"];
}

/**
 * Retorna el tid de la taxonomía actual.
 */
function current_tid() {
    $term = taxonomy_term_load(arg(2));
    return $term -> tid;
}

/**
 * Mide la profundidad de la taxonomía.
 */
function term_depth($tid) {
    $tid = db_query("SELECT tid FROM {taxonomy_term_hierarchy} WHERE parent = :parent", array(':parent' => $tid)) -> fetchField();
    if ($tid == 0) {
        return 1;
    } else {
        return 1 + term_depth($tid);
    }
}

function _ajax_get_first_options() {
    $terms = taxonomy_get_children(current_tid());
    foreach ($terms as $term) {
        $options[$term -> tid] = $term -> name;
    }
    return $options;
}

function _ajax_get_next_options($key = '') {
    $options = array();
    $tid = arg(2);
    $tree = taxonomy_get_tree($vid = 2, $tid);

    foreach ($tree as $term) {
        if ($term -> depth == 0) {
            $parent = $term -> tid;
        } else {
            if ($term -> depth > 1) {
                $options[$parent][$term -> tid] = str_repeat('-', $term -> depth) . ' ' . $term -> name;
            } else {
                $options[$parent][$term -> tid] = $term -> name;
            }
        }
    }

    if (isset($options[$key])) {
        return $options[$key];
    } else {
        return array();
    }

}

Thanks


texts:
I have a website developed in Drupal 6. I am using Simplenews for my newsletter. When a user subscribe to the newsletter I would like to redirect him to a new thank page. In order to do this, I need integrate simplenews module with rules.

In this link https://drupal.org/node/620498 there are several patchs, #40 it works. The point is that I´m not a developer and I don´t know how I do not know how to implement it. I understand I have to create multiple files with these lines of code. I do not know in which folder I have to save the files. Could anyone help me?

Thank you very much!


texts:
I would like to be able to create content of a particular type but be able to set multi-level categorisation. But I would like a menu where I can select a category and see all content including child categories as well.

e.g.

Fruit

Local

Apples
Pears

Tropical

Pineapple
Bananas

'Fruit' menu would show all fruit

'Local' Menu would show all local, apples and pears

'Apple' Menu would only show Apples

I am trying to achieve some thing like this side menu:
http://learningexchange.ptc.com/tutorials/by_product/ptc-creo/product_id:1


texts: Where can I download old releases of Drupal?

texts:
I'm trying to find a copy of 6.20 to run a diff on a client's Drupal install. I believe there's been changes to core.

How can I get version 6.20? Additionally, how can I download any older Drupal versions?


texts: How do I show a "results count" on my search results page?

texts: I'm using Search API along with Facet API to administer a search for my products. I'm also overriding the search with a view. I'm looking for some method of counting the search results and displaying this information. For example, at the top of the search results page I want text to be displayed that reads something like "Showing 1 - 16 of 39,352 Results". I've read somewhere that views is able to do this easily, the problem is that I'm using facets and I don't think the results count from views will work together with applied facets. Can someone give me a solution or at least an idea?


texts:
I have a field on a user profile called field_certified_tap. When this is equal to 1 or true on user update/create, I want to send an email.

Currently, I do not see this field in the Condition->Entity Has Value->[data select].

I am using the 3x-dev version of Rules and the 1x version of token.

What am I doing wrong? Is there currently a way to accomplish this with Rules UI or should I make my own Rule or implement in the user save hook?

Thanks!


texts: Links in stage environments are absolute and send users to live enviroment

texts:
This problem has been driving crazy for years.
whenever I create a stage environment of a site, I copy the database from the production site. some of the links there - whether in the menus or in the content or in the code, are absolute paths in the production site.
so i have links that lead users from one environment to the other.

Ive been looking for a way to alter this behaviour.
so that all link as
live-environment.com/some-page ----> stage-environment.com/some-page

I dont care if it will happen before the render or just after the click. just that the end result will be that the user stays in the stage environment.

How can I do this. (drupal 7)

Thanks a lot for your help


texts: problem in saving Account settings [Email template]

texts:
when i tried change some words in email template that was sent when user register in the website or canceled or verified or ... etc
after i change it i have an error in saving it

i tried to build my custom token but i think it is not the right solutions for this bug

any one know any suggestions about this issue .