texts:
Using the command:

 drush arr ~/drush-backups/site.tar.gz --db-url=mysql://df_database:password@localhost/df_databaseuser --destination=~/domains/site.kz/public_html/temp

(archive size is ~5gb),

I get this error:

 Unable to untar /home/user/drush-backups/site.tar.gz.                [error]
 Unable to extract site archive tarball to                            [error]
 /tmp/drush_tmp_1384866055_528b6107d88d6.

Why does it happen? However, when I try to untar archive lower than 1gb I'm not getting any errors.


texts: Joomla to Drupal: how to use migrate module

texts: I want to move my website from joomla to drupal. I read that the migrate module is the appropriate but i don't know how to use it. Can someone give guides to do this.


texts: Google Analytics Reports: how to remove pageviews for Top Pages and add published date

texts:
I've installed google analytics reports to be able to see the most viewed nodes of my website. I were able to add the Top Pages view to my home page but i wanted to know how can i :

add published date
remove the number count and leave the title only.

See image


texts: How to display a video file without using the video hosting websides?

texts:
I need to display video file without using youtube, vimeo etc.
I am using the bootstrap theme. I've tried to using some modules with no luck:

Module: MediaFront, Field type: File, Display mode: MediaFront Player
File is not rendering at all.
Module: Video, Field type: Video On Chrome looks fine, but there is a
problem on Safari (can't debug it – tested on iPad).

I'm looking for some module/way that enables me to embed a responsive video.


texts: Webform Mail not arriving at gmail address

texts:
I'm having problems with the mailing of the Webform Module.

I have an online website where you can fill in a form. The results will be sent to the email-address the user gave in and the user of the site.

When the user fills in an email like myname@hotmail.com or myname@mycompany.com there are no problems. They receive the results perfectly. But when they use a gmail address like myname@gmail.com they DON'T receive the email. So it never works with a Gmail address.

The user of the site (who normally also receives the results) then gets an error like this:

  Subject: Undelivered Mail Returned to Sender

This is the mail system at host myhost.com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                 The mail system

  : host gmail-smtp-in.l.google.com[ip-adres]
    said: 550-5.7.1 [ip-adres      12] Our system has detected that this
    message is 550-5.7.1 likely unsolicited mail. To reduce the amount of spam
    sent to Gmail, 550-5.7.1 this message has been blocked. Please visit
    550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131
    for 550 5.7.1 more information. 44si1984154eef.10 - gsmtp (in reply to end
    of DATA command)

What could be the problem with this?


texts: Read and write files from external FTP server

texts:
I'm looking for a way to add (S)FTP support to my Drupal Commerce website.

It's rather simple. Once every night, a cron job should get all the files from the (S)FTP, process them and place other files back on the server. That's it :)

It's a store and all the products, customers and other data come from a different system. So the Feeds module should connect to the FTP and process the files.
But it looks like there is no decent FTP module around. I've looked into the Backup and Migrate, Storage API, Order FTP Export and Save to FTP, but nothing really met my requirements.

So is there an easy way to connect to an (S)FTP server and exchange files?


texts: How to limit the number of nodes created using the Feeds module?

texts:
I want to limit the number of node created by the Feeds module, it hsould be limited to 5 each time.

I've added $conf['feeds_process_limit'] = 5; to the bottom of sites/default/settings.php

I've also changed FEEDS_PROCESS_LIMIT value in plugins/FeedsProcessor.inc to be 5

But still Feeds trying to import more than 5.

Looks like I've missed something. Anybody any hints about it?


texts:
I use Context PHP module to write a simple condition:

$curr_uri = check_plain(request_uri());

if($curr_uri == '/mypath?123'){
   return TRUE;
}
else{
   return FALSE;
}

While this works perfectly for logged in users, it doe's not work for anonymous users. How this might be possible? Permissions are set ok.


texts: How to use drush locally with Acquia Dev Desktop2 and upgrade core

texts:
I just a new project in Drupal 8 and it's hosted on Acquias cloud using Dev Desktop 2 (DD later on).
Now the project is working fine, but i can't use drush at all, as the settings.php is generated by DD as is the code for the DB conneciton.

if (isset($_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR']) && file_exists($_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR'] . '/cld_my_site_default.inc')) {
  require $_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR'] . '/cld_my_site_default.inc';
}

I found a post here where the suggested method was to create a local.settings.php and in it paste the contents of the file cld_my_site_default.inc but that's a dead end as i can't access that file.

Anyone knows how do i setup drush so i can update the core, as per this tut.


texts: Decryption failed because the HMAC could not be validated - error on Migration d2d dashboard page

texts:
I'm trying to migrate Drupal 6 to Drupal 7 with Migrate d2d module. Problem is that I get 2 errors on Migrate dashboard page:

Decryption failed because the HMAC could not be validated.
Migration c9b87f5afFile could not be constructed.

And they are repeating many times. I can run migrate process, but custom defined field values are not migrated since I didn't map them. I can't access field mapping page because of this error.

Any idea how to resolve this?


texts:
I have Province/City taxonomy with 5000+ terms.

I would like to add lat/long field or something and bulk update whole taxonomy so i can use it later for maps and proximity search.


texts: Pages displaying blank ONLY when Theme Developer module turned on

texts:
i have a situation where the theme developer module, when turned on, is causing some pages to display as the white page (of death). it's probably because i've been doing tutorials, learning how to override theme functions and probably at one point had some errors. but there errors have been cleared up, but the pages display as blank pages ONLY when that module is turned on. it's as if it has it's own cache???,

anyone know how to remedy that?, i need module to work.


texts: Check anonymous access for menu items via menu_tree_all_data

texts:
I am attempting to manually generate a menu which combines several menus with menu_tree_all_data.  The problem I am having is that if the user is authenticated the first time the menu is built, the menu will be cached and anonymous users will see access denied when clicking some menu items.

Ideally I only want to include menu items which are accessible to the anonymous user in the generated menu.  I am thinking I need to do a check against the access_arguments to skip the menu items I don't want to include but I'm not sure what that would look like.  Here is the access arguments from a print_r of a menu item that should NOT be included in the generated menu:

[access_callback] => node_access
[access_arguments] => a:2:{i:0;s:4:"view";i:1;i:1;}

and here is one that should be included in the menu:

[access_callback] => user_access
[access_arguments] => a:1:{i:0;s:14:"access content";}

Am I on the right track with this or going about it all wrong?  Any help would be much appreciated.


texts: How do you modify modules/templates without waiting for the cache?

texts:
I'm a beginner at both php and drupal, I know some PHP, at least enough to modify templates and add/remove content from modules, but what irks me is that I always have to wait around 60 seconds for the changes to be visible.

Now I've heard about using the Admin Menu to flush all caches, I've tried every single module that claims to flush the cache, but I still have to wait 60 seconds for the changes to appear

I've also tried disabling the cache by modifying settings.php, to no avail.

As I've said, I'm a beginner at both php and drupal, is this a browser-side cache? or am I missing something?


texts:
In a Module list page (admin/modules) , We could see help, permission or configure links in Operations column. and also Module Filter customize it as a dropdown for each module listed.

Now I need to create a new link in that operations for every module installed. How should I do it?

I think I should go with hook_page_alter() but don't know how to start with since the $page array of admin/modules page is too long.


texts: All pages showing "Access Denied" if not logged in

texts:
I am on MAMP, able to login and try to figure things out. (First time developing in Drupal). I am using Drupal 7, with Project Kickstart distribution. https://drupal.org/project/project_kickstart

This is meant to be a public site in the end - any idea what I should be checking to see why anonymous user cannot view content? I checked node_access and there is an entry for GID 0. There is also a user 0.


texts: How do I get the index number of currently displayed slide of a Views Slideshow into the jQuery Cycle's "Before" advanced option?

texts:
According to this StackExchange Answer, you can access jQuery Cycle options like so:

//on before function
before: function (curr, next, opts) {
    alert(opts.nextSlide + " of " + opts.slideCount);
}

However, the instructions in the views plugin say, "If one of the options you add uses a function, example fxFn, then you need to only enter what goes inside the function call" so in the Advanced Options before box I only put:

alert(opts.nextSlide + " of " + opts.slideCount);

This code yields the error Uncaught ReferenceError: opts is not defined in the console.

How do I access these jQuery Cycle variables (mainly the index of the current slide) from within my "Before" advanced option code?


texts:
Iv managed to install Drush to the site on Go Daddy shared hosting(thanks to the greate tutorial!). Simple commands run without any errors, but when I try:

drush pm-update ctools

It returns:

    -bash-3.2$ drush pm-update ctools
The external command could not be executed due to an application error.                                                                                [error]
                                                                                [error]

Parse error:  syntax error, unexpected '{' in /home/content/XXX/XXX/drush/includes/environment.inc on line 518

, code: 255)
Update information last refreshed: Wed, 04/18/2012 - 06:11

Update status information on all installed and enabled Drupal projects:
 Name                                                   Installed version     Proposed version  Status
 Address Field (addressfield)                           7.x-1.0-beta2         7.x-1.0-beta2     Up to date
     Administration menu (admin_menu)                       7.x-3.0-rc1           7.x-3.0-rc1       Up to date

    ...

Security updates will be made to the following projects: Chaos tool suite (ctools) [ctools-7.x-1.x-dev]

Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue with the update process? (y/n):

The code of the line 518 in environment.inc

is

517      try {
518      $db = new PDO($constr, $creds['user'], $creds['pass']);
519      $db = null;
520     }

Drupal is 7.12, Drush 5.1

What can be the reason of this error?

Also
In hosting cotnrol panel site is on PHP 5.3
But php -v returns 5.2.17
is it ok?


texts:
First of all, let me apologize in advance as this may be a poorly worded question.  My knowledge of Drupal is limited so I'm not even sure of the exact area where my problem is.  I'm looking for pointers in the right direction so I can do more research on my own for an answer.

The Original Situation

I have two domains - let's call them example.com and example.net.  The site was originally built for example.net and it is hosted at BlueHost with the following folder structure:

/root
    /public_html
        /drupal
            ... standard Drupal folders
            /sites
                /all (this is where all my site files are)

So basically, the entire Drupal installation is in a subdirectory of public_html. I can access URL's such as http://example.net/contact with no problem.  So far, so good.

The Wrinkle

