texts:
I'm building a Drupal Commerce store. On cart view I need to display some additional information.

I want to create area handler like Commerce Order: Total. It should do some php logic and display the results.

Can anybody give me some advice how to build such a handler? The documentation didn't gave me much information.


texts: Allow users to post links in Drupal forum posts , only after users has more then 15 posts

texts:
How to do functionality like:

If authenticated users has total posts more then 15 then only they can post links in forum topics.

I have used User state module, which displays total posts by particular users.

But I want to allow users to post links only after they have posts more then 15 in Forum topics.


texts: How to add html tags to account setting emails?

texts: I am working on a project where I need to add some custom headers to the email which we send to the user on registration. Is there a module which support this functionality?


texts: Views contextual filter pages and duplicate content?

texts:
I just picked up a site that has its content represented by views pages with contextual filters instead of content pages, meaning that the content is available in two places. For instance, mysite.com/node/282 and also mysite.com/find-a-store/georgia/282-node-title. The pages that are utilized on the site and linked to via the main find-a-store page are the views ones, whereas the node pages seem to just sit there as sources for the view.

Is this a circumstance where there would be SEO penalties for having duplicate content? Will search engines even readily pick up on these views pages at all? Would it be better to change this so that the content is only available on the content page? I think it would be simpler to manage metatags/paths/redirects by using the content pages instead of views, as well.


texts: Polls seeing multiple users as one user (D6)

texts:
For the polls core module, I am coming across an issue where if multiple users of the same role type try to vote, only the first person who did so can. It is almost as if it thinks that all the users of the same role are the same user.

Has anyone seen this, or know of a way to get around it?

Thanks.


texts:
I'm having a problem where my system help block is not properly rendering messages in my main template. It works fine when using my administrative theme, but not in the standard one. When I print_r my $_SESSION variable I get the following:

[fb_devel] => Array
    (
        [FB_OP_POST_INIT] => 280
    )
[batches] => Array
    (
        [90] => 1
    )
[updates_remaining] => Array
    (
    )
[messages] => Array
    (
        [warning] => Array
            (
                [0] => For easier theme development, the theme registry is being rebuilt on every page request. It is extremely important to turn off this feature on production websites.
            )

    )

)

How can I troubleshoot this problem?


texts: How to let the users input the filters in views

texts:
I have enabled Exposed Group Filters in views. When I set the option to "input required" no results are shown, also does not give me an option to input any filter from the selected option. All I get is an Apply button.

My Query is:

How do I let the users see all results in the view first, let the user input their filter criteria from the allowed list & then show them the results basis of the filters?

I have tried Better Exposed Filters, its still not giving me an option to input my query.

Please advice.

Thanks


texts:
I have a content type (called Issue dates with fields called field_issue_date (date type) and field_issue_type (term_reference)) and by using Rules module 7.x-2.9 I want to check if the taxonomy field has been set to "Double", If so I want to list and set the next Issue Dates content type to be unpublished e.g

"Magazine Issue Date 2017-04-07 (Double)"

"Magazine Issue Date 2017-04-14" this should now be set as unpublished

"Magazine Issue Date 2017-04-21" this should be/remain published

Note: If Rules isn't the way to go, what would be a better way to unpublish a piece of content


texts: URL Aliases not recognizing Node Reference Tokens?

texts:
I'm having trouble getting my URL Aliases to cooperate with certain Tokens... specifically Tokens generated by the CCK Node Reference module. Here is the URL structure that I'm trying to establish:

/department/course/lecture

Each section refers to a referenced node... so a lecture refers to a course which refers to a department. Make sense? My URL Alias structure, with Tokens in place, looks like this:

[field_course_department-title-raw]/[field_course_number-raw]/[field_lecture_display_number-raw]

When the URL Alias gets generated, it becomes:

/%5Bfield_course_department-title-raw%5D/%5Bfield_course_number-raw%5D/lecture-2

So the only Token that is working is the lecture (the last one). The first two tokens aren't even recognized by Drupal and, as you can see, are encoding the brackets from the Tokens into HTML entity codes. Those two are also the CCK Node Reference fields. Worth mentioning, the two offending Tokens were present and available in the Replacement Patterns section on the URL Alias settings page... so it would seem that Drupal should be able to recognize them, right?

What's going on here?! Help! Any ideas or suggestions would be greatly appreciated! Thanks in advance.


texts: Profile 2, user relation access? A hard one!

texts:
The site contains 2 user types besides admin, lets call the 2 user types "Private" and "Corporate".

Private users have a "profile 2" type, where alot of different fields are filled.

In a view or likewise, "Corporate" users need the ability to search for users, and when they go to a users profile, ONLY a few fields should be visible - rest hidden.

Then when (Corporate user) viewing the (Private users) profile, they need a "button" or likewhise where they can ask for permission to view full profile.

Now the private user should recieve a mail that states a "Corporate user xxx" want to see their full profile. ONLY when the "Private" have accepted this, all fields should be visible, BUT ONLY to this ONE specific user of the "Corporate" role - not all other users with the "Corporate" role.

What modules can make this node/user access work?


texts: New scheduled rule knocks out existing scheduled rule

texts:
I have a rule set with an active rule to send mail to a user. This is triggered by a workflow being marked done.

This seems to work just fine until more than one, completely seperate, workflow is marked done.

When I view the scheduling rule set page that shows what's in queue for scheduling I can see the mail that is about to go out from the workflow I marked as done. Now when I go ahead and mark another workflow as done it seems to replace the email that was about to go out to another user from the previous workflow being marked done with the most recent one.

Any ideas as to why I cannot have more than one scheduled rule set in queue at a time?

D6, rules module up to date at v1.5


texts: "the website encountered an unexpected error.Please try again later" after db_update

texts:
Drupal responses "the website encountered an unexpected error.Please try again later" after running db_update statement in my custom module. I always do this without any error. Any suggestion pls!

function mobile_user_form_submit($form, $form_state){
    $deposit=$form_state['values']['deposit'];
    $status =$form_state['values']['status'];

    $id = $form_state['values']['hid'];
    drupal_set_message(t($id ." / ". $deposit." / ".$status));
    if($id != ""){
    db_update('mobile_users')
        ->fields(array('deposit' => $deposit, 'status' => $status, "updated" => date('Y-m-d H:i:s')))
        ->condition('id', $id)
        ->execute();
    drupal_set_message(t('successfully saved.'));
   }
}

After comment db_update() statement, it is ok no error message show.

Thank you,

------ Solved -------

And I try to update manually that record in mysql, in the field "deposit" I got an error message "Please select a value not more than 127". I found myself I set wrong datatype in deposit field, I was willing to set Integer datatype but I was not awared what I had set I set tinyint. After chaning tinyint to integer, "the website encountered an unexpected error.Please try again later" also removed.

Thanks


texts: alternative to storing api keys in migration yaml files?

texts:
I've created a yaml file to import Twitter timeline items (not super simple since documentation on the migrate_plus OAuth plugin seems to be few and far between); this migration naturally requires the use of ostensibly-secret API information. I'd like to keep this out of the yaml and I've seen answers (like this one) that talk about setting things in code, but I'm wondering if there's another customer-serviceable way. For example, here's my config file, called migrate_plus.migration.migrate_sample_twitter:

id: migrate_sample_twitter
label: Sample Twitter Migration
dependencies:
  - migrate
  - migrate_plus
status: true

source:
  plugin: url
  data_fetcher_plugin: http
  authentication:
    plugin: oauth2
    base_uri: 'https://api.twitter.com'
    token_url: /oauth2/token
    grant_type: client_credentials
    client_id: <twitter app consumer key>
    client_secret: <twitter app consumer secret>

  urls: https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=tmountjr

  fields:
    -
      name: id
      label: Tweet ID
      selector: id_str

destination:
  plugin: table
  table_name: twitter_import
  id_fields:
    id:
      type: string

Now, running drush cget migrate_plus.migration.migrate_sample_twitter drops all that information on the console, which is fine. BUT, I'm unable to retrieve any information deeper than that. What I was hoping to do was, in my settings.local.php, specify this:

$conf['migrate_plus.migration.migrate_sample_twitter.source.authentication.client_id'] = 'consumer key here'
$conf['migrate_plus.migration.migrate_sample_twitter.source.authentication.client_secret'] = 'consumer secret here'

...and then just omit the client_id and client_secret keys from the yaml file. But that doesn't seem to work; when I make those changes and run drush migrate-status I get an error: The config is missing the following key: "client_id".

So short version of this question: is there any way to omit values from an exported yaml file and instead have those values stored in a user-editable settings file that can be .gitignored from the repo?


texts: How to display the View according to the logged user?

texts: I'm Creating a view of a specific content type called "requests (Demande)" , Each request is assigned to a specific user (I have two users : "Salaktarus" and "Zaferro") , what I want to know is how to configure the filter so each user ("Salaktarus" or "Zaferro") sees only the requests which he/she is assigned to.


texts: Display field in views-view-field--field_title.html.twig

texts:
If I have view with fields:

field title [hidden]
field text [hidden]
field image [hidden]
field display

and I make rewrite in "display" field with "title" and "text" field added, how can I print content of field "image" (url of this image) with views-view-field--field_display.html.twig? I need wrapper with image url from this field. I see all available variables (view, field, row, output) in template and suggestion to fetch output with construct:

data = row[field.field_alias]

but when I try to write twig code with my field_image alias it's not showing me anything. Field with image is set up to display just url to image. I translated few code lines from drupal 7 to twig, but I am unable to see anything in kint, just dump show me some key strings. Views create block and I am placing this block on my page.

What I am doing wrong?


texts: How to send the custom content type token value in drupal7

texts:
Hello I try  when some authenticated user is add the content i want to send the notification  another user for approval of the content in the message field i want to send the content page approval link so I am using some default token value from this page Tokens

But the token values are not generated it will be given as token values given it will be printed like '[content-type:edit-url]'not generated as url not working how to fix the issue


texts: How can I programmatically set date field Month, Day, Year dropdowns in Paragraphs?

texts:
I'm setting a basic date field (and several other text fields) programmatically when creating a paragraph. The database is showing that it is getting my date, which is being stored inY-m-d\TH:i:s format. All the other data is being saved as well. No errors.

However, when I edit the node my paragraph is attached to, all the data is there except for the date field. It's not set despite the data being in the database.

The date field is set to show MDY in dropdowns like so:

I've tried this: $date = new DateTime('2015-06-01 23:45:52', new \DateTimeZone('UTC')); This does get the date saved into the database, however, the dropdowns are not set.

So then I tried converting it to MDY: $date->format('M-D-Y') but no such luck. This doesn't work at all.

I have also seen that you have to reference the actual stored format using $date->format(DATETIME_DATETIME_STORAGE_FORMAT) but there doesn't seem to be other parameters for that to get it into the format that I need.

Is there some way I need to individually set the actual dropdown options in code?

Full paragraph code below. Almost all of these examples save data in the DB correctly, the date dropdowns do not reference it though.

use Drupal\Core\Url;
use Drupal\node\Entity\Node;
use Drupal\file\Entity\File;
use Drupal\paragraphs\Entity\Paragraph;
use Drupal\taxonomy\Entity\Term;
use Drupal\Core\Datetime\DrupalDateTime;
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
use Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeCustomFormatter;
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface;
use Drupal\datetime_range\DateTimeRangeTrait;

  $date = new DateTime('2015-06-01 23:45:52', new \DateTimeZone('UTC'));
  //$date = $date->format('Y-m-d\TH:i:s');
  // if ($date instanceOf DrupalDateTime && !$date->hasErrors()) {
  //   $currentDate->setTimezone(new \DateTimezone(DATETIME_STORAGE_TIMEZONE));
  //   $db_friendly_value = $currentDate->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT);
  // }

  //$date->setTimezone(new \DateTimeZone(DateTimeItemInterface::STORAGE_TIMEZONE));
  //$date = $date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT);
  // $date->setTimezone(new \DateTimezone(DATETIME_STORAGE_TIMEZONE));

      $program_1 = Paragraph::create([
        'type' => 'programs',
        'field_program_name' => 'Program Name',
        'field_program_description' => 'Description',
        'field_program_year' => [
          'value' => $date,
        ],
      ]);
      $program_1->save();

Am I missing something somewhere? I've been hunting for the correct way to do this for a few days and have tried a number of different ways. I could probably get around this by just changing the field to be a text (date/time) date field instead of dropdowns.

I tried the suggestion here, but this doesn't seem to work either: Adding content to Paragraph Date Field Drupal 8

Any ideas here?


texts: Why cannot anonymous users vote, even though they have permission for it?

texts:
I installed the Fivestar module and added the Stars (rated while viewing) field in a content type.

I gave to the rate content permission anonymous users. They can see all the content and the voting widget, but they can't vote. Why?


texts: Custom block template doesn't print content

texts:
I have custom block template built based on Drupal 7 examples, but it always returns empty content for me:

<?= $block->title; ?>

<?= $block->content; ?>

Though when I call it from my page.tpl.php it works well:

$block = block_load('block', '1');
    $output =     drupal_render(_block_get_renderable_array(_block_render_blocks(array($block))));
    print $output;

I just need to control where I output the title and content, having my own HTML layout for them.

Please assist.

THanks


texts: Why would some images be saved to field_image / some maintain href after on import from Blogger?

texts:
Using Blogger Importer, I pulled content from Blogger. The posts include images embedded in the text and a small image gallery at the base of the post that was built (rather painfully) using tables.

Reading this Cheeky Monkey post, I saw that they had modified the module to aid with image import since the standard module didn't handle that well. I got very mixed results.

For some posts, the images are correctly identified and added to "field_image" as specified. For others, the images remain embedded in the text with a URL reference back to blogger.

Cheeky Monkey updated code:

      // Image downloaded successfully.
          if ($response->code == 200) {
            // Save it.
            $file = file_save_data($response->data, $filepath, FILE_EXISTS_REPLACE);

            // Save the image to the field_image now
            $node->field_image[LANGUAGE_NONE][] = array('fid' => $file->fid, 'display' => 1);
          }
        }

I would like to head in this direction, so that I can have better controls over the image gallery views / template. That said, I also see that the embedded images look much sharper than the images that have been saved in field_image. (Might fix that if with color box, but am not sure.)

This particular post came in with a mix of how the images were handled. The images at the top of the post are saved in field_image, while the image midway in the text and thumbnail at the bottom reference the blogger href. Here's the original post in blogger.


texts: Template.php - Hiding Specific Element on Node Edit

texts:
Drupal 7

Say I have a custom element being rendered out on my page.tpl.php (say it's named $custom_element in the below example), but this is also showing up on the Node Edit page because I want this user to not use the admin theme to edit Nodes but just same theme the front end is using to edit Nodes.

What hook do I use to hide this element when the user is editing the node? What's the best approach in this?

My template.php file

function mytheme_preprocess_page(&$vars, $hook) {
  if (in_array('page__mypagetype', $vars['theme_hook_suggestions'])) {
    $vars['custom_element'] = my_custom_element();
  }
}

Sorry if this doesn't make sense. I'm not sure I'm using the proper wording. Basically trying to figure out how to say "Drupal, while the user in logged in and editing these nodes, please don't show this element on the node edit page since it's printed in the page.tpl.php".

I know this can be done by creating a page--node--edit.tpl.php page. But isn't there a way to do this via a hook in the template.php?


texts:
My rewrite result settings:

My general settings:

the "read more" link from the teaser doesn't redirect me to the article, When pressed, it redirects me to the main page (current one).

When leaving the "more link path" empty, it should redirect me to the blogpost (article).

Some values I've tried for "link more path":

[path]
[node/id]
[node:title]
[title]

Is this not working because I also got the "URL aliases" module installed? Which cleans my url like this:

www.mysite.com/blog/awesome-article-about-ducks

instead of this:

www.mysite.com/blog/node/41


texts: When a user goes from one page to another, how can I see where they came from and where they are going?

texts:
I need to hook into whenever a user moves from one page to another. I need to know where they are coming from and where they are going. My scenario is that anytime that a user heads to a certain section of the site (search) it modifies the path to add a variable. But I only want to to do so when they are coming from outside that section of the site.

I have been looking at hook_url_inbound_alter() which gets me in when a user is about to move to another page, and gives me where they are going, but not where they came from. Any suggestions?


texts:
I have a problem with my breadcrumb path on my drupal 7 installation. I am using URL-Alias (Module: pathauto) and have a "blog" content type.
Now the view with all blog entries in the URL is on /blogs/ and entries are like /blogs/entryname.
Unfortunately the breadcrumb still shows: frontsite / entryname no matter what I do instead of frontsite / blogs / entryname.

Same goes for taxonomy terms. I have an overview over taxonomy terms which is on /tags/ and when I click on a certain tag on that overview, i get a view with all nodes associated with that tag and the URL is like /tags/tagname but breadcrumbs still show frontsite / tagname instead of frontsite / tags / tagname.

Thanks for any help in advance


texts: What does the "Empty srcset[]" breakpoint in Picture Module?

texts:
I'm using the Picture Module.

What does the Empty srcset [] breakpoint exactly do? Why should I use it, and why shouldn't I use?


texts: How to send new content notifications based on taxonomy selection in user profiles?

texts:
I am building a website in Drupal 7 where the requirement is for users to sign up, create profile2 where they must select from a list of checkboxes pulled in from my interests taxonomy terms.  For example: jobs, research collaboration, media interviews.

Once another user posts an opportunity (content type) I need to send all users a notification based on the interest categories selected when creating the opportunity (compared to each user's interest selections in profile2).

Probably the Rules module? Has anyone done anything like this before? I can't seem to wrap my head around the problem.


texts:
How to remove all active sessions for given uid who has logged in from different browsers or apps.

I used

drupal_session_destroy_uid($uid);
drupal_session_regenerate();

but old sessions still valid and user can create content from apps having that sessions.

I need to delete all sessions for that user and create new one .


texts: How can I add a simple node creation form to a page?

texts:
I'm trying to add a formspring-like page to my website. This looks like an easy task for Drupal 7: create a new content type, create a new view to list the questions and answers, add another view to the backend to view the unanswered questions, and you're ready to go.

But I have one remaining problem: how can I add a simple form to ask a new question? I want to have a simple form on top of the list-page, with just 1 input box where a visitor can ask his question and a submit button.

I've already found the "form block"-module, but I can't trim the output of the form to just 1 input box. Is there an off-the-shelf solution, or do I have to create a custom module/block that programmatically creates a new node?


texts:
I googled for it but couldn't find anything about that.
Is it possible to create drupal website (example.com) with subsites (example.com/subsite1 and example.com/subsite2) where access to them are limited to:

2 users on example.com/subsite1
users on example.com/subsite2
no limits on example.com/"

I want to share some digital content on those subsites to not more than X users at time.


texts:
How do you register a user account via REST in Drupal 8?

Here's how far I've made it (not sure if this is the right direction though):

I've enabled the Form mode resource under admin/config/services/rest for POST, cookie authentication, and hal_json and json formats. I then make a call to the site:

POST: http://localhost/d8/entity/entity_form_mode
Content-type: application/hal+json
Accept: application/json

The JSON to POST will start something like this:

{"_links":{}}

It will of course be filled in with various properties and values. What are these properties and values though? I've tried many combinations, and the furthest I've got is the server responding with this:

{"error":"Entity type parameter must be included in context."}


texts: How do I fix a site after I removed a module?

texts: I deleted a module without disabling and uninstalling it first.  Now I just get a blank white screen, but I don't see any error messages.  What can I try to fix this?


texts: How do I programmatically save longitute and latitude?

texts:
I am using the Geofield Map module which depends on the geofield and I want to save lng and lat pragmatically in the geofield via my controller. I have tried the methods below and they didn't work:

$WayPointEntity->field_geo_field->setValue("POINT(" .$waypoint['lng']." " .$waypoint['lat'].")");

I also tried:

$WayPointEntity->field_geo_field = array(
                  'input_format' => GEOFIELD_INPUT_LAT_LON,
                  'geom' => array('lat' => $waypoint['lat'], 'lon' => $waypoint['lng']),
              );

  $WayPointEntity->save();


texts: determine if empty set in hook_views_pre_views()

texts:
Is it possible to find out how many results are returned inside hook_views_pre_views() using Views 3 ?

What i've tried is to use $views->total_rows but that provides a false positive. I'm guessing because my view uses display suite to render the result?

e.g.

custom.module

<?php
/*
 * Implements hook_views_pre_views()
 */
function custom_views_pre_view(&$view, &$display_id, &$args) {
    if ($view->name == 'VIEW_NAME' && $display_id == 'block') {
        // Find out if results are empty; if so unset the view footer
        // Not sure what to do here?
        if ( ...) {
            // After rows check, unset my view footer which contains a view block
            $view->display_handler->options['footer'] = array();
        }
    }
}

Overall, i'm trying to programmatically unset the views footer. I've tried the "No Results" settings in the UI; but for some reason it always returns the child "View Area" i've attached in the View Footer.


texts: how to add other component (html tag, js, and css) in form module

texts:
Suppose I have the following code.

class customCreateForm extends FormBase {

/* code code code... */

  public function getFormId() { /* code */ }
  public function buildForm(array $form, FormStateInterface $form_state) {

    $form['label'] = array(
      '#type' => 'textfield',
      '#title' => t('title'),
      '#description' => $this->t('Your title'),
      '#default_value' => "",
      '#size' => 10,
      '#maxlength' => 8,
      '#required' => TRUE,
    );
    /* code code code... */
    return form;
  }
  /* code code code... */
}

I can understand how to add a form element, but how can I add HTML markup or JavaScript?

For example, I want to add the following in my custom form.

<link type="text/css" rel="stylesheet" href="bla...">

aaa


texts: How do I show the total number of votes for "Rating" option in Fivestar?

texts:
When using the Fivestar module, I can show the result in three ways:

1) "Stars" - This has an additional setting called "Text to display under the stars". For example, it'll look like the following if I choose "Average vote":

*****
Average: 4.1 (235 votes)

2) "Rating" - There is no additional option whatsoever, so the above example will just look like the following:

4.1/5

3) "Percentage" - I don't use this, so let's just ignore it.

Is there a way to make the "Rating" option show the total number of votes like the following?

4.1/5 (235 votes)

UPDATE 1:

I have to overwrite the function theme_fivestar_summary on line 126, and add lines 279-301 right before return $output;:

function theme_fivestar_formatter_rating($variables) {
  $element = $variables['element'];

  if (empty($element['#item']['average'])) {
    $element['#item']['average'] = 0;
  }
  // Get number of stars.
  $stars = (empty($element['#instance_settings']['stars'])) ? 5 : $element['#instance_settings']['stars'];
  $average = $element['#item']['average'];
  // Rating is X out of Y stars.
  $rating = round(($average/100) * $stars, 1);
  $output = $rating . '/' . $stars;

  $votes = 235;
  if (isset($votes)) {
    if (!isset($user_rating) && !isset($average_rating)) {
      $div_class = 'count';
    }
    if ($votes === 0) {
      $output = ''. t('No votes yet') .'';
    }
    else {
      if (!empty($microdata['rating_count']['#attributes'])) {
        $rating_count_microdata = drupal_attributes($microdata['rating_count']['#attributes']);
      }
      // We don't directly substitute $votes (i.e. use '@count') in format_plural,
      // because it has a span around it which is not translatable.
      $votes_str = format_plural($votes, '!cnt vote', '!cnt votes', array(
        '!cnt' => '' . intval($votes) . ''));
      if (isset($user_rating) || isset($average_rating)) {
        $output .= ' (' . $votes_str . ')';
      }
      else {
        $output .= ' ' . $votes_str . '';
      }
    }
  }

  return $output;
}