Where it starts to get complicated is when we bought example.com.  As the primary domain, it points towards /root/public_html.  So, I dusted off my Apache skills and fashioned an .htaccess file to redirect .com to .net, like so:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteCond %{REQUEST_URI} !^/drupal/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /rings/$1
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(/)?$ drupal/index.php [L]

The Problem

Now, if I go to http://example.com/contact, it does come up with a Drupal page, so I know that the rewrite rules are working.  However, I get a page that says that The requested page "/contact" could not be found.

I want users to be able to use either domain.  That is, http://example.com/contact and http://example.net/contact should go to the same page.  So this is where I'm stuck.  I'm not even sure where the general area of the problem is.  Do I need to set up a multi-site configuration?  That doesn't sound right because I'm only running one site.  Is it something to do with the domain access module?  That sounds more like something to run multiple sites of one Drupal installation.  Any pointers at all will be greatly appreciated.  Thanks in advance!


texts:
I am currently programmatically constructing a form. For that, I used the hook_form() . My form is displayed and all its functionality are good.

The problem is that it is not displayed inside the div container as it normally should be. Anyone knows how to define, maybe as an attribute, the form in this tag?


texts: What module might make all my links redirect the current window with target="_blank"?

texts: I'm at a loss. None of my own JS is doing it. When I set a link to target="_blank" it opens a new window to that location, but also redirects the original window. Does anyone have a clue what module may be involved?


texts: Drupal 7 open image in colorbox when a “button” on the image is clicked, otherwise go to content

texts:
I am using Drupal 7 and Colorbox module with Views 3.

In my view I have an image field. Right now based on my settings when I click the image it can either go to the content or open the image itself in Colorbox. What I want to achieve is maybe have a button (or a link?) at the bottom right corner of the image, when this button is clicked, image opens in Colorbox, if image itself is clicked, it brings you to the content (node page).

How can I achieve this?


texts: Trying to render an array of items with the drupal_add_html_head function

texts:
I have a preprocess_html function that gets an array of google fonts and adds them as an html class. I have it partially working but if say I have three fonts, only the last one gets into <html class=""> element. Here is what I have so far:

if ($families) {
   foreach ($families as $fontString) {
   $fontclass = preg_replace('/[^\d\w]+/', '-', strtolower($fontString));

   $element = array(
     '#tag' => 'html',
     '#attributes' => array(
     'class' => $fontclass,
    ),
   );
   drupal_add_html_head($element, 'google_fonts');
  }
}

In the example above, I have these fonts in my site:

Montserrat
Actor
Pathway Gothic One

... but only the last one renders in my html class as:

<html class="pathway-gothic-one-regular">

If I do a dsm within my function:

dsm(drupal_get_html_head());

I see all three fonts print out in separate boxes as

<html class="actor-regular" />
<html class="montserrat-regular" />
<html class="pathway-gothic-one-regular" />

so I think I am not getting something right here.

Note, if I change my code to a body class array, it works as expected. e.g.

   if ($families) {
          foreach ($families as $fontString) {
            $vars['classes_array'][] = preg_replace('/[^\d\w]+/', '-', strtolower($fontString));
          }
        }

yields:

<body class="actor-regular montserrat-regular pathway-gothic-one-regular">

From a build standpoint, I'd like to keep these classes one level higher than body so that's why I'd like them to be in <html class="">.


texts: Is there a way to set the styling for the "choose file" button for Webform module?

texts:
I've not been able to figure out how to isolate the "choose file" button that's set in file upload field for webform module. I can style the field, but I can't get the button. I've looked all of the place, but can't find anything on getting anything on that specific button. This is a D7 site using the 7.x-3.18 version of webform.

It would be great if I could add a class, but if I could just get ahold of it in some way that doesn't affect the entire field that would be ideal.

Here is the output:

<input type="file" id="edit-submitted-resume-upload" name="files[submitted_resume]" size="22" class="form-file">

The ID handles the entire field and I've been able to do a little with that, but can't use it to control that button.

Any ideas?

Thanks in advance.


texts: Apply a discount rule when calculating cart total?

texts:
I would like to apply a discount on cart items at check-out. The discount will be based on quantity of particular product type.

What event can I use to calculate a discount during checkout?

Here is the export of my current rule:

{ "rules_group_subscription_discount_4_15_" : {
    "LABEL" : "Group subscription discount (4-15)",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "commerce_order", "rules", "commerce_line_item", "commerce_checkout" ],
    "ON" : { "commerce_checkout_complete" : [] },
    "IF" : [
      { "commerce_order_contains_product_type" : {
          "commerce_order" : [ "commerce_order" ],
          "product_type" : { "value" : { "subscription" : "subscription" } },
          "operator" : "\u003E=",
          "value" : "4"
        }
      },
      { "commerce_order_contains_product_type" : {
          "commerce_order" : [ "commerce_order" ],
          "product_type" : { "value" : { "subscription" : "subscription" } },
          "operator" : "\u003C=",
          "value" : "15"
        }
      }
    ],
    "DO" : [
      { "variable_add" : {
          "USING" : { "type" : "decimal", "value" : "0.10" },
          "PROVIDE" : { "variable_added" : { "discount_percentage" : "Discount percentage" } }
        }
      },
      { "LOOP" : {
          "USING" : { "list" : [ "commerce-order:commerce-line-items" ] },
          "ITEM" : { "line_item" : "Current line item" },
          "DO" : [
            { "component_rules_calculate_group_subscription_discount" : {
                "USING" : {
                  "line_item" : [ "line_item" ],
                  "percentage_discount" : [ "discount-percentage" ]
                },
                "PROVIDE" : { "discounted_subscription_cost" : { "discounted_subscription_cost" : "Discounted subscription cost" } }
              }
            },
            { "commerce_line_item_unit_price_subtract" : {
                "commerce_line_item" : [ "line-item" ],
                "amount" : [ "discounted-subscription-cost" ],
                "component_name" : "discount",
                "round_mode" : "1"
              }
            }
          ]
        }
      }
    ]
  }
}


texts: Theming User Profile Edit Form not Rendering results.... Help?

texts:
I am not rendering any results. This is my template.php:

function fueldeluxe_theme($existing, $type, $theme, $path) {
    /**
    *  Account edit Forms
    */
    $items = array();
    $items['user_profile_form'] = array(
        'render element' => 'form',
        'template' => 'user-profile-form',
        'path' => drupal_get_path('theme', 'fueldeluxe') . '/templates'
    );
    return $items;
}

function fueldeluxe_preprocess_user_profile_form(&$variables) {
    $variables['account'] = drupal_render($variables['form']['account']);
    $variables['picture'] = drupal_render($variables['form']['picture']);
}

This is my user-profile-form.tpl.php:

        <?php echo $picture; ?>

        <?php echo $account; ?>

As you can see I'm trying to load the user profile field forms. However I'm not able to render any results. The page loads okay when I add dummy text but no account field forms.


texts: Programmatically execute an action set (Rules module)

texts:
I want to use Rules UI to define some action sets, but want to execute those actions programmatically from a custom module.

How to I execute the action by code and pass the needed arguments (just a node in this case).

Thanks!


texts: Alter validation when using inline entity form

texts:
Is it possible to alter the validation function when using inline_entity_form ?

Here is an example module that I'm using where I use devel to validate if I can hook into drupals and IEF validate functions (as pointed out by Shawn Conn).

function mymodule_inline_entity_form_entity_form_alter(&$entity_form, &$form_state)
{
  $entity_form['#element_validate'] = array('mymodule_inline_entity_form_entity_form_validate');
}

function mymodule_inline_entity_form_entity_form_validate(&$entity_form, &$form_state)
{
  // No effect
  form_set_error('field_price', '!Validate');
  form_set_error('field_bucket_list', '!Validate');
}

I have one content type which has a title and a decimal field called field_price and a second type which has the IEF field (called field_bucket_list).


texts: Relationship between node and taxonomy term using migrate_d2d_ui

texts:
I used Migrate 7.x-2.6-rc1+30-dev and Migrate_d2d_ui 7.x-2.1-beta1 module to upgrade my "Drupal 6" website to D7, everything went fine but the node-to-taxonomy relation seems to have got lost. How to relink the relation in the imported data ?

Below is the snapshot from setting form:

This didn't work for me: https://drupal.org/node/2063203


texts: Undefined variable error in node.tpl.php

texts:
I'm having an issue with an undefined variable

  Notice: Undefined variable: comment_count in include() (line 33 of ...\themes\simplecorp\node.tpl.php).

This is what my line 33 looks like:

<?php print $comment_count; ?>

I don't understand this error, Can someone tell me how to do it?


texts: How can I write a query to get a list of users who have registered in the last 24 hours?

texts:
I'm trying to use PHP to generate a query that fetches the number of users who have registered in the last 24 hours.

Based on the code for the "who's online" block:

$authenticated_count = db_query("SELECT COUNT(DISTINCT s.uid) FROM {sessions} s WHERE s.timestamp >= :timestamp AND s.uid > 0", array(':timestamp' => $interval))->fetchField();