But the big problem is that I have no idea how to pass the $votes variable, so I hardcoded $votes = 235; right above if (isset($votes)) {, just to see if the code works so far, which it does:

4.1/5 235 votes

I know where to add the parentheses (line 298), but I'm having trouble figuring out how to pass $votes. Any help is greatly appreciated.

UPDATE 2:

The code above is far from perfect, as it produces minor error messages regarding the $microdata & $rating_count_microdata variables. Using the code from Jeroen, I was able to come up with better code that I posted as the final answer below.


texts: How to access custom ds fields in page manager?

texts:
I have created some custom ds fields for a content type through code. That fields are displaying in the manage display settings of that content type.

I am creating a detail page for that content type using page manager. I am able to display the node fields but I can't access that custom ds fields in the page manager to display.

Any Idea about how to get custom ds fields in the page manager?


texts: How to implement Slider Effect for pages?

texts:
I have few pages in my site and I want 4 specific pages to be rendered as slider with the full content of the node appeared as a slide.

On a desktop I want the slides to change using html arrows and on mobile I can swipe the slides.

I checked for contributed modules but mostly which I came across have been developed for photo galleries.

Is there a way to implement swipe for pages in mobile view and slider for specific pages?


texts: PHP Warning SplObjectStorage::offsetExists() expects parameter 1 to be object, null given

texts:
Updating to 8.5.1 today from 8.4.5, and after a successful update, I start getting the following warnings on every page:

Warning: SplObjectStorage::offsetExists() expects parameter 1 to be object, null given in /var/www/docroot/core/lib/Drupal/Core/Render/Renderer.php on line 602

Warning: SplObjectStorage::offsetSet() expects parameter 1 to be object, null given in /var/www/docroot/core/lib/Drupal/Core/Render/Renderer.php on line 616

Warning: SplObjectStorage::offsetExists() expects parameter 1 to be object, null given in /var/www/docroot/core/lib/Drupal/Core/Render/Renderer.php on line 602

core/lib/Drupal/Core/Render/Renderer.php lines 594 - 618:

/**
   * Returns the current render context.
   *
   * @return \Drupal\Core\Render\RenderContext
   *   The current render context.
   */
  protected function getCurrentRenderContext() {
    $request = $this->requestStack->getCurrentRequest();
    return isset(static::$contextCollection[$request]) ? static::$contextCollection[$request] : NULL;
  }

  /**
   * Sets the current render context.
   *
   * @param \Drupal\Core\Render\RenderContext|null $context
   *   The render context. This can be NULL for instance when restoring the
   *   original render context, which is in fact NULL.
   *
   * @return $this
   */
  protected function setCurrentRenderContext(RenderContext $context = NULL) {
    $request = $this->requestStack->getCurrentRequest();
    static::$contextCollection[$request] = $context;
    return $this;
  }

docroot/vendor/symfony/http-foundation/RequestStack.php line 56 - 62:

/**
 * @return Request|null
 */
public function getCurrentRequest()
{
    return end($this->requests) ?: null;
}

If I dump $this->requests it is an empty array at this point that is causing the SplObjectStorage errors.  I am brand new to Symfony and I do not know how to proceed with troubleshooting. Any suggestions would be welcome.

EDIT 1:

It looks like it might be an issue with the Shield module.

PHP message: Failed to log error:
Notice: Undefined variable: user in Drupal\\shield\\ShieldMiddleware->handle()
(line 79 of /var/www/docroot/modules/contrib/shield/src/ShieldMiddleware.php).

  #0 /var/www/docroot/core/includes/bootstrap.inc(582): _drupal_error_handler_real(8, 'Undefined varia...', '/var/www/docroo...', 79, Array)

  #1 /var/www/docroot/modules/contrib/shield/src/ShieldMiddleware.php(79): _drupal_error_handler(8, 'Undefined varia...', '/var/www/docroo...', 79, Array)

  #2 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\\shield\\ShieldMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)

  #3 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)

  #4 /var/www/docroot/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle(Object(Sy...',


texts: Have users answer a question before viewing content

texts:
I did some research but cant seem to wrap my head around having the ability to do this.

I have a couple content types that are currently open to everyone but I would like to collect some information from anonymous users before showing them the content.

I am thinking in some way to utilize webforms in a block and have the questions show up there, what im not sure is how to hide or blur out the content that they are trying to view until they answer the form, as well as how to keep that content open until their next visit.

I am sure you have all seen websites/blogs that do this, to make you register for the site.

Any guidance to how to accomplish this would be very appreciated.


texts: How to deal with files with %20 in name in Nginx

texts:
I have imported a lot of files from apache staging to nginx live and the files that have been rewritten by apache (%20 etc) are not being read by nginx, although nginx has no problem with me uploading files with spaces in them it doesnt like files with %20 etc. in the title.

I am using Perusio's nginx config which works great but i cant tweak it to fix this.

Any ideas?


texts: Body and Subject fields in Mail Function

texts:
I can't get it working. What am I doing wrong?

$name = $form_state['values']['name'];
$rname = $form_state['values']['rname'];
$email = $form_state['values']['email'];
$message = $form_state['values']['message'];

$params = array('current_conditions' => $data);
$message = drupal_mail('wow', rand(0, 999), $email, $language, $params, FALSE);
$message['body'][] = 'test';
// Only add to the spool if sending was not canceled.
if ($message['send']) {
    drupal_set_message('Success!');
}


texts: On what event does the cron begin its execution?

texts:
I have a site which requires periodic tasks to be done (sending content update notification / subscription, etc); which are configured on cron run. The cron run is setup to run after every "3 hours" at admin > config > system > cron.

I (user 1) did not visit the site for 10-12 days, while some of the other authenticated users did some activity like commenting / adding content. I have enabled notification emails whenever any user adds / edits any content or comment.

Last night when I logged into the site, I received notifications for the period of 10-12 days (period for which I did not log in to the site). While, as per the expected behavior I should have been receiving the notifications on the cron run after the user activity.

I checked to see the logs, and during this days I can see only the following message under the type "cron"

  Attempting to re-run cron while it is already running.

And strangely, I could see

  Cron run completed.

just before 5 secs of the message:

  Session opened for admin-user.

So, it is clear that I did not receive the notifications because the cron did not run during this period of time.

So, my question is why did the cron not run for these days? What is the exact event which triggers cron to start running? I understand that in Drupal 7 cron.php is called along with a token value to run the cron. But who / what does this call? Or do the Admin users need to log into trigger this action?

UPDATE: The site is on a dedicated server owned by the company. I have access to it as root user. And obviously don't have a cpanel to it ;-) And I have not set any other application to like crontab? Do I need to do so? If so how?


texts: How can I trim a field's value for display?

texts:
In Drupal 7, on a content type's "Manage display" tab, it was possible to trim strings to a particular length, by setting the field's format to "Trimmed".

For example, you could trim a long text field to 200 characters for the Teaser mode.

This doesn't seem to be possible in Drupal 8 – I don't have the option to set a custom-field's format to "Trimmed". (The only option available is "Plain text".)

Has the "Trimmed" format indeed been removed for custom fields? If so, is there a way to get it back?


texts:
I've been developing a custom theme as a Zen subtheme, but I've made so many changes and new files that nothing from the original Zen theme is being used.

However, my new theme is still connected to the Zen theme and requires that it is installed on the server.

How can I detach the Zen parent theme and have my subtheme stand alone?


texts:
I'm trying to figure out how to rebuild a form without using a button click trigger. Instead, I'm looking to rebuild whenever a blur event occurs on a textfield. All non-button form types lack the #submit value. It doesn't seem possible to trigger a form rebuild with $form_state['rebuild'] = TRUE; unless the submit callback is triggered. Demo code below.

function test_form($form, &$form_state) {
  $form['form_wrapper'] = array(
    '#prefix' => '
',
    '#suffix' => '
',
  );

  if (isset($form_state['textfield_vale'])) {
    $textfield_vale = $form_state['textfield_vale'];
  }
  else {
    $textfield_vale = 'not set';
  }

  //will not trigger page rebuild
  $form['form_wrapper']['test_textfield'] = array(
    '#type' => 'textfield',
    '#value' => 'Value = '.$textfield_vale,
    '#ajax' => array(
      'callback' => 'test_result',
      'wrapper' => 'form_wrapper',
      'event' => 'blur',
     ),
  );

  //will trigger page rebuild, changing the textfield value
  $form['form_wrapper']['trigger_rebuild'] = array(
    '#type' => 'submit',
    '#value' => 'I don\'t want to press it',
    '#submit' => array('submit_rebuild'), //has #submit value unique to buttons
    '#ajax' => array(
      'callback' => 'test_result_with_button',
      'wrapper' => 'form_wrapper',
    ),
  );

  return $form;
}

function test_result($form, &$form_state) { //unable to set $form_state['rebuild'] = TRUE
  $form_state['textfield_vale'] = 'textfield trigger'; //TRUE;
  $form_state['rebuild'] = TRUE;
  return $form['form_wrapper'];
}

function submit_rebuild($form, &$form_state) {
  $form_state['textfield_vale'] = 'button trigger'; //TRUE;
  $form_state['rebuild'] = TRUE;
}

function test_result_with_button($form, $form_state) {
  return $form['form_wrapper'];
}

Is there a way to trigger a form rebuild without clicking a button (perhaps with an ajax command)? Alternatively, how can I change my code to allow an ajax callback to change $form_state values?


texts: How to have a drupal module respond on node creation

texts:
I am trying to convert some of my rules to a custom module for more flexibility and better configuration.

However, I am stuck; I want my module to read some fields on node creation (or update). In rules there is the event property where I can choose 'on creation of node'.

I suppose I have to use a hook of some sort, but hooks like hook_node_insert() (and some others) that respond on a node being created (or saved) are depending on a node parameter; hook_node_insert($node).

So how do I get this node property?


texts:
I cannot get my Views calendar to have the tabs (e.g. Month,Week,Day,Year) in the upper left corner like the below image:

How do I get those tabs to appear?


texts: Views with logged user contextual filter stop working after adding relationship

texts:
I have two content types in a project I am working right now. Content type A has a field that hold the user ID of the user that "reserved" a node from that content type. Once the user has reserved a node from Content type A, he/she can then create a node from Content type B referencing the "reserved" node from Content type A. All that is done and working like a charm.

My issue is that I created a View where I want the user to see all the nodes he/she has reserved (Content type A), but I want to exclude the nodes from Content Type A that he/she has already used to create nodes for Content type B. The solution was fairly simple. I added the reserved by field to the contextual filter and I used the ID of the logged user and I added a relationship to "A bridge to the Content entity that is referencing Content via field_USED_FOR_REFERENCE"

The odd thing is that for user 1, the View work like a charm, but for other users the view display a blank page. I have rebuilt the permission, clear the cache, test the preview SQL query with the other users IDs (it does work), but the view page still show me a blank page for any user that is not user 1.

  Note: In my tests I have remove all the views permissions without any luck. If I remove the relationship in the views then everyone can
  see the views results and not only user 1.

What am I missing?


texts: How to add a heading at the top of node/add or node/edit?

texts:
In my node/custom_content/edit and/or node/add/custom_content page I want to place a heading at the top of the page as "Create New My-Content".

Seems simple enough, but I am unable to do so. How can this be achieved?


texts: How to add google analytics code for onclick functions in drupal 6

texts: My requirement is that, i need to my site to be tracked when i click on categories, menus, submenus, send mail button and shopping carts. Need to add onclick function for each  tags and that onclick functions need to be tracked.


texts: How do I get a block to use a URL to configure a contextual filter?

texts:
Blocks do not have paths so how can I pass a context to the block to get the correct results for a page?

I am new and do not have enough reputation to answer my own question for eight hours (Go figure!)  The answer for this question will  come after the time limit has expired.


texts:
What is the best way to get a 'Contact User' form on nodes like an ebay-ish 'Contact Seller' simple form?

I tried Contact / Contact Forms module, but I do not want a Sitewide Contact form to be accessible (don't want to use it) and I want Mollom/Captcha integration and sending limits for anonymous users.

I thought maybe I could do Webform, but I can't see a way to make the recipient dynamic (node author, for example).


texts: How to turn off url aliases on dev site?

texts:
I'm using path auto to automatically generate url aliases. On my dev site it would be convenient to use standard node/123 urls.
Is there a way to do that? Just turning off pathauto and path won't do the trick


texts: Fetch a view into hook_preprcess_node and then put it in a block

texts:
I want to fetch a view in my template_preprocess_node function and then put in in a block, so I can diplay it in the sidebars of my page. I have the view (the code below) but don't know how to put it in a block. Thank you for your help in advance!

    $view = views_get_view('playlist');
    $view->set_display('block');
    $view->set_arguments(array($course));
    $view->pre_execute();
    $view->execute();
    $variables['content']['playlist'] = $view->render();


texts: How can I make Rules react to `User has logged in` when user logs in through CAS?

texts:
I want to execute some php code when users log in, so I'm experimenting with the Rules module. I have it configured to fire a function of mine when a user logs in and it works fine, but it only works if the user logs in through Drupal. I am using CAS to authenticate users (thanks to the CAS module) and if a user logs in with CAS, the function never gets called. Is there any way to solve this?

Here is the function which is successfully called when a user logs in through Drupal:

myModuleName.rules.inc

function myModuleName_rules_action_info () {
    return array(
        'hello_rules_world' => array(
            'label' => "Print Hello World to error.log"
        )
    );
}

function hello_rules_world () {
    error_log("Hello Rules World!");
}

And here is a screenshot of the configuration:

UPDATE: I ended up using hook_user_login, which detects all logins without problem:

myModuleName.module

function myModuleName_user_login (&$edit, $account) {
    my_user_login_function($account);
}


texts: How to disable a file upload button for anonymous users?

texts: I've created a commerce add to cart form with a file upload field. The user can use this to upload a logo but I don't want anonymous users to be able to do this. I can see that the file module uses ajax to handle the upload but I can't see how you can disable the upload button for non logged in users.


texts: Using Flags to remember not only the node, but also its attributes

texts:
In our current development, running with Drupal 7, we need to let the end-user bookmark some products within a "catalog".   We will use the flag module for this.

However, we would like the flag to remember not only the products, but its variants. Not only the node/entity itself, but also the "attributes" selected by the user.
i.e. : bookmark a T-shirt in such size / such color.

Is there a "drupal way" to do this ? Do I need to use an extra or different module ?

Thank you.


texts: Views 3 | How to programatically unset or add new value to a view's footer / header display?

texts:
I have added 1 view display into my view's footer via "Global: View area | The view to insert into this area." and a regular "Global: Text area".

So my view has 2 footer displays, one being another view display and the other a normal text area.

Now I want to unset/hide either one of the footer display based on a condition, perhaps via hook_views_pre_render()

I was expecting to find documentation on something like:

$view->display['MY_VIEW_DISPLAY_ID']->handler->handlers['footer']['FOOTER_DISPLAY_ID']->unset_display();

But obviously that is not the way to go. Is it possible to accomplish that via hook_views_pre_render() or any other means? If so, how?


texts: Views Data Export Not working for current page

texts:
I am using View Data Export to export users in csv.
I am using a page view. Fields, User Name, Email. Same fields in Data Export display type and filters.

In Data Export display, using Parent Sort Checked.

Here are the page and Data Export Display using same settings.

Data Export Display.

On Page Display I am showing 5 users, with full pager. On Data Export Display I am using 5 as well.

When I change page, goto next page on /export-user, CSV Icon cant export users other than first 5 no matter on which page I am.

So the csv Icon shows the same link on each page.

Any idea if I am missing something.


texts:
Q: Can I combine two (geofield) field instances from different relationships into one aggregated Search API field?

So far I tried search_api_combined, which seems ok, but does only support the default field types, but not geofield LatLong for proximity search.

I was thinking that I could somehow craft a custom relationship that, for a given (product) node fetches one of the two profiles, or one of the two field instance values.

I guess all I need to know really is where the relationships in Search API are coming from.

Use case details:

Two profile2 profile types: Private person, merchant. Usually one person has only one such profile. In case of doubt, I would pick one and ignore the other.
Both contain a field instance of "field_coordinates" geofield.
Both contain a postal address field that acts as a geocoding source for the geofield, but with different granularity (private person only specifies postal code, merchant specifies full address). (This is one of the reasons why I'm using profile2) (This is not central to the question, just to give a better idea about the problem space.)
Search API and Facet API.
Product nodes with authors.
Profile2 geofield field_coordinates should act as the location for products.
Search index for products should combine the field_coordinates from different profiles into one aggregated field.


texts: How do I cache the result of db_query()?

texts:
I used views_get_view_result() to get results from a view because it was convenient at that time. The query result rarely changes; I could use views caching for 6 days.

If I wanted to convert it to a call to db_query() how could I enable caching?


texts: How do I use it only in the frontend theme?

texts:
Using the jQuery Update module, I set version 1.8. This version "broke" the views UI in the Admin theme; it seems that the AJAX calls in the Views UI work only with jquery 1.5.

How can I fix it?


texts: Commerce limit the quantity of product to 1

texts:
I want to restrict quantity for certain products. Want to add a product only once in cart. How to achieve this?

There are 3 products in my store and I want the users to add only 1 product in the cart at a time.

Which hook do I need to use?


texts: Get node path for Entity Referenced in Views

texts:
I have two Content Types: Product and Offer.

Offer has a Entity Reference field to Product

I'm making a view with Offers, and I want to get the Product URL in this View. I was trying with Relations but I have no result.


texts: Why is my '#id' transformed into 'data-drupal-selector'?

texts:
In a custom form I (try to) write, I have this element at the end:

$form['referent'] = array(
    '#id' => 'breferentdistrib',
    '#type' => 'hidden',
    '#default_value' => ($bReferentDistrib) ? "Y" : "N"
);

'breferentdistrib' being used in javascript this way:
var breferentdistrib = document.getElementById("breferentdistrib").value;

Unfortunately, I get this in the rendered HTML:
<input type="hidden" value="N" name="referent" data-drupal-selector="breferentdistrib">

No 'Id' and 'data-drupal-selector' instead.
Of course, my getElementById("breferentdistrib") is not working...
Any idea?


texts:
I'd like to display the total number of days that users were online in a View on their profile pages.

How can I do this?


texts: drupal7 : db_select node with multiple values field

texts:
I have a problem with db_select, i want to return a node per row for each value of the multiple values field :

node_1 : value_1_of_the_multiple_values_field
node_1 : value_2_of_the_multiple_values_field
node_1 : value_2_of_the_multiple_values_field
...

here is my code with the join it only return a node linked to the values of the field :

$query = db_select('node', 'n')
->extend('PagerDefault');

// Add join with multiple values field ( a date )

$query->join('field_data_field_date_programme_culturel', 'fdfdpc', 'fdfdpc.entity_id = n.nid');
$query->fields('n');

any idea please?


texts: In the settings for payments, what is the meaning of "Test transactions in a live account"?

texts:
What actually happens if I complete a transaction with the payments setting on "Test transactions in a live account"?
The only documentation I see is language like "Under Transaction mode, make sure 'Test transactions in a live account' is selected for testing purposes."
However, I can find no description anywhere of how the software behaves differently in this "Test transactions in a live account" mode compared with the two other modes available.
Also, what is required to submit the checkout form for a "test transaction in a live account"?  Does it have to be a real credit card number?


texts:
I'am having an issue which i cannot understand it , for example i have the following lines:

$form['field']['und'][0]['#type'] = 'select';
$form['field']['und'][1]['#type'] = 'select';
$form['field']['und'][2]['#type'] = 'select';
$form['field']['und'][3]['#type'] = 'select';

it works as expected , but if i try to change this hard coded method to :

foreach ($form['field']['und'] as $field)
            $field['#type'] = 'select';

it is not working anymore as expected...After a call like

 print render($form['field']);

for the first paragraph the result is good , as expected. But for the second paragraph it is not working anymore, the result is like nothing has been modified in the array. In the dsm($form) result either way the value of '#type' key is modified... I cannot understand the behavior. Please help!


texts: PHP Incomplete class Object Error on creating a custom Checkout flow Plugin in Drupal 8

texts:
I have created the custom checkout flow plugin in drupal 8. And added the required steps in it as per the the commerce2 documentation. See the code below.

<?php

namespace Drupal\commerce_custom\Plugin\Commerce\CheckoutFlow;

use Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowWithPanesBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * @CommerceCheckoutFlow(
 *  id = "custom_checkout_flow",
 *  label = @Translation("Custom checkout flow"),
 * )
 */
class CustomCheckoutFlow extends CheckoutFlowWithPanesBase {

    public function getSteps() {

        return  [
            'order_information' => [
                'label' => $this->t('Order information'),
                'has_sidebar' => TRUE,
                'previous_label' => $this->t('Go back'),
            ],
            'shipping_options' => [
                'label' => $this->t('Shipping Methods'),
                'has_sidebar' => TRUE,
                'previous_label' => $this->t('Go back')
            ],
            'review' => [
                'label' => $this->t('Review'),
                'next_label' => $this->t('Continue to review'),
                'previous_label' => $this->t('Go back'),
                'has_sidebar' => TRUE,
            ],
        ] + parent::getSteps();
    }

}

And enable the checkout flow and applied it in the commerce order configurations. Even I am able to open the edit checkout flow page but when I am setting an view to the order information pane. I am getting the response code 500.

And the error I got is:

PHP Fatal error:  Drupal\\commerce_checkout\\Plugin\\Commerce\\CheckoutPane\\CheckoutPaneBase::defaultConfiguration(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition &quot;Drupal\\commerce_custom\\Plugin\\Commerce\\CheckoutFlow\\CustomCheckoutFlow&quot; of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition  in /var/www/html/labeloutlet_web/web/modules/contrib/commerce/modules/checkout/src/Plugin/Commerce/CheckoutPane/CheckoutPaneBase.php on line 106, referer: http://localhost/labeloutlet_web/web/admin/commerce/config/checkout-flows/manage/custom_checkout_flow?destination=/labeloutlet_web/web/admin/commerce/config/checkout-flows

So my question is how to resolve this error and being able th change the configurations of the pane inside a custom checkout flow plugin.


texts: How to do recurring subscriptions with credit card and Drupal 7

texts:
I need to implement recurring payments properly for my site. The payment model I have in mind is that as in use by linode: you sign up, pay for a linode and it will be billed forever recurring to your credit card. If you choose to make that linode larger, or order another one, you'll still be billed only once at the first day of the month, except now with the new amount.

Is there a decent module to do this under Drupal 7? I'm looking at drupal commerce and the commerce_moneybookers module (since i already have a moneybookers merchant account) but moneybookers only provides recurring payments if you sign up for an account with them. I'm not prepared to make my customers do that.

ideas?


texts: Install a PDF maker to the panel of a WYSIWYG editor?

texts: After installing WYSIWYG and CKeditor how can I install some kind of PDF maker to the panel of the editor?


texts: How to change the date format in the date field as a select list?

texts:
On user registration page, I have added a date field in select list.

In the manage form display tab, I can set the order of the dropdown fields like day/month/year or month/day/year But I am unable to change the format of the date.

Currently in the day dropdown, it is displaying like 1, 2, 3 and I want to change it to 01, 02, 03. Similarly in the month dropdown, it is displaying like, Jan, Feb and I want to display it like January, February.

Is this possible?


texts: Relationship between node and other nodes related by node reference to same parent

texts:
I've been stuck on this all day and I need help.

I have a video node that has a relationship (node reference) with a playlist node.

There are multiple videos referencing that playlist and there are multiple playlists.

Now here is my issue...

I have my node that plays my video and a view that lists all other videos in the same playlist to the bottom of the node. The views display plugin i'm using is EVA: Entity Views Attachment. This works apart form the fact I don't know now to filter it to only show a list of videos that are in the same playlist (referencing the same playlist node). I am able to get the ID or tokens (eg: field_video_playlist) from the video node and pass as an argument but when I setup contextual filter and relationships in the EVA view it returns nothing.

Without the contextual filter and relationship in the view it returns ALL videos.

Any help with this would be very much appreciated.

C


texts: Custom view mode for entity references - getting rid of title

texts:
I have an entityreference field that displays content in a custom view mode. It works great.
The only problem is that in addition to the fields that I placed in my custom view mode, it also displays the title as a link to the content. I would like to replace it and have another field (that is already in the view mode) be used as the link to the content. Also the title is appearing in the markup outside the entityreference field's view mode's wrapper, making styling a bit cumbersome.
So right now I have something like the following as field output
The title of the node

headline
My cool description that has some words in it
[and a picture]

I want essentially the same thing, but minus the title, and with the headline as the link, like so:

headline
My cool description that has some words in it
[and a picture]

How do I go about getting rid of the title and substituting the headline?


texts: Issues migrating site back to local server

texts:
I have issues migrating my Drupal 7.14 site from Live Server back to local. This might be more sql related, but not sure at this point where the error comes from. Might be specifically Acquia related.

The site is now perfectly running on the live server. I made some new nodes etc and now I wish to work more on the structure. I was trying to migrate it back to my local Acquia server by doing the following:

creating local safety copy of the current local site (also to preserve the local settings.php file)
creating safety copy of local sql db
exporting live sql db, then dropping tables of local db and replacing them with the live one
replacing local site files with the ones downloaded from live
updating settings.php from the original local safety copy

What happens is:

when trying to access local address (mysite:8082) I get 'could not find' error message. this comes from google, so the local drupal site doesn't even get recognized in any way
i am still able to set up new Drupal installations via Acquia and they run perfectly
if I replace the sql db of a newly installed site with the one I got from the live site I get the same error
i can't seem to get the local site running even if I use the safety copy sql + safety copy of the local site
if I go to a definite url such as 'mysite:8082/index' I get the following: "The requested URL /index was not found on this server."

Where should I look next? What could be in the sql that makes the whole server unrecognisable?Any completely different ways to do this? Thanks!


texts: How to handle user 1 with PCI compliance

texts:
PCI compliance states there can be no shared accounts. Typically between developers user 1 is shared and utilized for things that require user 1, but that would violate the PCI rules.

Is there a way to prevent the user 1 account from violating PCI rules?


texts:
I've started learning Drupal a few months ago and I can say that the community is great and that I haven't had the need to ask a question here until now.

I've started to work on a project and I have a problem with one part.

I need to create something like timeline. There is a requirement for a line where the titles of nodes would be listed according to the date of creating, and I need to list some of the fields of those nodes (like text, image...).

The main problem for me is that I have to show the nodes through views because of some additional filters. I've tried a few available modules and they work great, but the problem with them is that they are vertical, and what I need is a horizontal timeline.

I've tried A Simple Timeline and Ajax Timeline module.

Is there maybe some other module that I haven't found and that could be useful for what I need?

Off course, It would be great if someone more experienced could give me some idea from which I could start working.

I just want to mention that I'm using the latest Drupal version (7.34) and I installed the latest version of Views module (3.8).

Thanks in advance.


texts:
function loading_icon_block_view($delta='') {
    switch($delta) {

        case 'loading_icon':
            $block = array(
                //Title of Block
                'subject' => t('Loading Icon Example Code'),

                //Content contained
                'content' => loading_icon_gen_content(),
            );
            break;

        /* Always returns ? */
        default:
            //Tested used to find out $delta if content not showing
            $block['content'] = 'Delta: '.$delta;
            break;
    }
    return $block;
}

This works fine in conjunction with hook_form() and using drupal_set_message on the block generated I see that I get both loading_icon and loading-icon as the $delta (if I duplicate the current case to loading-icon then I get the same content printed twice).

I haven't set loading-icon anywhere. Can anyone give me a hand?


texts: Privatemsg through a Multi Site configuration?

texts: Is it possible to do such a thing for users in site 1 to message users in site 2 and visa versa? Using the Privatemsg module?


texts: Drupal 7 - Output taxonomy terms on a node?

texts:
Currently I want to output the taxonomy term of the current node I'm viewing. I have an Article content type and I created a view block placed it in the footer. Now in this view I'm using PHP Field and I want to output the taxonomy terms on the current page. Right now I know menu_get_object() can get you the node ID of the page, but I'm not sure how would one get the taxonomy terms of the current page?

I was thinking of doing a node_load() on the nid of the page and then parse the taxonomy array then fetch the TID then do another function to grab the Taxonomy name. Any other easier way of doing this?


texts: how to depricate repeated field values from my view?

texts:
Look at my screenshot i don't need repeated employee id and name...i
 just want to print emloyee id and name once but i want to display the others records with blank employee id and name but not salary, month and year....I am using JOIN
 query in my hook view... So gyus please suggest me any trick to remove
 those field value...

edited question for clarity...


texts: I'm trying to configure memcache module and failed to load dmemcache.inc

texts:
Anybody could have an Idea why I get this error
    Failed to load required file sites/all/modules/memcache/dmemcache.inc.

I installed memcache properly on my server, but when I go to drupal Report, I got the above message

I'm using drupal 7

This is from my PHPInfo()
memcached
memcached support   enabled
Version     2.1.0
libmemcached version    1.0.8
Session support     yes
igbinary support    no
json support    no

Directive   Local Value Master Value
memcached.compression_factor    1.3 1.3
memcached.compression_threshold 2000    2000
memcached.compression_type  fastlz  fastlz
memcached.serializer    php php
memcached.sess_binary   0   0
memcached.sess_lock_wait    150000  150000
memcached.sess_locking  1   1
memcached.sess_prefix   memc.sess.key.

**** UPDATE ****
in order to make it work, I added that to the settings file

$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
  $conf['lock_inc'] = 'sites/all/modules/memcache/memcache-lock.inc';
  $conf['memcache_stampede_protection'] = TRUE;
  $conf['cache_default_class'] = 'MemCacheDrupal';

  // The 'cache_form' bin must be assigned to non-volatile storage.
  $conf['cache_class_cache_form'] = 'DrupalDatabaseCache';

  // Don't bootstrap the database when serving pages from the cache.
  $conf['page_cache_without_database'] = TRUE;
  $conf['page_cache_invoke_hooks'] = FALSE;

thanks a lot


texts: Custom ParamConverter doesn't work (doesn't give error but return isn't what it should)

texts:
I'm learning Drupal8 (for the first time, no Drupal7 or previous knowledge) on a local Vagrant VM and have come up against this little problem. I'm sorry if it's kind of a noob question but I wasn't able to solve it and also couldn't find any specific hepful info out there.

I can access my route ("http://172.28.128.10/drupal-project/web/policeman/7") and no error is shown, but this is what my navigator (Chrome) displays:

plateNumber = $plate_number; } public function getPlateNumber() { return $this->plateNumber; } }

This is kinda weird in the sense that it seems like Drupal is having trouble with its internal calls but I don't quite understand why it's returning that and displaying it instead of throwing some kind of exception.

I know the routing works with other controllers I've created that don't use custom ParamConverters like "http://172.28.128.10/drupal-project/web/hello/3" which returns just fine the name of the user with said ID. Don't know if knowing other routes work is relevant for you.

ow_hello.routing.yml:

ow_hello.policeman:
  path: '/policeman/{policeman}'
  defaults:
    _controller: \Drupal\ow_hello\Controller\PolicemanController::view
  requirements:
    _access: 'TRUE'
  options:
    parameters:
      policeman:
        type: policeman

ow_hello.services.yml:

services:
  ow_hello.policeman_param_converter:
    class: Drupal\ow_hello\Routing\PolicemanParamConverter
    tags:
    - { name: paramconverter }

Policeman.php:

<?

namespace Drupal\ow_hello;

class Policeman {

  private $plateNumber;

  public function __construct($plate_number) {
    $this->plateNumber = $plate_number;
  }

  public function getPlateNumber() {
    return $this->plateNumber;
  }

}

PolicemanParamConverter.php:

<?php

namespace Drupal\ow_hello\Routing;

use Drupal\Core\ParamConverter\ParamConverterInterface;
use Drupal\ow_hello\Policeman;
use Symfony\Component\Routing\Route;

class PolicemanParamConverter implements ParamConverterInterface {

  public function applies($definition, $name, Route $route) {
    return !empty($definition['type']) && $definition['type'] == 'policeman';
  }

  public function convert($value, $definition, $name, array $defaults) {
    return new Policeman($value);
  }

}

PolicemanController.php:

<?php

namespace Drupal\ow_hello\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\ow_hello\Policeman;

class PolicemanController extends ControllerBase {

  public function view(Policeman $policeman) {
    return [
      '#type' => 'markup',
      '#markup' => $this->t('Hello my plate number is: @plate_number', ['@plate_number' => $policeman->getPlateNumber()]),
    ];
  }

}


texts:
I'm setting up Omega 4 using SASS / Compass for the first time, I have:

Linux VM running apache and guard
Windows machine for code editing and browser

Whatever I do I cannot find livereload.js in the page source.

Guard is running fine
I have cleared the cache several times
I can view the script at ip.ad.dr.ess:35729/livereload.js and at my_site.com:35729/livereload.js in my browser
I've tried changing the settings at admin/appearance/settings/my_theme to various different things but I don't think that makes a difference if the script is not included in page source

Any gems of wisdom would be greatly appreciated.


texts:
This link https://www.drupal.org/node/2122201 suggest us to make use of route_callbacks when we are using dynamic routes.Can someone tell me how to make use of this route name in *.links.menu.yml file to make menu? The problem is when we are returning $route_collection in the routes() function then it must be containing multiple routes then how to generate menu for any particular dynamic route.
 I did a search inside menu_tree table in the database and find out that no menu has been created with help of dynamic routes so I am beginning to think whether this is possible or not. If it is not possible that what is the possible solution?


texts: Why do I get errors abot undefined variables and errors with unserialize()?

texts:
Sometimes I get these errors on my site that I'm developing with the distribution of Commerce Kickstart:

  Notice: Undefined index: title_value en link_field_update_instance() (línea 1305 de /home/content/90/9397890/html/a/profiles/commerce_kickstart/modules/contrib/link/link.module).
  Notice: Undefined index: title_value en link_field_update_instance() (línea 1305 de /home/content/90/9397890/html/a/profiles/commerce_kickstart/modules/contrib/link/link.module).
  Notice: unserialize() [function.unserialize]: Error at offset 10301 of 11637 bytes en views_db_object->load_row() (línea 2243 de /home/content/90/9397890/html/a/profiles/commerce_kickstart/modules/contrib/views/includes/view.inc).

Do you have any suggestion about how to avoid these notices are reported?


texts:
I have tried a number of ways to try to redirect a sub url in my htaccess file with very little progress, and I know I am doing it correctly but for some reason it just is not working, and as far as I can tell there is no module that can do this. I am simply trying to direct a sub domain to the main domain.

This is the code I am using.

  RewriteBase /
  RewriteRule ^red.sitename.com$ http://sitename.com/ [R=301,L]

Now I have red somewhere that you have to do it this a certain way when clean urls is enabled and this is suppose to be the correct way but it is not working.


texts:
I am running a competition whereby users must fill in a webform to enter. However, I am also using Facebook connect, and want the web form page to display, with the body and all the rest except for the form itself, unless the user is logged in. What is the best way to:

Allow access to the webform if anonymous?
Not allow the user to submit the form if anonymous?
Hide the form and show my custom Facebook login button if the user is not logged in?

Point 1 is basically using Webforms the default way. And point 3 I can probably do by just editing the template of the node. But I am not sure how I can override the validation of the form to stop the user from actually entering the competition if he is not logged in.

Any ideas on what the best way is to do this?


texts: Programmatically modifying global custom text field in view

texts:
I have a (Apache solr) view with a Global: Custom text field in addition to my normal fields. This field is meant to get value from a custom function/existing field/passing an existing field to a custom function and using return value in one of my modules per each result and I am trying to accomplish this functionality without using Views PHP module.

I referred this very similar query and tried the following approach which did not yield me the result:

hook_views_pre_render:

function mymod_views_pre_render(&$view) {
  if ($view->name == 'mymodview' && $view->current_display == 'mymod_display') {
    $result = &$view->result;
    foreach ($result as $num_idx => $result_obj) {
      $result[$num_idx]->nothing = $result_obj->an_already_available_field_or_fxn_call;
    }
  }
}

Also tried the same code with hook_views_post_execute to no avail. Using $view->field['nothing']->options['alter']['text'] = 'My custom text'; set the default text value to all fields which was not my desired result.

Based on the post linked earlier tried the following code in my theme's template.php

template_preprocess_views_view_fields:

function mytheme_preprocess_views_view_fields(&$vars) {
  $view = $vars['view'];
  if ($view->name != 'mymodview' && $view->current_display != 'mymod_display') {
    return;
  }
  foreach ($view->field as $id => $field) {
    $vars['fields']['nothing']->content = 'Some global custom text content';
  }
}

I am unable to determine what I am missing out on owing to my relative inexperience with views functionality and guidance on achieving this programatically would be much appreciated.


texts: How to programmatically handle files (CSV import)

texts:
I'm trying to make a simple form to upload a txt/csv file, in order to parse it and update some values in database. Here's my code. Unfortunately, at the moment using the form nothing happens (no folder creation, no file upload...) Here's the code. What can be wrong here? Thank you

function vts_departs_conf_form() {
  $form = array();

  $form['browser'] = array(
    '#type' => 'fieldset',
    '#title' => t('Send file'),
    '#collapsible' => TRUE,
    '#description' => t("Send foo file."),
  );

  $file_size = t('Maximum file size: !size MB.', array('!size' => file_upload_max_size()));

  $form['browser']['file_upload'] = array(
    '#type' => 'file',
    '#title' => t('CSV File'),
    '#size' => 40,
    '#description' => t('Select the CSV file to be imported. ') . $file_size,
  );

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

  $form['#attributes']['enctype'] = "multipart/form-data";

  return $form;
}

function vts_departs_conf_form_validate($form, &$form_state) {
  // attempt to save the uploaded file
  $filepath = 'public://depconfs';
  file_prepare_directory($filepath, FILE_CREATE_DIRECTORY);
  $file = file_save_upload('file_upload', array('file_validate_extensions' => array('CSV TXT')), $filepath, FILE_EXISTS_REPLACE);

  // check file uploaded OK
  if (!$file) {
    form_set_error('file_upload', t('A file must be uploaded or selected from FTP updates.'));
  }
  else {
    // set files to form_state, to process when form is submitted
    $form_state['values']['file_upload'] = $file;
  }
}

function vts_departs_conf_form_submit($form, &$form_state) {
  //Prepare file parsing
  $line_max = variable_get('user_import_line_max', 1000);
  ini_set('auto_detect_line_endings', true);
  $filepath = $form_state['values']['file_upload']->filepath;
  $handle = @fopen($filepath, "r");

  while ($row = fgetcsv($handle, $line_max, ',')) {
    // do stuff
  }
}

EDIT :

As a first step, @bdurbin corrected my naming mistakes.

Reading file_save_upload() API description, I realised that my basic validation checks are already performed, so I removed them.

So final is quite lighter :

function vts_departs_conf_form_validate($form, &$form_state) {

  $filepath = 'public://depconf/';
  $validators = array('file_validate_extensions' => array('csv txt'));
  $file = file_save_upload('file_upload', $validators , $filepath, FILE_EXISTS_REPLACE);
  //push file object to submit step
  $form_state['values']['file_upload'] = $file;

}


texts: How to troubleshoot edit node page timeout errors?

texts:
When I try to update the body of a basic page, Drupal 7 times out after I press the "Save" button and wait for a while. Surprisingly, I can successfully update my other pages through Drupal forms.

I cleared all caches but that didn't help.

I tried to update the content by editing the database directly, but, my changes to the database tables "field_data_body" and "field_revision_body" didn't affect my web page.

How I can troubleshoot the timeout error when I try to update the contents of a basic page in Drupal 7?


texts: How to show view for a unique row from custom database table on Drupal 8?

texts:
I'm using drupal 8, and I have a custom table that was created with schema from my module on install file.

$schema['md_noticias'] = array(
    'fields' => array(
        'id'=>array(
                'type'=>'serial',
                'not null' => TRUE,
        ),
        'id_plone'=>array(
                'type' => 'int',
                'mysql_type' => 'BIGINT',
                'not null' => TRUE,
        ),
        'titulo'=>array(
                'type' => 'text',
                'mysql_type' => 'varchar',
                'length' => 350,
                'not null' => TRUE,
        ),
        'descripcion'=>array(
                'type' => 'text',
                'mysql_type' => 'varchar',
                'length' => 1000,
                'not null' => TRUE,
        ),
        'cuerpo'=>array(
                'type' => 'text',
                'mysql_type' => 'text',
                'not null' => TRUE,
        ),
        'titulo_imagen'=>array(
                'type' => 'text',
                'mysql_type' => 'varchar',
                'length' => 500,
                'not null' => TRUE,
        ),
        'fecha_creacion'=>array(
                'type' => 'int',
                'length' => 11,
                'not null' => TRUE,
        ),
        'creador'=>array(
                'type' => 'text',
                'mysql_type' => 'varchar',
                'length' => 250,
                'not null' => TRUE,
        ),
        'imagen'=>array(
                'type' => 'text',
                'mysql_type' => 'varchar',
                'length' => 600,
                'not null' => TRUE,
        )
    ),
    'primary key' => array('id'),
);

I show a table with all rows thats have a delete action. But.

How can I create a display view for a unique row with format for public users. For example:

$myrow["titulo"]

$myrow["descripcion"]

$myrow["cuerpo"]

Thanks!


texts: Page Content Type: Displaying error in Preview mode

texts:
Whenever I am creating or editing a node, in the preview mode I see these errors.

This is the code I am using.

/**
 * Implements hook_preprocess_html().
 */
function campaigns2019_preprocess_html(&$variables) {
  if (isset($variables['node_type']) && $variables['node_type'] === 'landing_page') {
    $node = \Drupal::routeMatch()->getParameter('node');
    if ($node->field_dark_theme->value) {
      echo("<script>console.log('here');</script>");
      $variables['attributes']['data-theme'] = 'dark';
    }
  }
}

The dark theme does not show up in preview mode though. However, if I ignore the errors and create my page, the dark theme works and everything seems to be displayed correctly. When is template_preprocess_html() called? Where in Drupal is it called?


texts: Adding validation to widget settings form

texts:
I'm creating a new field in Drupal 8. I've created a class for the widget, extending WidgetBase and implementing WidgetInterface, and added the functions defaultSettings(), settingsForm() and settingsSummary().

I want/need to validate the element I'm adding in settingsForm(), but I can't seem to figure out how to add validation to this. I tried adding a function settingsFormValidate(), but that doesn't seem to be called. I also tried adding #element_validate to the element I'm adding in settingsForm(), but that also does not seem to be called.

Note that I'm not looking to validate the widget (that is shown to the user), I'm looking to validate the element added in settingsForm() for the widget, that is on the Manage Form Display tab, when adding the field to Entities/content types.

Does anyone know how or whether it's even possible to add validation to the widget settings form?


texts: drush sql-sync error: [mysqldump: command not found]

texts:
I have a production server set up in my drush aliases as @prod, and a UAT server set up as @uat. I am using MySQL as the database of my Drupal sites. I can successfully execute drush command like drush rsync @prod @uat. However, when I execute

drush sql-sync @uat @prod

Error prompts:

bash: mysqldump: command not found

After googling, the solution is to set the $PATH to include /usr/local/mysql/bin, however, I do not have right to install MySQL client.

Here I have 2 questions:

Is it a must to have mysqldump in order to run drush sql-sync?
If so, apart from installing MySQL client, is there any other way to do it?

Thanks.


texts:
I'm trying to set up a testing site with DCommerce used to present product information, yet for the time being, there won't be any shopping cart functionality. I'm stuck at how to bind the products (instances of my custom product type defined in Store) with taxonomy, and also to have the URL aliases created dynamically based on that taxonomy.

Has anyone bumped inot a good case study or tutorial. I seemed to have googled the entire internet but to no avail.

Artur


texts: How do I see the value of one field of a multi-item field in views formatter

texts:
I have a custom views formatter.

function template_preprocess_views_view_flot_views_time(&$variables) {
  $view = $variables['view'];
  $field_name = 'foo_bar';
  foreach ($view->result as $row) {
    $field_value = $view->field[$field_name]->getValue($row);
  }
}

This works when the field is a single-value field. However, I have a couple multi-value fields. The result of the above expression is always "1" for these fields. These fields can be identified because

 $view->field[$field_name]->multiple == TRUE

I can use

kint($view->field[$field_name]->getItems($row));

to see that this is an array with a render array and raw data.
The value as a string can be found at:

$view->field[$field_name]->getItems($row)[0]['rendered'][#markup']

If the multi-value field is named foo, and has three parts, 'bar', 'baz', and 'qux', is there a better way to get the value of foo_bar or foo_baz?

I've been looking at the documentation for core/modules/views/src/Plugin/views/field/Field.php but it's not helping.


texts: Using Rules to send an email to all Simplenews subscribers

texts:
On a Drupal 8 site I'm working on, we are using Simplenews to allow users to subscribe to a mailing list for blog posts. The client would like us to set up a rule to automatically send an email to everyone on this specific blog post subscriber list whenever a new blog post is published.

I have gotten to the point where Rules will send out an email to a specific email every time a new node of type Blog Post is published, but I can't figure out how to reference a specific list of Simplenews subscribers through Rules' data selector. Does anyone know how to create that? Or maybe a work around for this?


texts:
When I run...

composer global require drush/drush:dev-master

...I get...

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Can only install one of: consolidation/output-formatters[3.1.12, 2.1.3].
    - Can only install one of: consolidation/output-formatters[3.1.12, 2.1.3].
    - Can only install one of: consolidation/output-formatters[3.1.12, 2.1.3].
    - drush/drush dev-master requires consolidation/output-formatters ^3.1.12 -> satisfiable by consolidation/output-formatters[3.1.12].
    - Installation request for drush/drush dev-master -> satisfiable by drush/drush[dev-master].
    - Installation request for consolidation/output-formatters (locked at 2.1.3) -> satisfiable by consolidation/output-formatters[2.1.3].

My PHP version is 5.6.11.


texts: Hide default "all" parameters from Views Querysting

texts:
By default Drupal Exposed Filters query string includes all filters even if they aren't selected
i.e. www.example.com/?optiona=valuea&optionb=all&optionc=all

How do I adjust it not include default/all values in the query string?

For example, if the user does not touch "option b" just option a they would get

i.e. www.example.com/?optiona=valuea

The goal is to create a "cleaner" query string by not including the default values.


texts: How to show only the deepest taxonomy term in a drupal view, having used hierarchical select to tag content

texts:
I have a site for sporting products.
I use hierarchical select to tag the products that are added to the site - and the term lineage is saved, so Taxonomy menu automatically creates nice hierarchical menus linking to the taxonomy pages - which I've overridden using views.

See here for an example:  http://dayalssports.com/product-menu/badminton/rackets

The rackets are grouped according to taxonomy term.
Problem is, as the term lineage is saved, the taxonomy view displays all the terms, in a seemingly random order. It doesn't display them parent->Child1->Child2 etc as you would expect.

I want to display only the deepest term. So instead of having:

Rackets , Y Series Rackets , Badminton

which is out of order anyway, I just get

Y Series Rackets

Is there a way to do this? Or is there at least a way to order them correctly?

The correct order should be Rackets , Badminton , Y Series Rackets


texts: Drupal pages translated, but both translated and untranslated pages showing up on view

texts:
I recently started working on adding translation to my Drupal 6 site.
I am using the modules
1)Translation Manager
2)i18n
3)Language Switcher Dropdown

It seemed pretty straight forward to me.
I read the multilingual drupal guide
http://drupal-translation.com/content/setup-multilingual-site

I sent all my content type/strings to one of my translators (using local translators).
My translator translated one of our pages for a certain content type, and finished the translation.

The only problem is that the content type she translated has both the english and the translated version showing up on the same page.

Here is the page
http://caribbeanenvirolaw.org/ngos
The duplicated page is "Jamaica Environment Trust (JET)

I notice when I go to the french JET page the Language dropbox shows "Francais",
and when I go to the english JET page the language dropbox shows "English".

I would like the french translated pages to only show up if the language select box
shows French, and have the English pages be the only ones that show up if the language selectbox is set to English.

The NGO page that is showing both french/english JET pages is a view, but I couldn't
find anything in the views section regarding translation and only showing the current languages pages.

Little help?

***Update****

The page in the picture is a drupal "view". The content type "Belize - ....."
is in English, and has been translated to spanish/french.  Those spanish and french
translations show up as separate content type's on the drupal page (the view).

Since the language dropbox is set to "English" you would think that it would hide the spanish/french versions, but it is not.

For each of the "Belize - ...." content types (english, french, spanish), I tried multiple configurations to get drupal to leave out language content that is not for the language currently selected.
In the last image you see I'm setting the url to be "belize".
I used this same value for each of the translated contents.