I modified it as follows (based on this old D6 Stackoverflow answer:

$users_registered = db_query("SELECT COUNT(DISTINCT u.uid) FROM {users} u WHERE u.created >= :timestamp AND u.uid > 0", array(':timestamp' => ($_SERVER['REQUEST_TIME'] - 86400)));

However, this results in an error:

  Notice: Object of class DatabaseStatementBase could not be converted
  to int in format_plural() (line 1801 of
  /var/www/om/includes/common.inc).

I'm not great with SQL, so a brief explanation of where I'm going wrong would be much appreciated.


texts:
Webform can't show the form.

The form is showing correctly until today I just found out the form can't display.

It shows me the message "You may not submit another entry at this time."

How do I solve it?

Drupal 6

I made the changes for Total submissions limit: Unlimited, but still same problem.

After made the changes, error message below shown:

  user warning: Unknown column 'total_submit_limit' in 'field list'
  query: UPDATE webform SET nid = 110, confirmation = '',
  confirmation_format = 3, redirect_url = '', status = 1,
  block = 0, teaser = 0, allow_draft = 0, auto_save = 0, submit_notice =
  1, submit_text = '', submit_limit = -1, submit_interval = -1,
  total_submit_limit = 10, total_submit_interval = 3600 WHERE nid = 110
  in /home/domains/site.com/public_html/includes/common.inc on line
  3538.


texts: Simple test always failing for custom module

texts:
I am trying to implement simple test for my custom module. But the test case always failing for user login. In the test script what I am trying to test is whether admin page is loading properly without any errors.

I am following similar code from core modules and other contributed modules. But couldn't figureout what I am missig in mine. My test script is given below:

<?php

/**
 * @file
 * Test file for custom_module module.
 */

/**
 * Default test case for the custom_module module.
 *
 * @ingroup custom_module
 */
class MyCustomModule extends DrupalWebTestCase {

  /**
   * {@inheritdoc}
   */
  public static function getInfo() {
    return array(
      'name' => 'My Custom Module Test Case',
      'description' => 'Functional test for My Custom Module Module',
      'group' => 'My Custom Module',
    );
  }

  /**
   * {@inheritdoc}
   */
  function setUp() {
    parent::setUp('custom_module');

    $permissions = array(
      'access administration pages',
      'administer custom module',
    );
    $this->admin_user = $this->drupalCreateUser($permissions);
    $this->drupalLogin($this->admin_user);
  }

  /**
   * Test site working properly after installs the module.
   */
  function testCustomModulePageLoads() {
    $paths = array(
      '/admin/config/custom_module/manage',
    );
    foreach($paths as $path) {
      $this->drupalGet($path);
      $this->assertResponse(200, '200 response for the path ' . $path);
    }
  }

}

Result:


texts: How can I retrieve a user name and password?

texts:
Someone installed the drupal 8 site and did not share the password. I do not know what email he has used to install the site either.
I do not have the password.
In phpmyadmin, I clicked the database name. I ran the sql

UPDATE users SET pass = MD5( 'NewPassword' ) WHERE uid = 1;
Select * from users.

  1146 - Table 'xxx.users' doesn't exist

How can I retrieve the drupal 8 website password?


texts: Unmet dependencies installing with Features with fields, paragraphs, blocks and content types

texts:
I have defined several content types, paragraphs, and views for these content types and the idea was to define different features to export and import these content types. I had defined different features for each content type but when I tried to install on a site the Core feature there were a lot of dependencies unmet.

Although is not ideal, I tried to export everything in just one feature, but when I installed it again more dependencies were met. For blocks, fields and paragraphs. Trying to find out what the problem was I opened one of the yml files: field.field.node.producto.body.yml and one of the dependencies is - node.type.producto and this is a content type that doesn't exist but in theory is included in the feature.

This is the message that appears when I try to install the feature:

Incapaz de instalar All, block.block.lemonadmin_views_block__servicios_block_servicios, block.block.views_block__servicios_block_servicios, block.block.web_views_block__servicios_block_servicios, core.base_field_override.node.producto.promote, core.base_field_override.node.producto.title, core.entity_form_display.node.producto.default, core.entity_view_display.node.article.teaser_2, core.entity_view_display.node.producto.default, core.entity_view_display.node.producto.teaser, core.entity_view_display.node.proyecto.teaser, core.entity_view_display.node.team.default, core.entity_view_display.node.team.teaser, core.entity_view_display.node.team.teaser_2, core.entity_view_display.paragraph.card.default, core.entity_view_display.paragraph.foto.default, core.entity_view_display.paragraph.photo_banner.default, core.entity_view_display.paragraph.texto_con_foto.default, field.field.node.producto.body, field.field.node.producto.field_content_en_bloques_product, field.field.node.producto.field_texto_thumbnail, field.field.node.producto.field_thumbnail_producto, field.field.node.producto.field_tipo_de_producto, field.field.paragraph.foto.field_formato_imagen, field.field.paragraph.texto_con_foto.field_formato_imagen, language.content_settings.node.producto tiene dependencias no encontradas.

With Drupal 7 it was really easy to import Features, what steps should I follow to achieve what I want? I'm getting mad with this issue.


texts:
I secured some file in an s3 bucket using s3fs.
My problem is : the "Expires" argument send to build the file URI is not reset each time the object is call in my API.
time doesn't change if I don't clear the cache with drush
$expires = time() + 10;

So I tried to use hook_entity_view :
if ($entity->bundle() === 'my_bundle') {
    foreach ($entity->getCacheTags() as $tag) {
      $tags[] = $tag;
    }
  }

Doesn't work
Drupal::entityTypeManager()->getStorage($entityType)->resetCache();

Nop
\Drupal::service('cache.render')->deleteAll();
\Drupal::service('cache.entity')->deleteAll();
\Drupal::service('cache.data')->deleteAll();

deleteAll or invalidateAll, none of it work.
drupal_flush_all_caches();

Nothing, I'm starting to think I have config problem...
If someone can save me !
UPDATE
It seems hook_entity_load works with my API, it clear the cache correctly.
The problem remains when i'm trying to watch the content in my Drupal website, in the content view.


texts: Change input method of "Description field" in "File" type

texts: I have added a "File" field in a Content type. Now I can mark the option " Enable Description field". This "Description field" only let use direct input. I need to change this to a select field. I'm not expert in hooks use. I'd like to set it as a dropdown or autocomplete. Which is the best option? create a taxonomy list or a hand made term list? I have to use only in one content type. Thanks


texts: How to override some admin theme CSS rules?

texts: Is there a way to override just some CSS rules used by the admin theme, without touching the admin theme itself (via some theme functions or module hooks)? For example, I'd like to add a text-align: right to every integer field in admin forms (and in edit nodes too).


texts: Update multiple rows (with different ids and different values) using one query

texts:
I want to update multiple rows in a custom table using just one query.

Each row has its own id (obviously) and different fields/values to update.

Given this question and this post, i think i can achieve it with a single db_query, similar to this one:

UPDATE {table} SET

`field1` = CASE `id`
    WHEN 1 THEN 'field1 value 1'
    WHEN 2 THEN 'field1 value 2'
    END

`field2` = CASE `id`
    WHEN 1 THEN 'field2 value 1'
    WHEN 2 THEN 'field2 value 2'
    END

WHERE `id` IN(1, 2);

Or:

INSERT INTO {table} (`id`, `field1`, `field2`)
VALUES
    (1, 'field1 value 1', 'field2 value 1'),
    (2, 'field1 value 2', 'field2 value 2'),
ON DUPLICATE KEY UPDATE
    `id` = VALUES(`id`),
    `field1` = VALUES(`field1`),
    `field2` = VALUES(`field2`);

But i'ld feel more confortable using db_update instead of db_query.

Any suggestions? Thanks


texts:
I'm searching for a way to get all localized paths for one path.

For non-content pages this is quite simple:

foreach (language_list() as $language)
  $paths[$language->language] = url(current_path(), array('language' => $language));
}

For content pages (node, taxonomy, …) the path might be completely different and things like translation_path_get_translations() seem more like what I need.

Is there a reliable way to get paths to all translations of a page that works whether it's a content-page or not? It feels like there has to be an API-function for that.


texts: How can I only show the first image of an image field in the teaser?

texts:
I have a content type with an image field that can contain an unlimited number of images. The field is used to display an image gallery in the full node view, but I also want to use the first image of the field in the teaser.

I vaguely remember doing something like this years ago in Drupal 6, but now I can't find any option to do this in Drupal 8. I'm not sure if I'm misremembering, or just looking in the wrong place.

How can I display only the first image of an image field in the teaser?


texts: I am new to Drupal 8, been developing only with D7 until now and I have a question regarding menus. I need to create this basic main menu for the page, but I am not sure how to export it and send to the test site, later to production environment. What is the best way to export something like this without features? I've heard something about hook_install() functions in the profile that allow this, but I cannot really find any information about this. Can someone please provide me with some guidance? Thank you in advance.


texts: Display parent term based on child term in views

texts:
I have a vocabulary with the following structure:

Vocabulary
Parent term 1
    Child term 1.1
        Child term 1.1.1
    Child term 1.2
        Child term 1.2.1
Parent term 2
    Child term 2.1
        Child term 2.1.1
    Child term 2.2
        Child term 2.2.1

Based on the above structure of taxonomy terms, I have a view of all the terms of last level like,

Child term 1.1.1
Child term 1.2.1
Child term 2.1.1
Child term 2.2.1

Now, i want to create the view, which list me 2nd level of taxonomy term by passing term id of the 3rd level.

  Example:- If i pass term id of Child term 2.2.1 in contextual filter, i should see the Child term 2.1 as a result of view.


texts: can someone help me on how to remove or manually edit the post dates displayed on my drupal feeds? No I am not using views to create it.


texts: How do you change the order of uploaded videos?

texts:
How can we change this page so new content added goes to the top, not the bottom?

http://www.liveops.com/resources/videos

When it's added to this page, it goes to the top:
http://www.liveops.com/resources


texts: Drupal 7: When using the Features module and the database (e.g content type) is different than the matching Features component (e.g the same content type) what is used when viewing this component within the Drupal webapp?


texts: How to add class to embedded Paragraphs field-items?

texts:
I have a Paragraph field embedded on a node type. The Paragraph field type allows for many different Paragraph Bundles to be inserted into the node.

My mark up currently displays as (Drupal 7 zen Theme):

<div class="paragraphs-items paragraphs-items-field-paragraphs paragraphs-items-field-paragraphs-full paragraphs-items-full">

How can I add a class after each field-paragraphs? I would want to do this so that each Bundle has it's own class.

I've tried the following in my themes template file but it adds a class around the entire field and not on each Bundle:

    function mytheme_preprocess_paragraphs_items(&$vars, $hook) {

  // This will remove all the current classes
  $vars['classes_array'] = "";

  // You can now add the classes you want in this array
  $vars['classes_array'][] = "myclass";
}


texts: "Can't create table errno: -1" when trying to create the cache_rules table on D7

texts:
I'm having a very strange problem.  I have a website on Pantheon (Nginx) that I attempting to import into my local dev environment, but when I import, it is failing when it gets to the cache_rules table.  So I dropped the cache_rules table on the server DB, dumped the DB, and imported it, and then tried to re-create the cache_rules table with the following command:

CREATE TABLE IF NOT EXISTS `cache_rules` (
  `cid` varchar(255) NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache ID.',
  `data` longblob COMMENT 'A collection of data to cache.',
  `expire` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.',
  `created` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry was created.',
  `serialized` smallint(6) NOT NULL DEFAULT '0' COMMENT 'A flag to indicate whether content is serialized (1) or not (0).',
  PRIMARY KEY (`cid`),
  KEY `expire` (`expire`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Cache table for the rules engine to store configured items.';

which I found here.  I am running the command in phpMyAdmin.

However, when I do that, I get this error message:

"Can't create table errno: -1"

I've attempted to search for this but the explanations suggested that it was usually caused by trying to create a table that had a key that depended on another table that hadn't been created yet, but that is not the case here.

I can run the exact same command above with a different table name (e.g., cache_rules2) and a cache_rules2 table will be created without a problem-- so it's only the specific name cache_rules that is causing this issue, whatever it is.

How can I further debug this to figure out why it suddenly doesn't want to create a cache_rules table?


texts: Which .tpl file should I use to theme the quiz module's detail page?

texts:
I am using the Quiz module for a requirement.

I want to theme the quiz detail page, multiple choice questions page and the Jquery timer which I am using with that page.

Which .tpl files should I edit for this?


texts: Highlighting primary link for specific content types

texts:
If I have a navigation item called 'News' in my primary links, how would I go about highlighting it for all news content type nodes?

Thanks!


texts: Preventing a field from rendering on a page

texts:
How would I prevent field_home_slider from rendering when $page['content'] is loaded? I only want it to load when I call it separately. I also still want the page content to be displayed just do not include the field_home_slider

Display image by itself

  if(isset($node->field_home_slider)){
     $field = field_get_items('node', $node, 'field_home_slider');
     $bannerImage = field_view_value('node', $node, 'field_home_slider', $field[0]);
     print render($bannerImage);
  }

and below to display content on the page

print render($page['content']);


texts:
When I'm at this page "admin/config/people/accounts" I can't change anything of the settings. So I uncheck a checkbox or typ another value in an input. When I click the save button, the page reloads but the settings go back to the values before.

Anyone who knows the problem? Other pages does save my settings, it only appears on the "admin/config/people/accounts".

I use Drupal 8.

Thanks!


texts:
I have a non-ajax form for which I'm trying to execute a jQuery function after the form has been submitted and processed.

I don't need ajax for the form, but I do need to wait until 600 odd form fields have been processed before executing my jQuery function.

There are a lot of answers out there, but I can't quite figure them out.

Should I do this via ajax (even though not required for the form) or is there a better way to do it?

Given the form takes a good few seconds (10 or so) to process (more on mobile, etc.) how should I go about it?

EDIT:

Another go at explaining exactly what I'm trying to do.

I have a form that collects 600+ pieces of data
After the form has been submitted and processed, I need to open a new window that processes the data, displaying it graphically (via canvas) and then saves that canvas as an image to the user profile.

Because there is so much data that needs to be processed, I've elected to run everything in a new window, so if the user navigates away from the main window, their canvas is drawn and saved, etc. in the background.

It appears that jQuery is the only way to open this new window, and I have to execute this after the form submission (otherwise the canvas is drawn with pre-submitted data)

Of course, there could be a better end to end way to do it, but jQuery post form submit seems to be it.


texts:
I have been learning drush and I loving it. i am having a tough time understanding how to backup and restore my site. Often I bork my site and just need to quickly restore it. These are the steps I am following and I am met with the following error:

Destination directory /Users/Nigel/Sites/sitename/ already exists.      [error]

Unable to restore files to /Users/Nigel/Sites/sitename/

cd to my Drupal installation.
Create a Drush archive dump (code and db in one)

drush ard
Grab my backup (e.g. sitename.20130221_055426.tar.gz) and place it
back into the root of my Drupal installation

drush arr sitename.20130221_055426.tar.gz

There is a similar question How do I use Drush correctly to restore a site via the arr command? , however the issue and thus the answer has to do with different db credentials, rather than the steps to restore a site.

I am obviously doing something completely wrong here. Any help would be appreciated.


texts:
How to set programmatically multiple arguments for views contextual filters?

I can do it with one argument, it works great, but not with multiple arguments.

I want to select all nodes created by a list of people, but views only takes first in array into consideration:

$array = array(3250,32);
$view = views_get_view('myview');
$view->set_display("myblock");
$view->set_arguments($array);
$view->pre_execute();
$view->execute();
$content = $view->render();

Am I doing something wrong?


texts: HybridAuth Social Login returns from social network to Page Not Found

texts:
I installed HybridAuth Social Login module on Drupal 7, and tested it with Facebook, Twitter, Google+ and LinkedIn. Clicking any of these four icons in the Log in form of my site functions to the extent that a new page opens, which shows my username, profile photo and/or other basic information from the social network in question, and asks me to give permission for my Drupal website to access my social network account information.

When I click Agree, I return to a half-filled registration form at my Drupal website. Typically the email address is missing. When I complete the form and click Create account, my browser says Page Not Found, and this kind of a link is shown in address bar:

http://my.website.com/hybridauth/window/[SocialNetwork]?destination=node&destination_error=node

... where [SocialNetwork] is Facebook, Twitter, LinkedIn, or Google.

Looks like I am nearly ready with the setup, but something is yet misconfigured.

When installing the module, I have followed the instructions on this page, to the extent that I understood it:

https://www.drupal.org/project/hybridauth

Take the first instructed step:

"Download HybridAuth library (link), and unpack it into 'sites/all/libraries/hybridauth' folder"

As I open the offered zip package, I find a root folder which contains README.md and other stuff, and subfolders additional-providers and hybridauth. I choose to copy the contents of the zip subfolder hybridauth into server folder '/var/www/html/sites/all/libraries/hybridauth'. A vague interpretation of vague instructions. Then I installed Chaos Tool Suite and the HybridAuth module.

Then I connected the module with my Facebook, Twitter, Google+ and LinkedIn developer accounts. And then happened what I describe at start of this post.


texts:
I want to achieve the following :
I have a node 'proposal' with a flag 'accept' and another node 'project'.
I want when a user flag the 'proposal' with the 'accept' flag, a field value in the 'project' node is updated.
I wrote this code but it seems not to work

function mymodule_flag_flag($flag, $entity_id, $account, $flagging)
{

$node =  node_load($entity_id);
$freelancer = $node-> uid;
$project_node = node_load($node->field_projet['und'][0]['target_id']);
$wrapper = entity_metadate_wrapper('node', $project_node);
$wrapper->field_freelancer->value = $freelancer;
}


texts: How do I make an ajax callback in Field Plugin formElement() reload form?

texts:
I've created a custom field as a module Plugin and have the following code in the formElement() method of the field's Widget.php.  The intention is to populate options in the second select element based on the value chosen in the first element:

$element += array(
  'sheet_name' => [
    '#title' => 'Sheet',
    '#description' => 'Select the sheet',
    '#type' => 'select',
    '#options' => $options,
    '#required' => TRUE,
    '#element_validate' => [
      [$this, 'validate'],
    ],
    '#ajax' => [
      'event' => 'change',
      'callback' => [$this, 'getPositions'],
      'progress' => [
        'type' => 'throbber',
        'message' => 'Getting positions.',
        'method' => 'replace',
      ],
    ],
  ],
  'position' => [
    '#type' => 'select',
    '#options' =>['Select'],
    '#title' => 'Position',
    '#description' => 'Position',
    '#prefix' => '
',
    '#suffix' => '
',
  ],
);
return array('value' => $element);

My callback is as follows:

$options = ['Select' => 'Select'];
foreach ($positions as $position) {
  $options[$position['position']] = ucfirst($position['position']);
}

$sheet_position = [
  '#type' => 'select',
  '#options' => $options,
  '#title' => 'Position',
  '#required' => TRUE,
  '#description' => 'Position',
];

$response = new AjaxResponse();
$response->addCommand(new HtmlCommand('#position-select', $sheet_position));
$form_state->setRebuild(TRUE);
return $response;

This puts the option values I want into the second select element, but the form isn't being rebuilt, even with the call to $form_state->setRebuild(), so my updated select element isn't being associated with a form field.  I'd love to understand why, but I'll settle for any way to force the form to rebuild after the callback runs.

Update:  I have tried $form['position'] instead of $sheet_position in my callback but no joy there, either.


texts: SQL left join query using Drupal DB Layer

texts:
The following (my)?sql query performs a left joins of node table with url_alias table by matching a node with its url alias, and returns rows with the node's title, date created, type, and url-alias:

SELECT n.title, n.created, n.type, ua.alias
FROM node AS n LEFT JOIN url_alias AS ua
ON ua.source = CONCAT('node/', n.nid);

I would like to use the drupal DB Interface to accomplish the same thing. Ideally, I would like to write:

$query = db_select( 'node', 'n' )
  ->fields( 'n', Array('created', 'title', 'type' );
$query->leftJoin( 'url_alias', 'ua', 'ua.source = CONCAT("node/", n.nid)');
$query->addField('ua', 'alias');
$results = $query->execute();

which fails with a PDO exception: "node/" is not a valid column (which is true, but I didn't mean it to be a column, hence the CONCAT):

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node/' in 'on clause': SELECT n.title AS title, n.type AS type, n.created AS created, ua.alias AS alias FROM {node} n LEFT OUTER JOIN {url_alias} ua ON ua.source = CONCAT("node/", n.nid); Array ( ) in _long_and_obscure_named_function() (line 680192318389 of narp.module (it's a large file; I went nuts).)

Rather than feeding the left join query raw into a db_query, is there some way that I can implement the query with db_select and ::leftJoin, etc?

Any help would be much appreciated. (I should add that I am running Drupal 7.x).


texts:
The webform status report states several libraries are needed.
After downloading the zip file.. and extracting it.  Where does '/libraries/' directory belong? ie: /modules/webform/libraries  Or ???


texts: How to declare several templates for a Views row plugin

texts:
I want to create a custom Views display type called Card using Fields for the rows.
In my module I define the relevant plugins using hook_views_plugins as such:
function cards_format_views_plugins()
    {
      $path = drupal_get_path('module', 'cards_format');
      $plugins = array(
        'style' => array(
          'cards_format_style' => array(
            //  THEME
            'theme' => 'cards_format',
            'theme path' => $path . '/theme',
            //  HANDLER
            'handler' => 'cards_format_views_plugin_style_cards_format_style',
            'path' => $path . '/views/plugins',
            //  UI
            'title' => t('Cards'),
            'machine_name' => 'cards',
            'help' => t('Displays result in Cards using Material CSS'),
            //  OPTIONS
            'uses row plugin' => TRUE,
            'uses row class' => TRUE,
            'uses grouping' => TRUE,
            'uses options' => TRUE,
            'type' => 'normal',
          )
        ),
        'row' => array(
          'cards_format_fields' => array(
            //  THEME
            'theme' => 'cards_fields',
            'theme path' => $path . '/theme',
            //  HANDLER
            'handler' => 'cards_format_views_plugin_row_cards_format_row_style',
            'path' => $path . '/views/plugins',
            //  UI
            'machine_name' => 'cards_fields',
            'title' => t('Card Fields'),
            'help' => t('Displays fields in Cards using Material CSS'),
            // OPTIONS
            'uses fields' => TRUE,
            'uses options' => TRUE,
            'type' => 'normal',
          )
        )
      );
      return $plugins;
    }

I have created the relevant templates in my /theme folder : cards-fields.tpl.php and cards-format.tpl.php This works.
Now I want to handle two different cases with two different templates instead of the current cards-fields.tpl.php. When the card has an image I want cards-fields--image.tpl.php to be called and when it does not, cards-fields--no-image.tpl.php should be called.
So, I have declared a preprocessor tied to the theme function for fields cards_fields, which declares theme suggestion depending on the result, like so:
function template_preprocess_cards_fields(&$variables)
{

  $fields[$label] =
  $variables['view']->render_field($label, $variables['view']->row_index);

  $image = $fields['field_basic_image'];
  if($image){
   $variables['theme_hook_suggestions'][] = 'cards__image_fields';
  }
  else {
   $variables['theme_hook_suggestions'][] = 'cards__no_image_fields';
  }
}

I am stuck there, none of the templates corresponding to the theme suggestions are picked up, only the cards_fields.tpl.php one.
I assumed that preprocess functions could help declare custom templates regardless of whether there is a theme function declared in the plugin, but maybe I am missing something.


texts: How to exclude specific css file from aggregation

texts:
Is it possible to exclude a specific css or js from drupal'l css and js aggregation ?

For ex: Exclude custom-style.css from being aggragated ?


texts:
So i wanted to install Drupal on my local mac. I download drupal 7.12 put its content into my htdocs (i'm running MAMP) goto localhost got through all the steps and his save and it took me to "http://localhost/install.php?profile=standard&locale=en" where i get this message

then if i goto localhost i get this

I can't seem to figure out what went wrong Could some one point me in the right direction ?


texts: Get locations search: Show all markers by default

texts:
I played around with the get locations module for drupal escpecially with the get locations search part.

Finally I got the thing working but I'm wondering now if it's possible to display by default all markers on the map and not only the result markers after a search.

A blank map till I searched something is very confusing to the user.

Thx for any advice in advance.

EDIT

Okay I try to write a patch on my own. My research is based on version 7.x-1.10 The essential part ist to load the lat/longs of the location nodes and also the min- / maxes into the array in getlocations_search.module line 290:291 which is

$minmaxes = '';
$latlons = array();

For the "normal" map they are loaded in the function getlocations_nids() on line 828 in the file getlocations.module.


texts: Set default/restrict text formats based on node type

texts:
In Drupal 8 (not D7) as noted here How do you limit a text input to only specific content types/fields.

For example, I create a new input type here: admin/config/content/formats
and call it "blog_body" and I want it to be the only (or at least default) option for the body field on blog post node type. Preferably it is not available on other nodes too.


texts: How to change a user to a different role based on the number of their posts?

texts:
Are there any techniques out there that can put a user in a specific role into a different role automatically after they make X number of posts (core forum topics or/and replies)?

I'd like to implement a functionality where when users first register to my site they get put into a role which has limited privileges, but after certain number of posts to the forum (new topic or replies to existing) they get put into a different role that doesn't require CAPTCHA and they can post links etc. FYI using the core Forum and the Advanced Forum module.


texts: I have three content types that have a text field called PID.  How do I tell views there is a relationship between these content types?


texts: How to add a new element in drupal 7 feed view

texts: I have created a simple feed with drupal 7 views and i want to add some more elements. currently it supports title, description, link, creator and pubdate. I DON'T want to use any other module.


texts: Edit with Full HTML on block changes closing div bracket to its character entity references

texts:
I'm facing issues in writing full html codes in custom block using CKEditor. Even though I select Full HTML mode and toggle to 'source' while writing html content to block, some characters like angular bracket of div tags are automatically changes to its character entity references (&lt or &gt).

Additionally some unwanted characters are inserted to the html content (characters like = or ").

So how can I write chunks of pure html codes to blocks hassle free

PS: I'm using Drupal 8 with core CKEditor


texts: The service "redirect.request subscriber" has a dependency on a non-existent service "path.alias_manager"

texts:
While upgrading D8.9 to D9.1 got the below issue. Tired all solution nothing works. Because on this issue site is down and unable to process anything.

[php7:notice] [pid 26850] Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The service "redirect.request_subscriber" has a dependency on a non-existent service "path.alias_manager". in /var/www/xxxx/xxxx/xxxx/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php on line 86

Could anyone faced this issue or how to overcome?


texts: Views sorting by number of values in field

texts:
I have a content type with an text field with unlimited number of values.

I have a view for that content type and I want to sort it by number of values in that field.

How can I do that in Views?


texts: Drupal 7 - Add Custom entity to a field collection

texts:
I have a custom built using Entity API which is fieldable which is working fine till now.

Now I have added a field collection using field UI, but as per project requirement we need the fields inside the field collection to come from a custom entity.

Is there any way of doing this?

Currently in the entity_info I have declared the entity as

$info['en_projects_details'] = array(
'label' => t('Project Details'),
'base table' => 'en_projects_details',
'entity keys' => array(
  'id' => 'id',
  'label' => 'name',
),
'module' => 'entity_test',
'entity class' => 'ProjectDetailsEntity',
'controller class' => 'ProjectEntityController',
'access callback' => 'entity_test_access_callback',
'uri callback' => 'entity_class_uri',
'fieldable' => FALSE,
'bundles' => array(
  'field_projects_details' => array( //field collection machine name.
    'label' => t('Projects Details  '),
  ),
),

I have also created a basic form to be shown as fields in the field collection. But nothing shows up.


texts: Webform entity checkboxes not ordered as per source view

texts:
We are using the Webform module ( https://www.drupal.org/project/webform ) for an extended 'Contact us' type of form which allows people to select various options about a vacation they wish to take.

In this form the person is able to select a region globally and then are presented with a set of destinations falling within that region which are Entity Check-boxes which get thier values from a single view that combines data (The titles) of two content types (Destination and SubRegion)

Destination has about 15 results and SubRegion has only one (which is India).

Now when I view the view in preview mode the ordering is correct, India is listed between China and Indonesia.

When I view the output of the web form itself India is listed last and I am completely lost as to what is causing this.

I have tried rearranging the ordering of filters in the view etc to no avail, anyway I don't think the view is the issue because its listing the order correctly.

Is there any way to get webform to obey the source views ordering?

Screen shot of view result in preview

Screen shot of rendered Entity check boxes

Screen shot of webform section holding elements concerned (which_destination_asia)


texts:
I just uploaded a new website to a one.com hosting.
From the start I had some trouble with the .htaccess file, after I was finally able to get everything to work, I ran into another problem.

None of the images appear to be loading, when I browse directly to an image, I get this message

  Internal Server Error

  The server encountered an internal error or misconfiguration and was
  unable to complete your request.

  Please contact the server administrator, support@one.com and inform
  them of the time the error occurred, and anything you might have done
  that may have caused the error.

  More information about this error may be available in the server error
  log.

My .htaccess file is the default one with clean urls enabled.


texts: Passing object by reference in form element of type 'value'

texts:
Given that in PHP5 objects are said to be passed by reference automatically, are there reasons why one must not pass an object through forms ('programmatically')? I hope to create acceptable persistence through using $form_state for use with AJAX or form submit handlers. I've tried the following and it works (but I don't want to be doing something in poor practice/ that might get blocked).

$foo = new stdClass();
$foo->bar = 'foobar';

$form['foo-bar'] = array(
    '#type' => 'value',
    '#value' => $foo,
);

Which then appears in $form_state when the following element triggers an AJAX request

$form['numbers_required'] = array(
    '#type' => 'textfield',
    '#title' => t('Numbers needed'),
    '#ajax' => array(
        'callback' => 'numbers_required_callback',
        'wrapper' => 'numbers_remaining',
    ),
);

Furthermore, the following passage from the drupal_build_form() documentation suggests I might have to set the form 'cache' property to TRUE. Perhaps for others this is the case if they aren't using an AJAX callback. Given that I am, I assume I can ignore this, but thought others might find it useful to know.

  cache: If set to TRUE the original, unprocessed form structure will be cached, which allows the entire form to be rebuilt from cache. A typical form workflow involves two page requests; first, a form is built and rendered for the user to fill in. Then, the user fills the form in and submits it, triggering a second page request in which the form must be built and processed. By default, $form and $form_state are built from scratch during each of these page requests. Often, it is necessary or desired to persist the $form and $form_state variables from the initial page request to the one that processes the submission. 'cache' can be set to TRUE to do this. A prominent example is an Ajax-enabled form, in which ajax_process_form() enables form caching for all forms that include an element with the #ajax property. (The Ajax handler has no way to build the form itself, so must rely on the cached version.) Note that the persistence of $form and $form_state happens automatically for (multi-step) forms having the 'rebuild' flag set, regardless of the value for 'cache'.


texts: How to add checkbox to subscribe newsletter in webform

texts:
I'm using D7, and I want to create a newsletter subscribing page with simplenews module.
Other than email column, I want to have fields like name, address, contact number, select field (checkbox) in the form, like in the link below

http://bsgproperty.com/registration_form.php

However, I found that simplenews is hard to add in fields, so I decided to use webform to create fields and add in a checkbox to subscribe newsletter.

I had successfully created a checkbox, but how can I link this checkbox to newsletter module?

I want the email address entered in webform to be added in newsletter subscriber list after users check the checkbox and submit.

Is there anyway to do this?


texts: Preprocess function is not working with extension setting in view data export module

texts:
I have Installed the view data export module and enabled the extension setting "Provide as file" in view. It is working properly but I need to format the csv file so I have used "hook_preprocess_views_data_export_csv_body(&$vars)".

The issue is that when I enabling extension setting, preprocess code is not working.


texts: using an existing token as a variable in a custom token

texts:
I am using simplenews to send out a newsletter.  I have a custom module.  It has a table that relates a user code to the user's email.

email_address                  user_code
bob.loblaw@lawblogs.com        37XylT12

In the simplenews email I will send, the idea is that each user will receive a link with their usercode in it (i.e., http://www.domain.com/?q=go&c=37XylT12).

I've been attempting to create a custom token to place in the text of the newsletter and replaced with my custom link prior to send.  However, I have two issues: 1) I cannot find an example of a token that includes a db_select query to return data and 2) I cannot find a way to access the simplenews email token ([simplenews-subscriber:mail]) in my custom module -- I need this value to lookup the code.

If someone could point me in the right direction, I would appreciate it.
KMT


texts: How can I add cache context to custom menu link?

texts:
I have two routes that receive user as route parameter, and i need a menu link for every one in account menu. So I added in my *links.menu.yml

client_account_links:
  deriver: \Drupal\my_module\Plugin\Menu\CustomLinks\ClientMenuLinksDerivative
  class: \Drupal\my_module\Plugin\Menu\CustomMenuLink

And I created my CustomMenuLink class in my_module/src/Plugin/Menu with

<?php

namespace Drupal\my_module\Plugin\Menu;

use Drupal\Core\Menu\MenuLinkDefault;

/**
* A menu link that cache by user context.
*/
class CustomMenuLink extends MenuLinkDefault {

    public function getCacheMaxAge() {
        return 0;
    }

    public function getCacheContexts() {
        return ['user'];
    }
}

And my ClientMenuLinksDerivative has:

<?php

namespace Drupal\my_module\Plugin\Menu\CustomLinks;

use Drupal\Component\Plugin\Derivative\DeriverBase;
use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Session\AccountProxy;
use Drupal\user\Entity\User;
use Drupal\personas\PersonaUtility;

class ClientMenuLinksDerivative extends DeriverBase implements ContainerDeriverInterface {

    protected $account;

    protected $uid;

    public function __construct(AccountProxy $current_user) {
        $this->uid = $current_user->id();
        $this->account = User::load($current_user->id());
    }

    public static function create(ContainerInterface $container, $base_plugin_id) {
        return new static(
            $container->get('current_user')
        );
    }

    public function getDerivativeDefinitions($base_plugin_definition) {
        $links = array();
        if (PersonaUtility::hasPersona($this->account, 'cliente_konsey')) {
           $links['contratos_cliente'] = [
                'title' => 'Contratos',
                'description' => 'Mis Contratos',
                'menu_name' => 'account',
                'weight' => 3,
                'route_name' => 'page_manager.page_view_mis_contratos_mis_contratos-panels_variant-0',
                'route_parameters' => ['user' => $this->uid]
            ] + $base_plugin_definition;

        $links['solicitudes_cliente'] = [
                'title' => 'Solicitudes',
                'description' => 'Mis solicitudes',
                'menu_name' => 'account',
                'weight' => 4,
                'route_name' => 'page_manager.page_view_mis_solicitudes_mis_solicitudes-panels_variant-0',
                'route_parameters' => ['user' => $this->uid]
            ] + $base_plugin_definition;
    }

    return $links;
}

}

This create my menu links in the account menu but the route parameter always is the same, so if I change user, the links send me to another user page, the user that run the code before that cached.

My question is how I can create custom menu links, with route parameters (user in my case), and the links change by user? because this don't work. Also I tried with hook_menu_links_discovered_alter(), but without lucky.


texts:
I have two Drupal 7 sites running a very similar structure (views, content types, etc) but with a different theme and a few other changes.

I need to have all the nodes of specific content types that are created in site A to be copied to site B. If it is possible, it should work automatically or by running a script. For example, the sync would run as a scheduled cron job.

I do not need both sites to run in the same database, they must have their own separate database, just the same nodes for specific content types.

I've been investigating, and I see that I can use Node Export, Feeds and even a drush command (ne-export/ne-import). I'm not sure yet about how to put all the pieces together. Has anyone done this already?


texts:
im trying to make a report in a view from other view(a table). i've tried view calculator and it's not what i want.

i want it like this :
Total people below 20 years old : xxx
Total Male : xxx
Total Female : xxx
Total people that have * : xxx


texts: Is media-7.x-1.x vulnerable to SA-CONTRIB-2018-020

texts:
The Drupal Media module version 7.x-2.x contains a remote code execution vulnerability which was patched with:

https://cgit.drupalcode.org/media/commit/?id=1cd77ffa9c2cf96d80b76d47318179a8a82f0d46

1.x and 2.x seem to be very different beasts, I can't find any corresponding code to media_ajax_upload() in 1.x but I'm still rather unsure wether this version is vulnerable or not.


texts: Show term description when grouping by taxonomy term

texts:
I have one vocabulary with two terms, apples and oranges.  Nodes are tagged with either one or the other.  I created a view at /fruits that shows the nodes tagged with either term.  I also have the field settings set to Group by Taxonomy term which works great.

It places the taxonomy term heading at the top of each section.  Now on to my question... Is it possible to display the term description under each taxonomy heading?  So it would look like below.

Oranges (Taxonomy Title)

Oranges are probably the best fruit on earth. (Term Description)

(Results of view)


texts: How to design a page created using Views

texts:
I have created a page with help of the Views module, and it is perfectly doing the job.
I need to design the page on my own.

How can I do this?


texts:
I am displaying demonstration sites with iFrames and in page--demo.tpl.php I have a possibility to get NID only from path. So I managed demo's number will be the same as NID and now I have a code:

print drupal_lookup_path('alias',"demo/".$node->nid);

It works correctly but I would like to transfer that link to /node/$node->nid.

Is there any way to do so? I tried to print $node->nid underneath, but it prints wrong number (36 instead of 34).

Thanks!


texts: form #type => checkboxes with zero / empty option value

texts:
I am building something which uses a form element with '#type' => 'checkboxes'.

I want this to be reusable, so it should accept anything as option values that works as a PHP array key (integers and non-integer strings).

$form['checkboxes'] = [
  '#type' => 'checkboxes',
  '#options' => [
    0 => 'zero',
    '' => 'empty string',
    ' ' => 'space',
    'other' => 'Other',
  ],
];

However there seems to be a problem with values 0 (zero) and '' (empty string).

Even when the checkboxes for '' or 0 are checked, the values are gone in the $element['#value'] array, e.g. when checking with a custom '#element_validate' callback.

$element['#value'] === [
  # '' and 0 are gone, even if they were checked.
  ' ' => ' ',
  'other' => 'other',
];

Interestingly, the $_POST still contains the values, with an interesting twist, where space and empty string behave like array insertion via []. I suppose this is due to the way POST data is sent.

$_POST['checkboxes'] === [
  0 => '0',
  1 => '',
  2 => ' ',
  'other' => 'other',
];

I can imagine why all of this happens, but is there a workaround or solution?

EDIT: The previous version of the code snippet was misleading, sorry. I had mixed up $_POST and the original '#options' array.


texts: Drupal Form Checkbox having different name and id (of my choice)

texts:
As drupal assigns title as both id and name to a form element.

$form['wrapper'][$unitClean.'_container'][$unitClean.'_cb'] = array(
                '#type' =>'checkbox',
                '#title' => t($unit),
                );

I need name and id to be different for checkboxes, textboxes and select lists. Anybody with any idea?

I want to do this because I am populating multiple form elements in a loop, need to manipulate them using JS (in form of groups) and then process them on next page.


texts: How to make membership optional in Civicrm sign up form?

texts:
I am using webform module with Civicrm.

I have a registration form. This latter could be used to become member of an organization. However, I would like to make this membership optional.

How could I do that ?

Thanks.


texts: Exclude specific nodes from a view based on role permissions

texts:
I am using View access per node to hide certain nodes from the general public and allow specific roles to view it, which is simple and works like a charm.
The issue is that those nodes are shown, even when browsing with anonymous user. I can't find a way for the view to identify the "View access per node" status for each row.
I thought to change my approach; I was looking through the Comparison and Overview of Access Control modules, but any non-deprecated option available in Drupal 8 seems an overkill for this case.


texts: Not able to load data from cookies until I clear cache

texts:
In my Drupal application, I have set some cookies through a javascript onClick method.

However, am not able to access the data until I clear the cache(admin/config/development/performance/clear caches) manually.

Is there any way to clear cache in the preprocess function of the theme.

This is how I have set cookies,

$('.icons .fa-heart-o').on('click', function(){
    z.push($(this).data("nid"));
    setCookie("fav_nids", z, 5);
});

function setCookie(cname, cvalue, exdays) {
  console.log(z);
  var d = new Date();
  d.setTime(d.getTime() + (exdays*24*60*60*1000));
  var expires = "expires="+ d.toUTCString();
  document.cookie = cname + "=" + z + ";" + expires + ";path=/";
}

and retrieving them in my preprocess function,

function themename_preprocess_node__wishlist(&$variables){

    /*$cache_tags = $variables['entity']->getCacheTags();
    \Drupal\Core\Cache\Cache::invalidateTags($cache_tags);*/

    drupal_flush_all_caches();  //To clear all cache or

    $renderCache = \Drupal::service('cache.render');
    $renderCache->invalidateAll();

    $variables['#cache']['contexts'][] = 'url.path';

    $cookie_name = 'fav_nids';

    if(!isset($_COOKIE[$cookie_name])) {

      $wishlist_count = 0;
      $variables['wishlist_empty'] = "No items in the wishlist";

    } else {

        $cookie_value = $_COOKIE[$cookie_name];
        $wishlist_data = explode(" ",$cookie_value);
        $wishlist_nodes = \Drupal::entityTypeManager()->getStorage('node')->loadMultiple($wishlist_data);

        foreach ($wishlist_nodes as $node){
            $variables['wishlist_nodes_data'][] = $node;
        }

      //echo "<pre>"; var_dump($variables['wishlist_nodes_data']); exit;
    }

}

I tried a few ways to clear cache in preprocess function, but nothing works only manually clearing cache working, and that is not ideal at all.

Any help appreciated. TIA.


texts:
I have found some very detailed tutorials about Services 3. I appreciate them very much here is a  small list.

http://drupal.org/node/1354202

How to add multiple images to a node using node.save service?

http://drupal.org/node/1699354

But i cant find a way to upload images from the mobile app to the server. Is that possible ? Where can i get some example ?

Is there in Services core to accomplish this ? Every solution looks like i need o code something to get it work.


texts: Applying image style to authors pictures in comments without preprocess function

texts:
Is there anyway I could apply an image style to the user picture in comments without using a preprocess function (YOURTHEME_preprocess_user_picture?)

The reason I ask this is because the preprocess function scales and crops the user pictures and I can no longer use the uncropped version (the original) in Views for example.

Any and all help on this is greatly appreciated.

Thank you. :)


texts: Composer: Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring

texts:
When i remove drupal/pathauto or another module contrib composer print:
Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.

Why ?


texts: Is there an alternative private messsage module that integrates with Views?

texts:
As far as I can tell it's the only real solution on the block. But it has major drawbacks that make it unusable for most sites. Mainly its not built with views, therefore easy customization is out of the question unless I change the code.

Are there any alternatives, paid or free, that beat privatemsg and integrate with Views?


texts:
I am developing on Mac OSX 10.10. I am not using MAMP, Aquia Desktop or anything like that. Instead, I am using the built in PHP/MySql in Mac (set up using this tutorial).

When I run Drush, I get this error:

Command pm-enable needs a higher bootstrap level to run - you will   [error]
need to invoke drush from a more functional Drupal environment to run
this command.
The drush command 'en views' could not be executed.

(No other text is displayed).

If I do Drush status, I get the following:

 Drupal version         :  7.37
 Site URI               :  http://mysite.local
 Database driver        :  mysql
 Database hostname      :  127.0.0.1
 Database username      :  dbuser
 Database name          :  dbname
 PHP executable         :  /usr/local/bin/php
 PHP configuration      :  /usr/local/etc/php/7.0/php.ini
 PHP OS                 :  Darwin
 Drush script           :  /Users/myname/.composer/vendor/drush/drush/drus
                           h.php
 Drush version          :  8.0-dev
 Drush temp directory   :  /tmp
 Drush configuration    :
 Drush alias files      :
 Drupal root            :  /Users/myname/Sites/mysite
 Site path              :  sites/site1

Steps I have tried

1. Re-installing Drush via this tutorial

The tutorial says to install Drush via Composer. The install works, but when I re-run Drush, I get the same error.

2. Install Drush via this tutorial

This tutorial recommends to install it via Homebrew. When I do this, I get this error:

  Problem 1
    - Installation request for d11wtq/boris v1.0.10 -> satisfiable by d11wtq/boris[v1.0.10].
    - d11wtq/boris v1.0.10 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.

I've looked extensively on the Internet for how to fix this, but I just find sites saying I need to compile from source. They provide no steps on how to to do this, and I don't know what it means.

3. Using the 127.0.0.1 trick

(Changing host to 127.0.0.1 in settings.php).

Thanks for any help


texts: How to redirect user to previous page after form submit?

texts:
I can redirect user after adding a node to any another page but would like to redirect them to previous page they were linked from. Now I use the following code:

function user_add_node_form_foto_node_form_alter(&$form, &$form_state, $form_id) {
  $form['actions']['submit']['#submit'][] = 'user_add_node_foto_node_form_submit';
}

function user_add_node_foto_node_form_submit($form, &$form_state) {
  $form_state['redirect'] = 'node/add/foto';
}

How can I change a code to redirect users to previous page after submitting the form?

EDIT: Every foto node type has a node reference field "field_relate_to_gallery". By using this I created a gallery in Views and added a link "Add foto in gallery" on gallery page linking to add node form. I would like returning users back to gallery after adding a node "foto". That means that a have a lot of galleries with different ID and a cannot redirect the this form only to one particular gallery.

My Solution If someone is interested in. I did it by using node reference from url module. Now my user can add an image from gallery page (there is a link to add node form) and after submitting it he returnes to the gallery page.


texts: When sending a Drupal database to a developer, how can I remove users' personal info (e-mail addresses, passwords)?

texts: How can I remove users' e-mail addresses and passwords when sending a database to a developer (for investigating a bug, etc.)?  The e-mail addresses and passwords are irrelevant for the bug and, although I have not consulted with a lawyer, this seems to be a general safe practice.


texts: How to show data of user that flagged a content(2 flag types)?

texts:
I have 2 flag types for a content type. both flags have flag field. consider the user flagged a content by both flags. I want to show user data. I have problems in this situation. I add flag A and flag B in relationship part of views, after that I add "username of user" and "flag field" in fields part. but unfortunately I should add 2 "username" field, one of them should relation to flag A and other should relation to flag B(relation part in field setting). this is problem. because I want one field of "username", not 2 "username" fields.
What should I do?


texts: I am not able to see the comment pagination section, even though I set up the comment field under structure/content-type/name/comment-field. I set the limit of number of comments to display on node to 10. But when I have more than 10 comments on a node I still can't see the pagination bar at the bottom. Is there a module for custom pagination of comments?


texts: Which Drupal function inserts the data in the history table?

texts:
So as far as I've seen, the history table holds timestamps when users viewed nodes.

Which Drupal function insert the data in that database table? The most logical place for me would be in statistics_exit(), where the accesslog table is being populated, but it's not there. The only place I've seen something similar is in node_tag_new(), but I am not sure if that's the right one.

Can anyone shed some light into this?


texts:
I am creating a site for a company, which has multiple departments. Each department shall have a departments (sub/branch) site. Within each department site, there will be users of different roles, such as editors, approvers, administrators etc.  - each only allowed to edit content in its own branch site.

Apart from this permission, everything else will be the same - they will share the same theme and templates, content types, modules, workflow logic etc. Only the permissions need to be different

How to create these simple 'subsites'?

Here are the options in my head right now:

Using Organic Groups - a very steep learning curve (many settings) and seems like overkill
Subsites - requires additional databases, and installs
My idea - 1) Create a vocabulary containing all departments. 2) Create a content type for each content that will appear on any of the department sites. In the content type, have a field which allows the user to select the department (from taxonomy) to publish this under. However, I'd have to limit so that the user can only select the departments they are under

I am inexperienced and so do not know the potential pitfalls of choosing any of the options, anyone can give me some pointers?


texts: User relationship one way relation block and unblock option

texts:
Im using user relationship module for twitter like one way relationship ,

But i find any option to block the user from following me and in future.

Only remove option is there to remove and once removed, the user again start following me.

Any option to block the user from following me?

Thanks,
Edie :)


texts:
I'm trying to add:
1|small (<100)
2|etc ...

but it will only display "small (" as the first option.
I've tried < without success.
Any way to display the < ?


texts: Webform: get field value from the Entity select option

texts:
I have an entity select list based on View which collects a list of groups and their corresponding email address(may not be unique!).
It seems that there is bug in entity_reference.module so only titles of nodes are displayed.

I want to send emails based on the selected group. I have tried to set the Custom To email address using tokens but failed.

[webform_submission:values:groups:0:entity:field_email:*]
[webform_submission:values:groups:0:entity:field_email:value]
[webform_submission:values:groups:field_email:value]

Do I type the wrong tokens or is there any other alternative solution for this situation?


texts: How to theme forum posts? (Custom author_pane template won´t work)

texts:
I´m trying to get my author_pane template from the profiles to be different than my author_pane template in my forums.
I´m using Silver Bells forum theme.

After reading the instructions, I´ve managed to understand that the template that´s being called at the forum is "advanced-forum.naked.author-pane.tpl"

So, I´ve tried customizing that template (copying into my theme folder), with no success (Drupal don´t "take it", as if it´s not there).
Then I´ve tried changing the name to my forum theme: advanced-forum.silver_bells.author-pane.tpl
Nothing.
I´ve tried a few variants:
advanced-forum.silver_bells.author-pane.tpl
advanced-forum.silverbells.author-pane.tpl
advanced_forum.silver_bells.author-pane.tpl
advanced_forum.silverbells.author-pane.tpl
advanced-forum.author-pane.tpl

Nothing. Then I try going to the module folder and delete the "advanced-forum.naked.author-pane.tpl" file. Then, the template just dissapeared, and it was a big blank space where before were author_pane contents.
It still wouldn´t take my custom template in my theme folder.

I´ve cleared cache several times, there´s no difference.

Wat should I try to make it work?


texts: How do you add a conditional to check if the Node object exists?

texts:
I have the following code, but how do I add a conditional to check if the menu_get_object() is grabbing a node object or not? Im mainly using this in my contextual filter in views and its throwing an error on etity_metadata_wrapper() as its trying to load a node page while its in the view page. I'm not sure what condition to check before it returns anything. thanks!

$node = menu_get_object();
$wrapper = entity_metadata_wrapper('node', $node);
$tid = $wrapper->field_device_type_vocabulary[0]->tid->value();
return $tid;


texts: Rendering Taxonomy Custom Fields in page.tpl.php

texts:
Ahoy all, so, having some issues with displaying specific fields related to taxonomy terms in a page I created (page--taxonomy.tpl.php)

Essentially, I am trying to set a background image to a div, to pull from an image field (field_hero_image)on the taxonomy term. I have this working for normal nodes just fine with the following code:

<div id="herowrap" style="background:url(<?php echo file_create_url($node->field_hero_image[$node->language][0]['uri']); ?>) no-repeat center center;background-size: cover;">

However, been having difficulty understanding how to modify this to pull this same image field from taxonomy terms.

It needs to be in page--taxonomy.tpl.php as it is being pulled before the node.tpl.php is being called (if i understand correctly?)

Any reason I can pull this easily from nodes, and not for taxonomy terms?

Thanks for any help!

Dan


texts: Drupal 7, GPS lat, lng closes value, is it possible?

texts:
After multiple attempts to figure out how to find the closest gps point from the lat & lng fields (field_data_field_lat & field_data_field_lng) I would like to ask if such is possible? Is there any module that provides a solution with which it's able to create two fields for lat/lng and use them at views to find the closest one from an exposed filter?

I assume that there is no such ready made solution. In that case, I would like to write my custom sql statement for D7. Unfortunately, D7 doesn't support the D6 sql query functions and also the pager_query function.

Therefor I would like to write a statement that would bind the lat and lng fields and give back the nearest - closest gps points.
Similar, one field statement is written at: http://www.techfounder.net/2009/02/02/selecting-closest-values-in-mysql/ where the union and ABS is used. I've found the union option but didn't figured out how to make the comparison for both fields within the D7 db sql layer.

Thank you in advance.


texts: How do I get all children's taxonomy term IDs?

texts:
How do I get all children's taxonomy term IDs in Drupal 8?

$tree = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadTree($vid); uses the taxonomy term name, not the taxonomy term IDs.

What happens if the taxonomy term names are equal?


texts: Is there a way to display the product image as a radio button instead of a select box when selecting a product in a product display?

texts:
Currently im setting up my Commerce and I want to be able to replace the default select box on the product display. This select box only comes up when there are multiple products referenced. I want each option in that select box as the Product's Image Field. Yes I can use the radio button, but you can only output the title of the product in the radio selection box.

Currently I'm only getting this when i select radio button as the formatter

My end goal is this:


texts: How to Configure WebForm to Allow Users to Choose Which CiviCRM Campaign to Contribute to?

texts:
Our non-profit currently has a basic donation page via a CiviCRM Contribution page. We would like to add the ability for the user to select which campaign the contribution is directed to.

The Webform CiviCRM Integration Module seems like a necessary component. When configuring a webform, you may direct the contribution to a pre-existing contribution page, but without the ability to expose this to the user. I also looked at apply the Webform Conditional module, but did not see anything that would lead to my desired outcome.

I appreciate any insights in how to create a donation page which provides the user the option to select CiviCRM campaigns.


texts:
I've got a requirement to allow Users the ability to create multiple nodes within a single experience.

All this content the Users are adding share much of the same data, so the idea is to give them a more convenient way to add multiple nodes without all the Save and Add Content clicking.

They don't necessarily need to be able to edit the nodes in the same single experience.

Any modules, and/or case studies you recommend?


texts: Image cache present in which config file

texts: I am new to drupal and was learning about image cache.So far its going good but I want to know where exactly the image cache config is getting saved.I mean to ask which file I have to browse to see image cache setting?If my doubt is silly then please forgive me.Thanks


texts:
I have a self-defined entity with revisions called command. The instance with id=1 has 3 revisions. Now I want to load all these revisions. Tried this:

$query = new EntityFieldQuery();

$query
  ->entityCondition('entity_type', 'command')
  ->propertyCondition('id', 1)
  ->age(FIELD_LOAD_REVISION)
  ;
$result = $query->execute();

but it gives me still only one revision, the current one. There's no difference to calling it without ->age(FIELD_LOAD_REVISION).

What am I doing wrong?


texts: Is it possible to write node migrations for D8 alpha/nightly yet?

texts:
If the migrate api in core is currently capable of doing simple d8-to-d8 migrations, where could I find documentation on how to do so?

This is more or less a learning exercise and I am only trying to migrate standard article nodes from one alpha version to the next.


texts:
I get the impression the module works best for blog-type websites. My website's nodes have many many different (short) text fields with about 30-50 characters worth of text each. It would be incredibly helpful if I could get the search results data formatted differently. It looks like snippet is just a markup string ready to be printed. Whereas I would benefit a lot more from structured data. Let's say I search for the word "communication" then I would want data that looks more like:

 array(
  'matched_node_id' => 'xyz',
  'node_title' => 'abc',
  'matched_fields' => array(
               'matched_field_1' => 'full text for this field',
               'matched_field_38' => 'full text for this field'),
   );

This way I would be able to structure my page a lot more cleanly for my users. The data sort of resembles tabular data, and showing snippets without organization would be very unhelpful. Any ideas on how this could be implemented? Monkeying with theme_preprocess_HOOK? Perhaps a new module?


texts: How do I get Drupal to preference one of a module's .tpls over another?

texts:
I have modified a Global module so that it has a 2nd .tpl file. The original .tpl file is for sites using Zurb Foundation 5, the newer one I created is for sites using Zurb Foundation 6. Because this is a global module, these files exist in the same directory.

I've named the newer .tpl inline with what Theme Debug suggests (image_resp_item--f6.tpl.php).

Now, I've just got to tell the site that when it's using Foundation 6 to preference the .tpl named image_resp_item--f6.tpl.php.

However, I'm completely lost at where to start with this. Is this something I set up on the module's .module file? Or something I set up on each sites template.php file? Is there a hook I can use?

Sorry its kinda vague - been dumped in the deep end here - any advice is appreciated.


texts:
I am using Facebook post module which display its "Fb Account connection" generated informations/options in an user/%uid/edit/fb-post page.

I want to display these outputs in a custom panels page, but the module doesn't provide blocks, views, forms, or nothing I see that I could handle inside panels.

Any way to achieve this?


texts:
Is there any way to achieve relative date in Views FILTER CRITERIA?

I need a date between 'first day of' and 'last day of'.

Views Contextual Range Filter Module does not work on Drupal 8.4.x.


texts: How do I place thumbnails from videos in a views slideshow?

texts: If the user doesn't give a thumbnail for the video in the slide show, I would like to generate a thumbnail from the video. I looked through questions and couldn't quite find what I was looking for. I am using Drupal 7. I am using the views slideshow module.


texts:
I created a most read section with 4 articles in views.

The height is over. How do I make this section scrollable?

Is there any scrollbar settings in views?


texts: Is there a way to restrict access to a particular node?

texts:
One of my teammates created a simple page that displays links to important contents. However, since it is simple content, the page itself is restricted but the link still shows up in the main menu.

I'm looking for a way to add a permission such as custom_module.permission.yml where the client will be able to define who can access this page.

Is there a way to do so without installing any external module?


texts:
I am aware that Webform is now out of the Window and has more or less been replaced by Core Contact Forms. I created a form and it works great. Only problem is, I can't for the life of me find out:

If it stores a copy of the submitted form locally?
Where it stores it if it does?
Or if it does not store it, how to allow it to be stored?

Like webforms, I want to click somewhere and see "Show all submissions". But no idea where?


texts: How to add a new condition to access callback function in hook_menu_alter?

texts:
I need to add a new condition to access callback function for a menu path.

For it I write hook_menu_alter and redefine there new access callback function.

function mymodule_menu_alter(&$items){
  $items[node/add']['access callback'] = 'mymodule_custom_callback';
}

And I have a question. I want this function to not overwrite previous access callback function, but add a new condition, which would be added to previous conditions for access callback.

How to do it most correctly ?

And is it possibly to do it not knowing the name of default access callback function ? For example, default access callback function for path node/add is _node_add_access().


texts:
I have a big personal project build on Drupal 7 that has many custom entities. I want to start upgrading the project into Drupal 8 but the completly rewritten Drupal 8 core is too big for me to get my head around without any documentation(+ Symfony is totally unknown to me, I'm just a simple Drupal-only guy).

I tried to create a custom entity just by looking at some of the core modules code but without any success.

Can you point me to some articles about custom entities in Drupal 8(I haven't been able to find single one) or give me some basic step-by-step guide?

Thanks.


texts: What approach for showing custom user fields on a node?

texts:
I've added a few custom user fields which users complete when registering.

What is the simplest approach to show these fields when viewing content that user has created?

For example, when viewing a blog entry I can see the 'submitted by..' and their name. I would like to use my custom user fields to expand that summary.

I've got no problem using views, or creating/modifying the theme etc, but I'd like some guidance on the easiest approach before I start out. (It's too easy to hack away on one approach in Drupal when there's a much easier solution!)


texts: How to change field setting using on some condition based?

texts:
I want to change image property like resolution based on other field.Like I have a field that tells how the image will be shown. If I select a large image then minimum image resolution have to change higher.

There is no option to do it with conditional field. So Is there any other way?


texts: Flex Slider issues after upgrading Drupal to v7.39

texts:
I've been researching this issue for a week to no avail.  Perhaps someone has some suggestions?
Upgraded a site from Drupal 7.34 to 7.39 rather seamlessly.  Also updated all modules that were down level.  All seemed OK.  But then the flex slider just stopped displaying.  I've checked all I could in the various display and definitions pages and all looks fine.  I've tried different browsers and even a different server instance with on luck.
I'm just hoping someone who may have experienced this anomalie can shet some light on what to look for next?


texts:
In website have many AUTHENTICATED USER. I want to how many times spent of each user on site.

I use login history module, it show only every login time of all user.

I use time spent module, but not track all time of every page.

Please suggest how to calculate time spent of each user on every login.


texts:
I'm writing a module that will alter map zoom level and map center based on argument from url. But I cant figure out how the hook_openlayers_map_alter(&$map = array()) works, I'v tried to test this hook with:

function openlayers_mapalter_openlayers_map_alter(&$map = array()) {

    $map->center['initial']['zoom'] = '1';

}

but it has no effect on maps. What is the proper way to call this hook?


texts: Drupal 7.12: cloning default taxonomy with depth view

texts:
i have two content types both with options for tags but using different vocabularies. I have cloned the default taxonomy view and created two separate views for both content type because one displays teasers and another uses a grid display. I also selected the relevant content type in the filter section.

When i selected the relevant vocabularies under contextual filters, both views worked. however, a few hours after doing this i started getting 'page not found' messages when i clicked on the tags (for both views). When i went to check whether the relevant vocabularies were still selected in the contextual filters, the views would show the option to choose a vocabulary. I then tried this method - Views contextual filters taxonomy name. this worked when i changed one view but stopped working when i changed the second view.

Question is, do i need to change the path for both views from the default /taxonomy/term/% or is there a setting i have missed or module i have to download? any help will be greatly appreciated.


texts: How can I encrypt the login process without using SSL?

texts:
My webhost doesn't allow SSL certificates for my webhosting product since it is a shared IP server. (I would have to upgrade the product and pay a lot more money, which I don't want to at the moment) I don't really need all of the website encrypted, I only want to give the password (and username) submission on login a bit more protection. Is there a module that just does some asymmetric encryption on the password on submission, e.g. with JavaScript?

Note: I know about the possibility of Man-in-the-Middle attacks with this setup.