Scrolling over the links for each translated "Belize - ...." content shows

1)English url =  caribbeanenvirolaw.org/belize
2)Spanish url =  caribbeanenvirolaw.org/es/belize
3)French url =  caribbeanenvirolaw.org/fr/belize

When I open, for example the spanish translation of belize page from the view,
I see

Notice that the language dropbox now say Espanol, meaning it is recognizing that it is a spanish page, but still it shows the spanish/french translations (as well as english) on the view (first image) no matter what the Languages dropbox has selected.

Keep in mind that I have also tried to not edit the url path's manually (leaving them blank). I get the same results from doing it that way too.


texts:
I had installed Drush for Windows and trying use it.
I open directory (in CLI, in my example: Z:\home\www\drush-test) where I want install drupal and run drush dl command:
Z:\home\drush-test\www>drush dl
Install location Z:/drush/drupal-7.25 already exists. Do you want to overwrite it? (y/n):

But i need install drupal to Z:\home\drush-test\www not Z:/drush/drupal-7.25 (this directory where Drush installed)
Also I trying using drush status in my old project (drupal installed). Drush don't see my drupal:
Z:\home\comp\www>drush status
X-Powered-By: PHP/5.3.13
Content-type: text/html; charset=utf-8

 PHP executable        :  php.exe
 PHP configuration     :  Z:\usr\local\php5\php.ini
 PHP OS                :  WINNT
 Drush version         :  7.0-dev
 Drush configuration   :
 Drush alias files     :

Z:\home\comp\www>ls
CHANGELOG.txt       LICENSE.txt      cron.php     nbproject   update.php
COPYRIGHT.txt       MAINTAINERS.txt  includes     profiles    web.config
INSTALL.mysql.txt   README.txt       index.php    robots.txt  xmlrpc.php
INSTALL.pgsql.txt   UPGRADE.txt      install.php  scripts
INSTALL.sqlite.txt  __files          misc         sites
INSTALL.txt         authorize.php    modules      themes

Z:\home\comp\www>

(Drupal 7 installed in this directory)
Windows 8.1, PHP 5.3


texts: When you recreate a Feature, do you need to uninstall and re-install it?

texts: When you recreate a Feature, do you need to uninstall and re-install it or is it OK to just delete the feature folder and paste the new on in its place?


texts: I have a client who wants to use images instead of text for his menu items. Is there a native way to do this in Drupal 7?


texts: How to remove link from around the rendered entity inside view header

texts:
I use rendered entity inside my view header. It is a page. When the view displays, the rendered page title in the header has link around it.

I've tried to prepare my own display mode for page type of content and remove link items from them, moved them to hidden. Nothing helped.

Any suggestions appreciated.


texts: Conditional Show/Hide Child Terms on Edit Page

texts:
I have a content type with a term reference. The terms have child terms. On the admin editing side, I want to show only top level terms until selected, then show only the child terms for that parent.
This to prevent having a ginormously long field.
Parent 1
  Child 1
  Child 2
Parent 2
  Child 3
  Child 4
Parent 3
...

When a user edits a piece of content, I want to only show the parent terms initially. Then show/hide the child terms when the parent is checked.
Parent 1
Parent 2 (checked)
  Child 3
  Child 4
Parent 3
Parent 4
...

I've used conditional fields, state API, and select (other) modules. But this is showing and hiding children on the same field. So it's a bit different.
Anyone have any advice for this scenario?


texts: Let users access account before confirming email address

texts: I'd like to let users access their account without confirming email address. But still send the email confirmation. Then I'll display a message saying that if email is not confirmed within 3 days, account will be deleted. How can I do this in drupal 7 ? Is there any module that can help me do this, or if I need to do it in my custom module, please give me a hint about how can this be done ? Thank you.


texts:
So I've installed a new Drupal 7 on my server, and installed the "AntiSpam" module with Drush. ([See Installing modules without FTP.)

I can't configure the module. When I open up the Configuration panel, I get an error message, saying:

  Akismet spam protection service requires a...

When I click on "Configure," I get dropped back to the Configure menu.

What did I miss? Drush didn't display any error message, and the module shows up in the modules page as enabled.


texts:
Is it possible to use FAPI and transactions?

I need to implement a validation that makes a query to check something and on the submit I need to update the database.

I thought to open a transaction on the validation callback and set it on the $form_state and then commit my transaction on the submit handler. I didn't liked this solution but was the best that I could think.

How do you solve this kind of things on drupal? What do you think about my solution?


texts:
I am trying to redirect user to edit profile page after accessing the password reset link, code looks like

function mymodule_reset_menu_alter(&$items) {
  // Drupal's default behavior is to show the user a log-in form before
  // their user profile.  We replace this item to skip the uneccesary step.
  $items['user/reset/%/%/%'] = array(
    'title' => 'Account settings',
    'access callback' => 'simple_pass_reset_pass_reset_access',
    'access arguments' => array(2, 3, 4),
    'page callback' => 'test',
    'page arguments' => array(2, 3, 4),
    'type' => MENU_CALLBACK,
  );

}

function test($uid, $timestamp, $hashed_pass, $option = NULL) {
  global $user;
  // Show the user edit form instead of silly one-time login form.
  $account = user_load($uid);
  $user = $account;
  $token = drupal_random_key();
  $_SESSION['pass_reset_' . $user->uid] = $token;
  drupal_goto('user/' . $user->uid . '/edit', array('query' => array('pass-reset-token' => $token)));
 }

while test() is callback for menu 'user/reset/%/%/%'.

The issue is when the user access the link for first time user gets "Access Denied" for second time user successfully redirects to edit profile page with password reset option. I think issue must be in the way the token is generated as it is the only thing which changes, but have no clue on how to fix this.


texts: Has anyone been successful in localizing/translating strings pertaining to the Search module? At first, I wanted to translate the "search results" head string and on this page admin/config/regional/translate/translate looked up "search" in general - no such string was found... Or, is there a way to override strings through a custom module?


texts: How can I call hook_user_presave() only when an account is updated, not created?

texts:
I want to call hook_user_presave() only when an account is updated, not created.  However, the API docs state:

  A user account is about to be created or updated.

Is there a way to check whether I am getting a new account or an update to an existing account?


texts: How to make state/provinces list dynamic on user profiles/registrations? with international addresses?

texts:
I have a site with international users, and I'm using location, user locations, and Google geocoding to show their locations on a map.

I'm using the US as the default for addresses, as most of my users are US based. The issue that I have is that the state/provinces drop down doesn't update the list for a different country until after the form is saved. The effect of this is that the newly registered users has to go back into their account an update their address if it isn't in the US.

Is there anyway to make the state/provinces list dynamic? that is to have the list match the country selected while the user is registering?

One solution to this is to email the user and remind them to update their address, but this seems like back UI and laziness.

Is there some way to refresh just the location fields before the form is submitted if it cannot be dynamic?

So, I'm not sure how to approach this and any advice would be appreciated.