texts:
When coding my formatter, I give user an option to provide alt, title and classes attributes for an image. All render beautifully, except for the alt title, which is output as flag-type, empty "alt" attribute (meaning: no equal sign or quotes), regardless of what I try to insert there.

Could the Media module be the reason - such as overriding the alt value with some hooks? If not, any ideas on what could be causing that?


texts:
I am creating a website in which I want to show the similar shops near by user location.

Like if a user selects Bangalore -> M.G. Road then the similar shops near by M.G. Road should be displayed.

However, I don't want to use Google Maps, because it will take too long to open.

Any suggestions about how I can do this in Drupal7?


texts: Annotate term relationships with data via edit form

texts:
I'm building a simple download area for a web site. All it should do is to provide material of lectures for users which are grouped into user groups. As I don't want to make the system to difficult I'm not using organic groups or similar but just a share taxonomy between users and my "document" content type. If a document has no terms of that taxonomy or the user has one of the documents terms the document will be shown. Here helps Access by Term (ABT) module perfectly.

However, one caveat is that the publish date of the documents is based on the group. Some groups. Thus some lecturers will use the same document in different courses. To avoid that someone can see the document too early I'd like to add a date to the document/term relationship and filter hide those documents by checking these values in a custom template.

Does anyone know how best to implement such a system. Thinking of adding multiple text fields and letting the editors add TERM NAME|DATE into it. Then I'll loop through all the values on creation of the teaser. Shying a bit away of creating my own module and database table to store maintain these values.


texts: How do I get Location / GMap / Views setup to display non-US map nodes?

texts:
Drupal 6, Views 2

I'm using the Location module to store address information for various contacts in nodes. I am then using the Views module along with the GMap sub-module of Location to display these nodes as map markers on a Google Maps style map on a page in my site.

This works perfectly for USA addresses, but I can't get Canada or UK addresses to display on the node map. The link inside the node (from Location module) to view the location in an external Google Map works just fine, so I can confirm the addresses are valid. However, they do not display on my Drupal Views generated Google Map a la Location/GMap.

Note - disabled and/or cleared cache to make sure this wasn't an issue. Also Regenerated marker cache inside of Location configuration to rule that out also.

Is there some kind of configuration setting I'm missing?


texts: Display content type in custom display format

texts:
I created an content type of name "profile", where it has fields
Profile Name, Image , message , body.

It displays in this format attached image_1

Now how can we arrange or make change in custom format like below image image_2
how can we displayed to end user


texts: Add Some HTML to the Right of #content on Zen 7.5

texts:
Hello ive been struggling with this all morning and i tend to only post here when im really exasperated and used up my css limited knowedgle after pushing the boundaries that bit further.

I have A WEBPAGE quite standard stuff. Reposinsive design though which could be a bugger to me. #page, #header, #content etc. I was trying to draw a photoshop pic actually i better.....blast i cant. Its easy really. I just want to have a new sidebar on the right of the main content.

Im gonna add this to drupal stackoverflow instead if you dont mind. This could be something to do with block regions. I know i could maybe use block regions but im using panels and i prefer to have no blocks loaded in the blocks bit (for performance) i might just be OCD about it.

Im invoking the block just with code. Ive had it a million places in my page tpl (zen 7.5) and i cant seem to get it anywhere near where the right sidebar should have been.

I might be making an easy question sound hard. I just want to add some html to the right of #content region. thats all. bah this is getting me down. Can anyone shed some light on it for me?

Thanks

The html im adding is

    <div id="maleft">
    <?php
      $block = module_invoke('md_megamenu', 'block_view', '2');
      print $block['content'];
    ?>

and my css for maleft is none existant as i cant even get it in the contant area :(


texts: Splitting field value inside field template not working?

texts:
I have a twig template for some text field. Inside it I'm displaying the value like (it's single value field):

{% for item in items %}
  {{ item.content}}
{% endfor %}

And it's displaying value correctly, which means that inside that loop item.content contains correct value.

Now, field value actually contains tags, i.e. value is "tag1 tag2 tag 3". And I want to split that value by space sign. So I tried something like:

{% for item in items %}
  {% set tags = item.content|split(' ') %}
  {{ dump(tags) }}
  {{ item.content}}
{% endfor %}

And this split function should return list of elements 'tag1', 'tag2', 'tag3', according to documentation: https://twig.symfony.com/doc/2.x/filters/split.html

But instead, this dump call prints out null ?!?!

Why is that happening?


texts: drupal 7: trying to make use of Compressing JS and CSS causes Major Error

texts:
hi I want to enable the compression of my JS and CSS to speed up my drupal site, but when I tick these boxes my site breaks completely. I can't even reload the performance page to remove the tick!! Thankfully I leanred this sometime back so I open the perf page twice tick on one and apply, see error then save the other loaded page which resets the situation.

error message for either CSS or JS tick is

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

Also I CAN set these ticks on my localhost verion of the site, I get this problem on the hosted site.

anyone know why I can't use these features?

edit. Also there is nothing in the logs when I get back into the site.

error below was shown when warnings and error were turned on to display

Error
Error message
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'WATCHDOG_ERR' for column 'severity' at row 1: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => file [:db_insert_placeholder_2] => The specified file %file could not be copied to %destination. [:db_insert_placeholder_3] => a:2:{s:5:"%file";s:22:"temporary://fileFTC3lH";s:12:"%destination";s:64:"public://css/css_jZfSPTZv1KVtNJ48SyQgcHuPQjmI4wt9aqGhI5N-Vyg.css";} [:db_insert_placeholder_4] => WATCHDOG_ERR [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://www.martynazoltaszek.com/admin/config/development/performance [:db_insert_placeholder_7] => http://www.martynazoltaszek.com/admin/config/development/performance [:db_insert_placeholder_8] => 87.74.16.7 [:db_insert_placeholder_9] => 1334073447 ) in dblog_watchdog() (line 157 of /home/martynaz/public_html/modules/dblog/dblog.module).
The website encountered an unexpected error. Please try again later.


texts:
I've been scouting the forums for the past two days trying to get an answer to my problem, i'm new to Drush but pretty good with Drupal. my environment is as follows:

centos 6
php 5.3.3
drupal 7.x single site basic installation

I've installed drush, then cd to my site root directory and i used drush dl seo_checklist which worked fine.

when I run drush en seo_checklist I get the following output:

Command pm-enable needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command. [error]

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

Drush was attempting to connect to:
 Drupal version         :  7.34
 Site URI               :  http://default
 PHP executable         :  /usr/bin/php
 PHP configuration      :  /etc/php.ini
 PHP OS                 :  Linux
 Drush version          :  7.0-dev
 Drush temp directory   :  /tmp
 Drush configuration    :
 Drush alias files      :
 Drupal root            :  /var/www/html/mytestsite
 Site path              :  sites/default

i did modify my settings file to include:

'host' => php_sapi_name() == 'cli' ? '127.0.0.1' : 'localhost'

UPDATE - 1

drush st returns the following:

 PHP executable         :  /usr/bin/php
 PHP configuration      :  /etc/php.ini
 PHP OS                 :  Linux
 Drush version          :  7.0-dev
 Drush temp directory   :  /tmp
 Drush configuration    :
 Drush alias files      :

everything inside the root folder has 755 permissions and belongs to apache:apache

I am running the drush command as root. i have no idea what could be causing the problem.


texts: Cron task with Elysia cron module run only manually?

texts:
Im using the cronapi coming with Elysia cron module and here is my code :

function MYMODULE_cronapi($op, $job = NULL) {
  $items['example_news_cron'] = array(
    'description' => 'Send mail with news',
    'rule' => '*/5 * * * *', // Every 5 minutes
    'callback' => 'example_news_fetch'
  );
  return $items;
}
function example_news_fetch() {
  // Do something here
}

the cron works only when I run it manually in the admin section(Elysia cron configuration), but I need it to be runing every some specific periode !

Is there some configuration missing, or system requirements


texts: Let's say you want to have a set of multimedia galleries, that contain a texts, photos and some youtube films. At the phase of creating content types, I can imagine few approaches. For example - we can create the whole gallery as a one content type, with few optional multivalue fields, or we can create separately content types for photo gallery, separate content type for texts, and all that would be linked by using taxonomy, or we can go even more granular - with content type for ONE photo, ONE text etc, and all that would be linked with each other by taxonomy. How granular content types should be and what are advantages?


texts: Programmatically get webform submissions of a specific nodes webform

texts:
In Drupal 8 there is no function webform_get_submissions() as of this writing.

Webforms can be attached to nodes.
How to get all the submissions of a webform that belong to a specific node (e. g. node ID = 15):

webform_get_submissions_by_node_id() ... is the wanted function.

There are similar questions here but the PHP code to get only the submissions which where created on one specific node is different. And for this there is still now answer to find.


texts: Showing block in specific urls and content types

texts:
I'm using this code to show block in specific urls and content types.

<?php
  $match = TRUE;
  // block is visible on the content types entered here
  $types = array('product_display' => 1, 'page' => 1);
  $url = request_uri();
  if ((arg(0) == 'node') && is_numeric(arg(1))) {
    $node = node_load(arg(1));
    $match = isset($types[$node->type]);
  }

  if (strpos($url, "somewhere")) {
    $match = TRUE;
  }
  // copy paste these for additional URLs
  $tids=array_keys(taxonomy_get_children(7));
  foreach($tids as $tid) {
    if (strpos($url, "taxonomy/term/".$tid)) {
      $match = TRUE;
      break;
    }
  }
  return $match;
?>

It works but the block shows in some other urls too, any idea why?


texts: Why are the regions being highlighted when I mouse over on them?

texts:
On each region hover over the region is highlighted with a background colour of light blue and the border changes to red.
I cant work out whats causing this (i'm a newbie).
Im using a base theme of ninesixty and only have a few additional modules installed.
Its not a browser addon as I see the same thing in firefox and chrome.

Please help!


texts:
I have two content types.
1. Lecture
2. Notes

Notes have an entity reference field which references lecture.
Different users create different notes each referencing to a lecture.

Now,
How do I display note created by user on lectures page.


texts:
I found from the documentation that to get the created date I can use the    getCreatedTime() method.

How do I get when an entity was last updated?


texts: How to display drupal user page tabs on 3 different page

texts:
We want to display a 3 tab  "Create new account(Lawyer Registration)" , "Log In" , "Forgot Password" link on 3 different pages. when we click on log in then they display all 3 tabs.

Actually we have 2 different type of registration process one for lawyer and another one is for normal user. when we click to login then they display above 3 tabs and this is confusing for user. so i want to hide this lawyer registration process form user page and call them to from different page.

So please help me how i can remove them from above tabs and call user/register page from different ways.


texts:
I want to use an admin specific page to insert or remove new users, instead of using the Drupal administration panel.

How can I prescind from the Drupal default database and insert the users' information in my personal database? Is it possible?


texts: Is it possible to convert separate (matching) managed files to a single shared file?

texts:
I'm finishing up a Commerce store that has tens of thousands of imported products. In a slightly simplified form, here's my problem: Each has a unique primary image and a common secondary image. The import has created a separate secondary image of the exact same file for each product, which obviously creates enormous redundancy and uses much disk space unnecessarily.

Is there a safe way to convert all of the secondary images into a single, shared image in the database and filesystem? (I'm envisioning some kind of database SQL to make multiple products reference the same image, and then hoping that Drupal will clean up the orphan files automatically -- am I looking in the right direction?)

(Drupal 7)


texts:
How can I apply different image style to an image field in Views, based on the condition of some other field of the same content type? I need to print the image with some frame, if some field (checkbox) is true, and with other style if the field is false. Any ideas?

Thanks


texts: How can I theme a single value from a multi-value theme?

texts:
I'm trying to output a single piece of text from a multi-value text field (unlimited # of values) in my node template and I can't for the life of me figure out how to do it AND apply the THEME to it.

If I just do this:

render($content['field_hero_slideshow_header_text'][0])

I get the plain old markup for the field. However I want it to be run through the filters and have the theme template applied to it just as if I were rendering the full field with all the values like so:

render($content['field_hero_slideshow_header_text'])

I've tinkered with passing the #theme values and other vars to the array and using the theme() function also. but I can't quite seem to get it. What am I missing?


texts: How to make the 'Module Updates' report available again?

texts:
I have a 7.18 Drupal site running since a long time without updates. The update manager was deactivated since then as well.

Now I had to move the site to another server and after reactivating the update manager, it does not work properly. I have the status message that there are updates available, but the paths admin/reports/updates or admin/reports/updates/update only lead to the reports overview page.

Does anyone have a hint about how to fix this?


texts:
I have created a pseudo field using hook_entity_extra_field_info() and displaying markup using hook_entity_view().

How can I create a checkbox setting in node create form so that I can show / hide this pseudo field per node?


texts: Can not override template for specific view

texts:
I'm new to Drupal so this might be a noobish question.
I have a view called 'Category' where all posts are listed that belongs to the chosen category.

I would like to override the views-view-unformatted.html.twig as well as the views-view-field.html.twig which is working fine for other views.

When I enable the twig debug mode I see this at the top of the page:

<!-- FILE NAME SUGGESTIONS:
   * html--taxonomy--term--31.html.twig
   * html--taxonomy--term--%.html.twig
   * html--taxonomy--term.html.twig
   * html--taxonomy.html.twig
   x html.html.twig
-->

So I thought templates with the name

views-view-unformatted--categories.html.twig
views-view-fields--categories.html.twig

would do the job. Or being even more specific:

views-view-unformatted--categories--block-1.html.twig
views-view-fields--categories--block-1.html.twig

But these templates aren't used.
I have also tried to use 'taxonomy--term' for the template names with no success.
There is also no file name suggestion for these templates.

Can anyone please tell me how I can get it working or hint me to the right direction?


texts: How can I assign a View Page on a Domain?

texts: On my Drupal 7, I assign Views Block by using Domain Access and Domain Context on a node(a node that already assigned to a domain). How can I assign a Views Page with Domain Access? The Views Page "Path" does not have the domain option, which I only can assign to the default domain. Anyone know how?


texts:
I wrote a feature module that contains content types and test nodes. After importing those nodes, a certain cache has to be rebuild.

Both hooks I know (hook_install() and hook_enable()) are called before the import happens.
Is there any hook that is executed only once after the feature import is done?


texts: How to modify HTML layout inside a View template

texts:
I am very new to Drupal and this is my first post in this community. What I am trying to achieve I know may be very simple but just don't know how! So I am looking forward for expert help.

First please see the screenshot:

Below is what I want to achieve:

WHITE boxes are laid out as float: left;
I want A, B and C to shift below their respective titles, i.e. at A1, B1 and C1 spots respectively.
I want to make the TITLE + A1 to be under the same container so the container can float left itself. Same with TITLE  + B1 and TITLE + C1

I copied views-view-unformatted.tpl.php file to my custom theme folder. The code snippet is rendering the data fine:

<?php foreach ($rows as $id => $row): ?>
  <div<?php if ($classes_array[$id]) { print ' class="' . $classes_array[$id] .'"';  } ?>>
    <?php print $row ?>

<?php endforeach; ?>

But I want each of the field in $row to be printed in a way I want, e.g.:

<?php foreach ($rows as $id => $row): ?>
  <div<?php if ($classes_array[$id]) { print ' class="' . $classes_array[$id] .'"';  } ?>>

      <?php print $row->title ?>

      <?php print $row->body ?>

<?php endforeach; ?>

I believe there is a way to do it but don't know how. $row->title or $row->body is actually printing (rendering) nothing.

Also, if I modify views-view-unformatted-tpl.php it will affect the entire site. So I want a separate view for this purpose. How to do this?


texts:
I have build a map in ArcGis online containing GeoRss feeds and I am trying to display it in my website. I used the webmap module but the GeoRss feeds are not displayed.

Do you have any suggestions on how I can do this? Not especially using this module, but rather also approaches on having this kind of map in my website.


texts:
How can I allow my module (created with Features) to add a new script to the head?

The script should be in the correspoinding module directory.


texts: How to deal with module conflicts ("anti-dependencies")?

texts:
I have a module that specifically doesn't work with another module. I want to know if there is a way to check if that module is enabled and abort installation for example or gray out the installation box so that my module can only be installed if that other module is disabled.

It's like inverse dependencies!

Is there any way of doing this properly in Drupal?


texts: Migrating stories from Drupal 5 to Drupal 6

texts: I am designing a Drupal 6 website from scratch, but I need to import about 5,000 story type nodes from a Drupal 5 website into the new one. What might be some of the ways to do that?


texts:
I installed metatags module and text list formatter. And I add in metatags keywords a string [node:field_tags]. And at my computer all is good, but on a server. It don't work.

It looks like in the keywords field when I open html code for example 'tag1tag2tag3tag4'. But on the server. it don't work It should be look like 'tag1, tag2, tag3, tag4' etc.

I can't fix it.
Who can know something or any idea??? How can I fix it?


texts: How to modify Drupal configuration programmatically?

texts:
How can I modify the Drupal settings found on /admin/config/people/accounts (and other configuration pages) using a custom module?

For example, how do I rename the Anonymous user and change 'Who can register accounts' setting from 'administrator' to 'visitor' programmatically with a custom module?


texts: Location subfields problem to render in teaser template node

texts:
I have tried render only two array´s parameters. Street and postal code but don´t display anything this code.

<?php print render($content['field_mapa']['und'][0]['street']); ?>and <?php print render($content['field_mapa']['und'][0]['city']); ?>

However with this code print all parameters.

<?php  print render($content['field_mapa']); ?>

I don´t understand where is the problem with this field.


texts: Don't print $title on certain content types

texts:
How would you go about not printing $title on only the 'article' content type? Do i do this through theme-settings.php or page.tpl.php?

Here's a start, but I don't think I'm going in the best direction with this in the theme file.

if ( !empty($node) && $node->type == 'article') { }
else {
  print $title;
}


texts: system error - PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table

texts:
I am having problems accessing my modules. The system keeps displaying the following message:

  PDOException: SQLSTATE[42S02]: Base table or view not found: 1146
  Table 'jasmine_ah.field_config' doesn't exist: SELECT fc.* FROM
  {field_config} fc WHERE (module = :db_condition_placeholder_0) AND
  (fc.active = :db_condition_placeholder_1) AND (fc.storage_active =
  :db_condition_placeholder_2) ; Array ( [:db_condition_placeholder_0]
  => taxonomy [:db_condition_placeholder_1] => 1 [:db_condition_placeholder_2] => 1 ) in field_read_fields() (line 349
  of /Users/jasmine/Sites/Drupal/modules/field/field.crud.inc). The
  website encountered an unexpected error. Please try again later.

Do you have any suggestions as to how I can go about resolving this problem? I am using Drupal 7.9 and the Zen theme.


texts: Pulling content from other nodes into a Panel Node

texts:
I'm using Panel Nodes* to let users create content with varying layouts. I'm wanting to display another node in one of the panels.

When I create the Panel Node and go to create a new Content pane, I click Entity then Rendered Node. However, the Entity dropdown only lists "This node". If I click Node instead and then try to insert a Node Content panel content type, the Node dropdown is still "This node". What am I missing?

I've tried using EntityReference to associate a Panels node with the other content type, but it doesn't increase the options available to me.

Any idea how I'd render a node from another content type in a Panel Nodes Panel?

Thanks!

*Yes, I know I should use Panelizer, but I'm wanting to know if there's a way to do this without converting everything I've done thus far to that.


texts: Sending system e-mails do not work in spite system says it sends e-mail

texts:
So, my Drupal 7 does not dispatch those messages (notify user on registration and such) in spite the system says it sended e-mail. Other scripts (like send the web page by email) work well, though!

I am on dedicated unmanaged (i manage it ;) ) Debian server with LAMP, and for e-mail I installed Postfix.

If someone got clues i would be grateful!


texts: How can I hide a field with Views if another field has a certain value?

texts:
In my Drupal 7.8 website (with the Views and Panels modules installed), I'm trying to display a view pane in a panel. However, I only want to show certain fields in that pane if another field has a certain value.

Example: I display fields Foods, Healthy, and Unhealthy from a node using a custom view pane. But I only want to display fields Healthy and Unhealthy if field Foods (which is a multi-select field) contains the value "Cheetos"

Does anybody know how I can do this with a plugin or with views default functionality?


texts: Show parent child relationship of taxonomy term in view

texts:
I am looking for a way to display the list of taxonomy terms in a view indenting the child tax terms. I need to be able to see all Taxonomy terms including the ones that do not have children terms. any ideas?

Domain 1
    Sub-domain 1
    Sub-domain 2
Domain 2
    Sub-domain3
    Sub-domain4
Domain 3
Domain 4

I tried to follow the suggested solutions but they did not work out for me.  The first one in the link is asking you to provide a parent taxonomy term to filter by. I want to get the complete list.  the Second one only provide the Taxonomy terms that have a parent child relationship. I need to see all taxonomy terms even if they don't have children.  Here is the screenshot of my view setup, I followed the exact steps outlined by louieliu.  As you can see it only shows Environment with subchildren of Soil and Weather but does not show the other Domains without subchildren.


texts: How can I stop ckeditor from adding   in front of pasted word content?

texts:
When I paste from word using the word clipboard button I get a blank paragraph inserted before the word content.

Can anyone tell me the way to prevent or fix this?


texts: Recommended Drush version to use and install for Ubuntu 19 with PHP 7.2 and running Drupal 7

texts:
It's been awhile since I've upgraded my server and I'm setting it up from scratch. I'm using Ubuntu 19, apache 2 and PHP 7.2. My site is Drupal 7 which is still running php 5.6 in my old server. I'm in the process of installing drush via the command on the new server:

  composer global require drush/drush:8

I'm not sure which version of drush I should be using or if I should even be installing via that method. What version of Drush should I be using for Drupal 7 and am I using the correct PHP version of 7.2?


texts:
I have a profile field called "myutr" that I need to pass to the browser, for ALL pages, via js

drupal_add_js(....)

I know that $user does not contain profile fields so to get the value of this field I need to load it via

$account = user_load($user);
drupal_add_js($account->myutr); //I know that is not the correct code

But in a big site with more and more page views call user_load only for a field is for me a bad perfomance practice. So: is there a possibility to load only this field via drupal standard api ? Or I need to call db_query(....) ?

Thanks.


texts:
My users have to be guided to Bank Gate to pay the money After filling a Form in my custom module. the process of leading them has to be done through NUSOAP but it seems it is not functioaning inside module! it works find when i have the same code in a php file but in module ... I have no idea what is wrong with that! this is my submit function:

function my_module_my_form_submit($form, &$form_state) {

  $nusoap_path = drupal_get_path('module', 'myblock') . '/nusoap.php';
  include_once($nusoap_path);

    $client = new nusoap_client('https://de.....com/pg/services/WebGate/wsdl', 'wsdl');
    $client->soap_defencoding = 'UTF-8';
    $result = $client->call('PaymentRequest', array(
                                                    array(
                                                            'MerchantID'    => 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
                                                            'Amount'        => 1000,
                                                            'Description'   => 'some texts',
                                                            'CallbackURL'   => 'http://......./verify.php'
                                                        )
                                                    )
    );
    //Redirect to URL
    if($result['Status'] == 100)
    {
        $form_state['redirect'] =('https://www.......com/pg/StartPay/'.$result['Authority']);
    } else {
        echo'ERR: '.$result['Status'];
    }

}

thanks in advanced for you help


texts: I was just going through webform configurations and I changed the date list element format from default to raw. After doing this Im not able to add any element of type dateform to my webform and also not able to open the element configurations also. The error i get when clicked on element tab (refer the attached image) is "The website encountered an unexpected error. Please try again later."


texts:
I have two images I need to return in my custom module's SQL. It works with returning just 1, but when I add another it shows both as blank and dpm($row) shows the field as NULL. I've double checked all the mappings in the SQL and they should be right, although I AM suspicious of this line I wrote:

LEFT JOIN {file_managed} AS fm ON
(fdfti.field_taxonomy_icon_fid=fm.fid
AND fdfcm.field_costs_money_fid=fm.fid)

The idea is I want to return each image value if it exists (both if both exist, and just the first one - icon - if only it exists). It works if I just join in the fdfti.field_taxonomy_icon_fid.

Is this allowed with the 'AND' operation?

Also, the following is how I'm transcribing the returned results for the 'uri' field:

$icon = image_style_url('thumbnail', $row['uri']);
$dollar = image_style_url('thumbnail', $row['uri']);

Note: If I remove the $dollar variable and just have the $icon variable set and remove the AND clause from the above SQL, well then $row['uri'] returns the image. But when I have both neither show up.

Thoughts?

Per request, the entire SQL statement is as posted:

$result = db_query("
SELECT n.title, n.nid, n.status, n.type,
  fdfty.field_type_value, fdfi.entity_id, fdfi.field_icon_tid, fdfti.entity_id,
  fdfti.field_taxonomy_icon_fid, fm.uri, fm.fid, ua.source, ua.alias,
  el.field_experience_level_value, fdb.body_value, fdfr.field_role_value,
  fdft.field_topics_value, fdfed.field_event_dates_value, fdfed.field_event_dates_value2
FROM {node} AS n
LEFT JOIN {field_data_field_type} AS fdfty ON n.nid=fdfty.entity_id
LEFT JOIN {field_data_field_icon} AS fdfi ON n.nid=fdfi.entity_id
LEFT JOIN {field_data_field_taxonomy_icon} AS fdfti ON fdfi.field_icon_tid=fdfti.entity_id
LEFT JOIN {field_data_field_price} AS fdfp ON n.nid=fdfp.entity_id
LEFT JOIN {field_data_field_costs_money} AS fdfcm ON fdfp.field_price_tid=fdfcm.entity_id
LEFT JOIN {file_managed} AS fm ON (fdfti.field_taxonomy_icon_fid=fm.fid AND
  fdfcm.field_costs_money_fid=fm.fid)
LEFT JOIN {url_alias} AS ua ON CONCAT('node/', nid)=source
LEFT JOIN {field_data_field_experience_level} AS el ON n.nid=el.entity_id
LEFT JOIN {field_data_body} AS fdb ON n.nid=fdb.entity_id
LEFT JOIN {field_data_field_role} AS fdfr ON n.nid=fdfr.entity_id
LEFT JOIN {field_data_field_topics} AS fdft ON n.nid=fdft.entity_id
LEFT JOIN {field_data_field_event_dates} AS fdfed ON n.nid=fdfed.entity_id
WHERE n.status=:status AND n.type=:resource AND (fdfty.field_type_value=:webinar
OR fdfty.field_type_value=:workshoptraining OR fdfty.field_type_value=:conference)
AND el.field_experience_level_value=:level AND fdfr.field_role_value=:role
AND fdft.field_topics_value=:topic AND ((fdfed.field_event_dates_value IS NULL)
OR (fdfed.field_event_dates_value >= CURRENT_DATE())) GROUP BY n.nid, n.title
ORDER BY CASE WHEN fdfty.field_type_value='1' THEN 0 WHEN fdfty.field_type_value='2'
THEN 1 WHEN fdfty.field_type_value = '3' THEN 2 END, fdfed.field_event_dates_value,
  n.title", array(':status' => '1', ':resource' => 'resource', ':webinar' => '1',
  ':workshoptraining' => '2', ':conference' => '3', ':level' => $level, ':role' => $role,
  ':topic' => $topic));


texts: Webform Multistep - conditional wizard skipping

texts:
Is there a way to create a multistep form in Webform and add conditional logic somehow that, based on submission values, certain steps are skipped?
Example, I have a 10 step wizard Webform. Based on certain answers in the first 3 steps, steps 4-6 may be skipped, or in some cases, sent from step 3 to the final step. In other cases, the user would go through every single step (normal).
I tried looking around for examples but didn't come across anything concrete. I did find this, but I am not sure if that is still current?
Webform version: 6.x


texts: How to hide Authoring information,Revision information,Publishing options tabs in create/edit node for any content type

texts: I am trying to hide Authoring information, Revision information, Publishing options tabs in create/edit node for any content type. I tried different modules with no luck. Please give me suggestions how to achieve this. Thanks a lot


texts: Different content in same blocks through different contexts

texts:
This is probably simple and has likely has already been asked but I can't find it anywhere else on here.

I currently have context, delta, and omega installed.  I'm currently using the content block to hold my slider on the home page but it keeps on showing up everywhere throughout the site.

Same for the postscript first and second blocks.  I have two different views in there and they keep showing up throughout the site, everywhere those blocks exist.

My question is, is it possible for me to fill those blocks with different content, or should I create my own blocks for the home page instead?

Also, is there a good video tutorial somewhere on using delta and context or just basic page ordering in drupal?

Thanks,


texts: How to replace the title of the profile in the breadcrumb, by the name of the user?

texts:
I installed the "Profile" module. I have rewritten the url with the username instead of the profile title.

When I visit a profi, the url is corect but the breadcrumb is still indicating the title of the prodil.

How to replace the title of the profile in the breadcrumb, by the name of the user ?


texts: Keep getting "Bad request" messages in browser after adding JS

texts:
I have added this script in my Drupal 7 site to make the site remember the last clicked Quicktab and then open that tab on page reload:

// JavaScript Document
(function($) {

    Drupal.behaviors.quicktabsTabMemory = {
      attach: function(context, settings) {
        // The .each() is in case there is more than one quicktab on a page.
        $('.quicktabs-wrapper', context).each(function () {

          var $this = $(this);
          var wrapperID = $this.attr('id');

                var nid = settings.nordtec_klister['currentNid']; // getting the nid on the client side

          var $activeTabLink = $('.quicktabs-tabs li.active a', context);
          var activeTabLinkID = $activeTabLink.attr('id');

          // Use a unique cookie namespace for each set of Quicktabs, which
          // should allow for more than one set on a page.
          var cookieName = 'Drupal-quicktabs-active-tab-id-' + wrapperID + 'nid='+ nid;
          // Default cookie options.
          var cookieOptions = {path: '/'};

          // Click the tab ID if a cookie exists otherwise set a cookie for
          // the default active tab.
          var $cookieValue = $.cookie(cookieName);
          if ($cookieValue) {
            $('#' + $cookieValue).click();
          }
          else {
            $.cookie(cookieName, activeTabLinkID, cookieOptions);
          }

          // Set the click handler for all tabs, this updates the cookie on every
          // tab click.
          $this.find('ul.quicktabs-tabs a').click(function quicktabsCookieClickHandler() {
            $activeTabLink = $this.find('.quicktabs-tabs li.active a', context);
            activeTabLinkID = $activeTabLink.attr('id');
            $.cookie(cookieName, activeTabLinkID, cookieOptions);
          });
        });
      }
    };

})(jQuery);

This works as a charm, BUT ever since I added this I keep getting this message in the browser (Chrome)...

Bad Request
Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit.

...after maybe 1 or 2 working days of browsing the site, adding and editing content (many tabs open with different pages etc). I can only assume that it's not a coincidence that those error messages began to show soon after I added this script.

So my question is: What should I do in order to avoid those messages? Clear out all cookies after a certain time? I have tried to limit the cookie life time to 28800 seconds and also the garbage collector life time to that same value in settings.php:

ini_set('session.gc_maxlifetime', 28800);
ini_set('session.cookie_lifetime', 28800);

This helped some, the messages does not occur as often after this, but they do still happen once a week or so.


texts: Not able to add new CCK field to custom content type

texts:
Today all of a sudden I found out that I can no longer add custom CCK fields to any of my custom content types. The right most drop down box to select the field type is now disabled!!

When I try to add to the field anyway, I get an error:
Add new field: you need to select a widget. But I just can't select the widget type. The combobox is disabled.

Any ideas on why is this happening? We are running Drupal 6.22

Thanks!


texts: How can I filter nodes by term (entity reference) with jsonapi?

texts:
My nodes contain an entity reference field, Ref Term.  I want to fetch a list of nodes that have a specific term with jsonapi.
In jsonapi, when I fetch nodes, the field with the taxonomy term reference is returned like this:
"field_ref_term": {
"type": "taxonomy_term--my_vocabulary",
"id": "b1a97358-9834-499d-aee0-ebb0302fb2c3"
},

So, first, I tried this:
/jsonapi/node/my_content_type?filter[field_ref_term]=f9c171db-1a1d-4d9a-bb55-5b0f8b033749

However, that gave me an error:
"title": "Bad Request",
"status": "400",
"detail": "Invalid nested filtering. The field `field_ref_term`, given in the path `field_ref_term` is incomplete, it must end with one of the following specifiers: `id`.",

So I tried adding [id]:
/jsonapi/node/my_content_type?filter[field_ref_term][id]=f9c171db-1a1d-4d9a-bb55-5b0f8b033749

That gave me a different error:
"detail": "You must provide a valid filter condition. Check that you have set the required keys for your filter.",

So I tried a longer version:
/jsonapi/node/my_content_type?&filter[term-filter][condition][path]=field_ref_term&filter[term-filter][condition][id]=f9c171db-1a1d-4d9a-bb55-5b0f8b033749

That gave me the first error again.  I read the documentation on filtering.
How can I filter my nodes based on which are tagged with a specific taxonomy term?  (In my case, each node has one and only one taxonomy term in its entity reference field.)


texts: Using Photos Albums and enabling plupload, there's no way to upload

texts:
I'm attempting to use photo albums to make a photo gallery. if I don't select the Plupload checkbox for file uploads, when I add content, I have the facility to upload 5 different files. When I select that checkbox, there's no actual way to upload the files anymore. I just see the screenshot I included.

I'm using 8.8.5 & Plupload 3.1.2, but even with Plupload 2.3.6 or 2.1.9 the result is the same. I don't see anything specifically enlightening in the JavaScript console.


texts:
I want to build a product where separate organizations will have their separate data ( content , users, etc.) Is it possible using drupal ? If yes, how should I begin?
I have made community websites in drupal but in these ,only one database table is used. how to use different databases for different organizations?
Thank you!


texts: Bundle field validation with Feature in Drupal 8

texts:
How can I have the field validation settings (via the field validation module) bundle with the content type using Features module?

eg: I have a content type Post and a field validation that says post's title must match a certain regex. I need to bundle this logic up with Features.

Thank you!


texts: How can I access all values of a multi-value field?

texts:
I am using Drupal 8 for a project for learning purposes. In my case I want to access to a field which contains multiple values, but I can't find how to do that. For example for a single value field I can access it like this:

kint($variables['node']->field_name->value);

But how can I get all the values of field which allows more than one value?


texts: How to add links in the title for a profile text field

texts: so i have this as a check box for profiles and it is being shown on the registration page as well "I accept the Terms & Conditions and Privacy Policy." and i need to make Terms & Conditions and Privacy Policy links that point to their respective pages. also i'm using Drupal 6


texts: Anonymous session data is being carried over for another user

texts:
I am saving form values to a session variable for anonymous users in a WebformHandler using the following code:

$values = $form_state->getValues();
// set session vars
$session = \Drupal::request()->getSession();
$session->set('user_signup_data', $values);

I've just discovered that data from a previous submission is sometimes still present for a new (anonymous) user.

Could this confusion perhaps come from users being on the same network, or the fact that they are both anonymous users?

Is there anything special I need to do to prevent this?


texts: How to customize a node--type.html.twig template?

texts:
I activated the devel and devel kint modules. I also activated twig debugging, so, I can know which are templates used by Drupal.

So, I created a content-type named album that contains a field named tracks.

Now, I want customize this content type, so I created node--album.html.twig in templates folder of bartik, which works so I can begin to customize this template.

Now, I have to know which are variables used by this template. In comment section of node--album.html.twig I can read that content variable can be used to display content of page. I also read I can use subset of content, such as content.field_example to display a field.

OK, so if I want to modify rendering of field_tracks I can use content.field_tracks. Before using this variable I wanted to know all content variable, so I've written [[ kint(content) ]] in content section of this file. I rebuilt the cache, and I seen that content is an array, not an object as suggested in comment section of node file.

So, if I print [[ content.field_tracks ]] it returns nothing.

If I use kinkt() without parameters it breaks drupal and point me to core/install.php.

The same as I use d() without parameters.

At this point I am confused: there is a way to modify node--type twig templates without creating a file for each field?


texts: Programmatically get View Custom Image filed url

texts:
I have:
$view = Views::getView('ads');

$view->setDisplay('block_9');

$view->execute();
$view_result = $view->result;

foreach ($view_result as $data) {
  $entity = $data->_entity;
  kint($entity->get('field_image_ads')->getValue());

}

A screenshot of Output Kint:

But I want the image URL also.
Thanks.


texts: How to log user in when in the middle of Drupal Commerce Checkout

texts:
I have created a commerce checkout page which, under certain conditions, is presented to the user with a custom login screen

$form['username'] = array(
    '#title' => t('Username'),
    '#type' => 'textfield',
    '#size' => 30
  );
  $form['password'] = array(
    '#title' => t('Password'),
    '#type' => 'password',
    '#size' => 30,
  );

In the submit handler, I log the user in

$username = $form_state['values']['user_login']['username'];
  $password = $form_state['values']['user_login']['password'];
  $login_array = array($username, $password);
  if($uid = user_authenticate($username, $password)) {
      global $user;
      $user = user_load($uid);

      $login_array = array ('name' => $username);
      user_login_finalize($login_array);
    }
  else {
    drupal_set_message('Invalid username or password');
  }

However, what happens is, is on next page, /checkout/order-id/review, it says the user is logged in but page not found. This is because the newly logged in user doesn't have anything in his cart. Is there an easy way of transfering the old cart to this new user? I see that there is a Rule - Assign an anonymous order to a pre-existing user, which I enabled and thought it would do the trick, but it doesn't

In case it helps: there is one rule defined by commerce -- Create a new account for an anonymous order -- which I disabled because I don't want that functionality. I don't know why this would effect anything, but just mentioning it in case it does.


texts: Drupal Commerce Paypal WPS - Connection refused

texts:
I am trying to get the WPS module to work for Drupal Commerce but I am getting an error. After the payment is made in my logs I see.

  Attempt to validate IPN failed with error -111: Connection refused

The code that this relates to in the pay pal module is:

// Process the HTTP request to validate the IPN.
$response = drupal_http_request($host, array('method' => 'POST', 'data' => implode('&', $variables)));

// If an error occurred during processing, log the message and exit.
if (property_exists($response, 'error')) {
  watchdog('commerce_paypal', 'Attempt to validate IPN failed with error @code: @error', array('@code' => $response->code, '@error' => $response->error), WATCHDOG_ERROR);
  return FALSE;
}

The $response has an error in it (Connection refused).

As I am using the sandbox the $host is https://www.sandbox.paypal.com/cgi-bin/webscr.

I can confirm that I do receive the IPN from PayPal (some dd() statements proved this), but when we check to see if PayPal sent it, the code falls over.

Any ideas what could be going wrong? I am preusming it is more likley to be enviromental rather than code.


texts:
I have a content type named: lectures

In this content type I have a field collection field named: field_course_video_slide_sync

This field collection consists of 3 fields: field_start_slide_sec, field_slide_title and field_slide_number

What I'm trying to achieve is to rewrite them into this:

field_slide_title

I've tried tpl.php, preprocess_node, field_get_items and views but nothing seems to work. I can't figure out what I'm missing.


texts:
I have a weird problem that the cache won't be cleared. It all began since I added a template file "field--custom-field-name.tpl.php". The field is attached on user entity type.

I put var_dump(get_defined_vars()) to output the available variables that I could use. I modified the file to begin using some of the variables, and cleared the cache. I found that the page is still showing var_dump output.

I tried:

Clearing the cache under performance tab
Disabling/Enabling themes
Emptying the cache* tables in database
Renaming the field template file
Deleting the field template file

I don't have Drush, though.

The page just doesn't go back to normal; it just keeps showing the var_dump() output.

How can I fix this?

-Update-
admin/reports/dblog has nothing useful, clearing cache has no error output.
To me it's like it doesn't remove the var_dump call from cache when I remove/update that field template, and it sticks to somewhere permanently.

I've also checked every file in the same folder, not var_dump or output statements found.

Could it be a bug of drupal cache?


texts: How do I upload an image to the public:// directory?

texts:
Is it possible to upload the picture and set it as user picture?

User picture can be set via $user->picture = $file->fid; user_save($user);but how do I upload the file from a URL to the public:// directory?


texts: How to add an image gallery to content type

texts:
What I need is to let the user add a few images in the content type, and after the user posts Title, Body message, these images should show as a gallery on the node.

I know how to do the gallery via views Gallerific, but how do you add this gallery to a node?


texts: different sidebars for different taxonomy vocabularies

texts: I have few blocks I would like to show in sidebar of term page but not for all taxonomy term, only for a certain vocabulary. I can write taxonomy/term/* but it will appear the block on all term pages. Is there a way to limit it by certain vocabulary?


texts:
I get this error after I have migrated my site from local to live.

  Notice: unserialize() [function.unserialize]: Error at offset 718 of
  1340 bytes in views_db_object->load_row() (line 2251 of
  /storage/content/16/184116/.com/public_html/sites/all/modules/views/includes/view.inc)

And this results in my site not showing my views. I suspect that this could have something to do with me changing "mylocalsitedirectory" to "mylivesite" in DB before importing DB to live site and ending up having a different serialization in Views than what it expects. But how do I solve this?


texts:
I want a means of triggering a different Context depending on the type of file used in a field on a given content type.

I have been struggling with trying to achieve this for a few days/weeks now after recently moving from D6 to D7. After trying it with Panels I've moved onto Context Module and Context Entity Field. I'm hoping I can finally get this sorted so all help appreciated thanks.

I don't know if it's my lack of D7 experience that's causing this. Basically, I'm working with one content type. It has a Multimedia asset field. I allow uploading, adding images and youtube media via url in this field. I was wanting to create a new page context if the field contains youtube video field. If it has an image then let's do another context etc. Only one of these filetypes are allowed per node.

Context Entity Field seems to only work if the Multimedia asset field has something, or not. I was wanting to use context on file type.

Is this possible or am I really missing some simple D7 point that wasn't there in D6?

Thanks

Note that I am using Media Module for this Multimedia asset field.


texts: How do you correctly filter on taxonomy terms to get all nodes matching term or parent term?

texts:
I have a vocabulary (channel) with two levels. An article node can be added to the first or second level (via field_channel). The hierarchy looks like:

channel-1

subchannel-1.1
subchannel-1.2
subchannel-1.3

channel-2 (i.e. [node/1, node/2])

subchannel-2.1 (i.e. [node/4, node/5])
subchannel-2.2 (i.e. [node/6])

I want to filter all nodes that belongs to a term of level 1 (the ones which where assigned directly to the term and the ones which where assigned to one of its child terms).

In other words, filtering all nodes for a given channel (i.e. channel-2) should contain the nodes assigned to that channel directly and all nodes assigned to a sub-channel whose parent channels is that channel. In the example all nodes from 1 to 6.

The JSON:API request looks like:

{{base_url}}/node/article?
include=field_channel,field_channel.parent&
fields[node--article]=title,field_channel&
fields[taxonomy_term--channel]=name,parent&
filter[or-group][group][conjunction]=OR&
filter[channel][condition][path]=field_channel.name&
filter[channel][condition][value]=channel-2&
filter[channel][condition][memberOf]=or-group&
filter[channel-parent][condition][path]=field_channel.parent.name&
filter[channel-parent][condition][value]=channel-2&
filter[channel-parent][condition][memberOf]=or-group

I don't see the error, but it only contains the nodes matching the channel-parent condition. If I remove that condition, the ones matching the channel condition are there. What is wrong with the request.

I also tried the short form:

{{base_url}}/node/article?
fields[node--article]=title,field_channel&
include=field_channel,field_channel.parent&
fields[taxonomy_term--channel]=name,parent&
filter[or-group][group][conjunction]=OR&
filter[field_channel.name][value]=channel-2&
filter[field_channel.name][memberOf]=or-group&
filter[field_channel.parent.name][value]=channel-2&
filter[field_channel.parent.name][memberOf]=or-group

Which gives me an error in the where clause (the empty group at the beginning):

  WHERE (() and (taxonomy_term_field_data.name LIKE :db_condition_placeholder_0 ESCAPE '\\')

BTW: The example could be easily build by using the drupal thunder distribution.


texts: Uploading images in a node with WYSIWYG and TinyMCE 3.4.3

texts:
I am trying to put images in a node with the WYSIWYG editor and TinyMCE 3.4.3.
I uploaded an image, and with the editor I inserted the image in a node; the problem is that at first click the image doesn't appear in the node, and I must try another time to see the image.
Is it a bug?


texts: Flagging entities on behalf of nodes.. Is a dummy user account attached to the node the only way?

texts:
Scenario:
A central node with a field collection that references (entity references) other nodes of Type A.
When viewing Type A nodes, a view shows the field collection items with a non-global flag link.
The flag would be for the Type A node, not any site users.

I don't need any help creating the view etc.

Possible Solution:
When node of Type A is created, a dummy user account is created using rules and is referenced by the node.
The view showing field collection items and the flag link are set up to act as that dummy user.

I don't actually need any help with doing this but I feel like there has to be a better way. This will result in thousands of dummy user accounts for what is a fairly small site feature.

Any non-coding alternatives welcome.. I'm in a bit of a rush with this feature.


texts:
I've migrated a D6 site to a new server and now it's working in a very strange way:

Homepage loads OK
Update.php and install.php loads OK
Any other page (including /admin, /user...) doesn't work. They load but they all show the homepage content instead of the content of that page.

You can see it live in http://www.efetic.com/

I'm not able to access /user, so I can't change any configuration, clear cache, etc. I've ran update.php but it doesn't change anything.

I've read some related issues and most seem to point it should be an Apache/htaccess error. I'm not using apache, but nginx. I don't know much about nginx, but I have other drupal sites working correctly in this same server (although they are all D7, not D6 like this one).

What do you think? It's a Drupal problem or an Nginx problem?
Should I ask in Stackoverflow or Serverfault?


texts: How can I access all of the inline entities in a custom inline entity form validation?

texts:
I have a registration form with inline participant entities like this:

I'd like to add a custom validation that prevents duplicate email addresses for the participants. In the example above, the user should not be allowed to create another participant with the email address foo@example.com.
The participants entity reference field is using the 'Complex' inline entity form widget.
So far I've tried adding an additional validation via hook_inline_entity_form_entity_form_alter() and a callback function in $entity_form['#element_validate']. In this case, I can get the participant entity from the open 'create participant' form via $entity_form['#entity'] in the callback function, but it's unclear how to access the email values of the other participants for comparison.
In a different approach, I added a validation to the entire registration form and tried to get the info from $form_state->getValue('field_participants'). In this case, I get something like:
array:2 [
  "entities" => array:2 [
    0 => array:2 [
      "delta" => "0"
      "actions" => array:2 [
        "ief_entity_edit" => TranslatableMarkup {#1309 ▶}
        "ief_entity_remove" => TranslatableMarkup {#1310 ▶}
      ]
    ]
    1 => array:2 [
      "delta" => "1"
      "actions" => array:2 [
        "ief_entity_edit" => TranslatableMarkup {#1312 ▶}
        "ief_entity_remove" => TranslatableMarkup {#1313 ▶}
      ]
    ]
  ]
  "form" => array:1 [
    "inline_entity_form" => array:3 [
      "field_mail" => array:1 [
        0 => array:1 [
          "value" => "foo@example.com"
        ]
      ]
      "langcode" => array:1 [▶]
      "actions" => array:2 [▶]
    ]
  ]
]

It would seem that the open form email value is at ['form']['inline_entity_form']['field_mail'][0]['value'], but the other two participant entities in ['entities'] have no easy way to access their email value.


texts: Convert a date with format (2017-05-27) to save in node created field

texts:
I've been looking around for a little while for what I thought would be a simple question to answer but I cannot seem to find the answer.

The question is: How can I convert a date with the format 2017-05-27 into a Drupal safe format for saving into the database?

I have looked inside Drupal\datetime\DateTimeComputed but I'm not sure that is the right place. Any help would be appreciated.


texts: How to attach a view attachment display to an Openlayer Data Overlay display?

texts:
[Drupal 7, Views 3, OpenLayers]

THE PROPOSED SCENARIO:

I would like to attach a view attachment display before an OpenLayer Data Overlay display. The attachment display would contain some exposed filters and a table of content data.

Using Better Exposed Filters I could enable auto submit and hide the submit button on the filter form at the attachment display, so both the attachment content table and the OpenLayer Data Overlay displays would get updated via AJAX. This would create a better user experience.

THE ISSUE:

Apparently I can attach view attachment displays to any view display but OpenLayer Data Overlay displays.

THE QUESTION:

Is there any work around or module implementation that could make it possible to attach a view attachment display to an OpenLayer Data Overlay display?

Another way to go would be perhaps having a block for the content data table and its filters. In this case, how could I get the AJAX on the block view to trigger the OpenLayer Data Ovelay view, so both views get the filters applied at the same time?


texts: Migrate: Create term(s) if they do not yet exist

texts:
Question similar to this question here, but this time, I am not doing a separate migration later.

I want to create taxonomy terms if they do not exist while processing a record. Does entity_lookup do this in the same way migration_lookup does for stubbing? In this case, I won't be doing another migration to fill in a stub, but surely there must be a way to create a term and keep going.

I don't see anything in entity_lookups plugin indicating it will create if not found.


texts: Database password changed and I am not able to access my site

texts:
I am using xampp for the hosting for my drupal site
I started with no password for the database root, and I used this database in the installation process of my drupal site where user name is root with no password.
Then I changed the password of the root from the xampp local host. Now I am not able to access my drupal site any more, and I don't no from where I can configure the password of the database for drupal.
How can I solve this problem?


texts: How to exclude contributed modules from being upgraded when we run composer install or composer update?

texts:
I want to exclude contributed module Ubercart from being upgraded when we run composer install or composer update ? What change should I add in the composer.json so that it ignores ubercart contributed module ?
Seems to be simple question, but I have not been able to figure it out.


texts: Customizing form for product attributes and features?

texts:
I'm trying to create a crowdfunding site using Ubercart. However, Ubercart has recently shown a certain lack of flexibility when it comes to how it interacts with my custom content types.

I feel that the content type "research project" should not have an SKU that should be set by the project creator, and there is currently no way to set the project goals if one is merely a user and not an admin, as the project goals and deadlines are features, not attributes.

The problem, for me, is that I cannot figure out how I am to change the way in which attributes and features can be changed by privileged users, and I am not sure how to automatically set an attribute (e.g. programmatically creating IDs to put in the SKU field).

Thanks in advance. :-)


texts: Pathauto taxonomy terms in content paths

texts:
I'm using pathauto and want to set it up so that when a new page is created (which has the taxonomy field) it will add the taxonomy terms into the url. For example, if I have the following vocabulary:

Page Categories

About
Articles

When I create a page called 'My Page', and select 'About' as the taxonomical term, I would like the url to be http://example.com/about/my-page.

I've messed around with the URL Aliases settings page but 'Taxonomy term paths' does not apply to Basic pages.

I've looked everywhere for this and I'm going crazy.


texts: How to compute and display value of some fields?

texts:
I'm facing the issue but not found the way to resolve. is there any way to help me this.
The issue is that I want to display the total value (included sum and get percent, etc) of some fields depend on what value user select in list.
Value in table like that

Table locations:

Example:

ID Name values

1  US   20%
2  UK   30%

Table Products

Example:

ID Name  Price
1  pro_A 10$
2  pro_B 20$

And what I want to display is to show the list locations and products to let user select as list.

Example: when user select us and pro_A, I want display a total field and computed it (10$*100)/20

Anyone can help me this or help me organize infomation by other ways as long as I can get the same result.


texts:
I have something like this. How can I make $upload_items be a nested
 list under Upload examples

Something like

 Upload Ex

 YAY

What I have now

$upload_items = array(
  'PDF',
  'Video',
  'PNG, GIF, JPG, JPEG',
);
 $step_items = array(
    'Upload Examples',
    implode('

',$upload_items),
    'Describe The Project',
    'Assign Tags',
    'School/Company',
  );
 $form['step_list'] = array(
    '#prefix' => '

',
    '#markup' => implode('

', $step_items),
    '#suffix' => '

',
   );

Also, what is an easy way to add ids to these


texts:
I have inherited some bad code in a Drupal 7.x site and it needs to be cleaned up.  Several places in the code the URL is hard-coded and I want to change that.  For example, in many of my javascript (.js) files I have something like this:

var url= 'http://dev3.ws.mysite.com/index.php/api/alerts_mix/x-api-key/blahhhhhhhhhzBkfqPTq4SWuCiLONePNfschNft';

In the PHP code I have the following:

     $url="http://dev3.ws.mysite.com/api/checkin/x-api-key/blahhhhhhhhhuRCMIWM0Nw0rM2cDK7tTJTPW?uid=11&lt="

First question...is it OK to have the entire URL for the API (including the key) hard-coded or should we be calling this some other way?

Second...for both the js and PHP, what can I use in place of the HTTP and domain (http://dev3.ws.mysite.com) so it is a variable and gets those values from the config files so I don't need to change this every time when making a new dev site?


texts: How do I hide the entire parent (top) level in superfish?

texts:
Using the Superfish module, I need to show just the second level and below. That means, hide the entire first (parent) level and only show the child level based on the current page.

Is this possible?

I tried editing the Superfish block and changing the menu depth, but it doesn't allow me to choose the depth to exclude above it.


texts: How to get the vocabulary terms for the current language

texts:
How do I programmatically get all the terms within a vocabulary for the current language?

This is a similar question to Get translated term name, but not for a single term, but for the entire tree.


texts:
Hello i was using the floating Block module to keep my right hand main menu in a fixed position as a person scrolls down the page. Then i deceided that maybe its overkill just for one menu and i have tried it with css.

#sidebar-left {
 position: fixed;
    top: 0
float:right;
  right:20px;
  width:110px;
}

My theme is fixed width but im getting differant results when viewed in differant screen resolutions.  I was wanting the block to just appear to the right of the the 2nd right hand block (with the logo). Try as i might though im struggling to achieve it.

You can view my site (and the right hand menu) here-
http://onlinebanter.com/welcome

Can anyone help me achieve this?

Thanks


texts:
I have a news page on my site, and I'm displaying it using Views and Display Suite so the image is along side by side to the description of the news. In Manage Display for News Content Type I want to display 1 image on the teaser view, then when the user clicks through it shows all images for that news item.

But when I set #1 in manage display, and click save, it doesn't save the setting. If I have more than 1 image for the news item, it displays all of them in the teaser when I only want to show 1. Can anyone advise?


texts: Attaching a block to a view create with the User type

texts:
I have created a view using the User type.  The view has 2 entity relationships to a location content type and a manager content type.  With this I have setup contextual information relevant to the user's location and manager.

Now I need to add a generic video into the view as well.  I have created a video content type and have it displayed using mediaelement.

My question is how do I add this content to my user type view?  I am not sure if I am missing a really obvious way of doing this :p

I initially thought that I would be able to create a separate block view for the video then attach it to the original user view - but no luck there.


texts: POST parameters not received in drupal module

texts:
I am sending a POST to a Drupal module. How can I receive the parameters values in the module and display?

I have tried using $val = $_REQUEST[''], $_POST[''], $_GET[''] but it is just showing the null value.

I want to get the POST request and send the response back in JSON.

function module_menu(){
  $items = array();
  $items['page-json'] = array(
  'title' => 'JSON Output',
  'page callback' => 'json_page',
  'page arguments' => array(1),
  'access callback' => TRUE,
);
  return $items;
}
function json_page(){
  $dt = $_REQUEST['param'];
  return drupal_json($dt);
}


texts: How do I get a list of nodes that have a reference to a given user?

texts:
I can get a node's referenced users like so:

$users = $node->get('field_allowed_editors')->getValue();

But how can I get a reverse list? Getting all the nodes that have a certain user referenced?


texts: Undefined index: access in node_reference_node_reference_field_formatter_prepare_view()

texts:
I just migrated my site from Drupal 6 to Drupal 7 and it all seems to have been successful, except when I go to a node page, or the admin/content page.

I'm getting a WSOD. I can find nodes through existing views, but when I click the link to the node, it's just the white screen. I checked the log messages and it looks like this is the error I'm getting:

  Notice: Undefined index: access in
  node_reference_field_formatter_prepare_view() (line 408 of
  /sites/all/modules/references/node_reference/node_reference.module).

Is anyone familiar with what might be causing this? The function on line 408 is this (the 4th line is 408)

foreach ($displays as $id => $display) {
  if ($display['type'] != 'node_reference_nid') {
    foreach ($items[$id] as $delta => $item) {
      if ($item['access']) {
        $items[$id][$delta]['node'] = $entities[$item['nid']];
      }
    }
  }
}


texts:
I've created a views slideshow which uses a custom content type for each slide.
However I want to prevent any user to access these nodes using the url itself like .../node/1.
There seems to be a module from another stackoverflow post, but it's not supported by drupal 8.


texts: Show or hide fields in view based on a user relationship

texts:
I have a table on my site made with views. I have the User Relationships module installed so users can connect with each other.
I want most of the fields to be visible for all users but there is one field that must only be showed if the author of the content and the logged in user have a relation with each other.

Is this even possible? I have tried different settings.
It is possible with a filter criteria to hide the complete node if the users aren't related. But that is not what I want. It is just one field of that node type that must be hidden if the users aren't related.


texts: How to make subprocess & migration_lookup plugins behave consistently with single and multiple items arrays

texts:
I have a JSON that can hold single or multi values arrays and I can't make subprocess + migration_lookup behave consistently. It correctly imports the nodes in all cases, but it adds the reference to the imported nodes (entity reference field) only when I have more than 1 item in my array.
my JSON can looks like this:
"behaviour": [
          {
            "name": "behaviour name",
            "description": "behaviour description"
          }
        ]

or like this:
"behaviour": [
          {
            "name": "behaviour name",
            "description": "behaviour description"
          },
          {
            "name": "another behaviour name",
            "description": "another behaviour description"
          }
        ]

the process part of my migration config:
  field_behaviour:
    plugin: sub_process
    source: behaviour_array
    process:
      target_id:
        plugin: migration_lookup
        migration: import_behaviours_json
        source: name


texts:
I need to move the payment method from the checkout page in drupal commerce and embed it into the cart page. is that even possible? I have been finding some resources and it does not lead me anywhere.

I believe I will need a custom module for this and which hook should I used for presenting a payment option in the cart page and when hitting 'checkout' button it will just go and review everything. so payment is processed in the cart page also.

thank you


texts: Fast way to get translations of all installed modules

texts:
I have a site with a lot of modules. Now I need the german translation (if available) of all this modules.

Is there a faster way than downloading and importing them one by one?


texts:
I need to override by views my hierarchical taxonomy term paths:

www.example.com/[vocabulary name]
www.example.com/[vocabulary name]/term1
www.example.com/[vocabulary name]/term1/term2
www.example.com/[vocabulary name]/term1/term2/term3

Where

term1 has depth = 0
term2 has depth = 1
term3 has depth = 2

Vocabulary terms:

+ term1
-- + term2
---- + term3
---- + term3.a
---- + term3.b
-- + term2.a
-- + term2.b

+ term1.a
-- + term2.c
-- + term2.d
-- + term2.e

Paths have been configured by Pathauto

If the path leads to term with depth = 0 I'm using view display "Page".

If the path leads to term with depth = 1 I'm using view display "Page - category".

If the path leads to term with depth = 2 I'm using view display "Page - subcategory".

I tried to use Taxonomy Views Integrator to override the paths by Views, and it's working, but there is one disadvantage in this solution:

If I add a new content and create a new term (with the help of the Simple hierarchical select module ) then I'll be forced to edit this term and select the appropriate view  to override this term path. It might be very time consuming with many terms, so I'm looking for another solution.

How to set a view display for a specific term depth?


texts: Get cron to process QueueWorker items at a specific time

texts:
I have a Plugin\QueueWorker that creates a queue of emails to send from nodes that are created/updated throughout the day. I've defined a processItem() method, as well as an arbitrary function (let's call it mymodule_add_to_queue()) that runs $queue->createItem() to add the node to the queue. When cron runs, all the items in the queue get run, which is fine and dandy.

The only problem is that cron is running every hour, and it seems the QueueWorker class will run the process every time, when I only want it to run once, say between 2am and 3am.

I have the code that checks the REQUEST_TIME and the state of the last time it ran and all that, however I don't know where to put it. Even if it goes into hook_cron(), it doesn't appear to make any difference to the default behaviour.

Pseudocode for what kind of thing I'd be expecting to happen is:

<?php

// @file src/Plugin/QueueWorker/MyModuleCronQueueWorkerEmailSend.php
class MyModuleCronQueueWorkerEmailSend extends QueueWorkerBase {
  public function __construct () {
    this.auto_cron = FALSE;
  }
  public function processItem() {
    doSomething();
  }
}

// @file mymodule.module
function mymodule_add_to_queue() {
  $queue = \Drupal::queue('mymodule_queue_worker_email_send');
  $queue->createItem(['foo' => 'bar']);
}

function mymodule_cron() {
  if (some_cron_conditionals()) {
    $queue = \Drupal::queue('mymodule_queue_worker_email_send');
    $queue->process();
  }
}

... this may be completely out of scope though, or there may be a really obvious other method I'm missing. Any thoughts? As always, thanks in advance :)


texts: Using Exposed Form to filter by referenced entity

texts:
First, I'd like to start with my content structure:

Classrooms:
Title
Students_Attending [entity reference field with multiple values]

Students:
Name
Gender
Country
Classes
Avatar

Ok now, let's say I have a View that essentially lists Students. It has exposed fields for gender, country, and classes. You can use these to narrow down the subset of students listed by the view.

I want to add another exposed filter to this view. This filter will be a select box with a list of Classrooms, and you are able to select multiple classrooms. What this does in practice is that it limits the resulting subset list of Students to those that are referenced by the "Students_Attending" entity reference field of the "Classroom(s)" that was/were selected. So if I select "Classroom 1" on the exposed filter, the View will only list students who are referenced by the  "Students_Attending" field of "Classroom 1."

How do I achieve this with Views on Drupal 8? Is it even possible with Views alone?


texts: Drupal apache solr org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Error initializing QueryElevationComponent

texts:
I have set up apache solr for drupal

i am using solr4.7.2 and latest drupal apache solr module

i have setup everything but in solr panel i get this error

org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Error initializing QueryElevationComponent.

i think this is becuase of the code in solrconfig.xml

<searchComponent name="elevator" class="solr.QueryElevationComponent" >
<!-- pick a fieldType to analyze queries -->
<str name="queryFieldType">string</str>
<str name="config-file">elevate.xml</str>

but this code is provided by apachesolr module of drupal

i don't know what this code does or required or not. I spent hours but couldn't resolve it.

Thanks in Advance


texts:
I would like to show nodes grouped (aggregated?) by taxonomy term like this:

term 1

node1
node43
node34

term 2

node23

etc. but I am not seeing such grouping when I enable aggregation. I can get sg similar with table style and group by column but this only works for the current page, not if I have a paged view.

Any tips? What would be the steps to achieve this with aggregation?

Similar question but for D6

https://stackoverflow.com/questions/2712856/how-do-i-make-a-view-that-groups-nodes-by-taxonomy-term
https://drupal.stackexchange.com/questions/18320/print-nodes-grouped-by-taxonomy-term-name


texts:
I want to hide the titles of the webform by using Exclude form display module.
I installed and given permission for anonymous user to use it. For all webform I am having a common template file that is webform-form.tpl.php. In this template file I am printing the title of the webform like below

print $form['#node']->title;

I thought because of this the module is not working, So i decided to check the checkbox of Exclude title from display is checked or not in this template file. I am not getting exclude_node_title varibale in my template file. So please help me to get this in template file.


texts:
I have written a module that creates a node type and I want to put in a warning on uninstall that lets the user know that the nodes created under that node type will be deleted if they continue to uninstall the module.

Now someone suggested that I use the confirm_form function. But I don't see how this would work or even apply in this case since it has to integrate with the hook_uninstall function for the module.

Any thoughts on this? Thanks!

EDIT: This module is written in Drupal 6 with a Drupal 7 version coming once this one has been approved by the Drupal community (my first community posted module, so I am not yet sure how to create the separate version branches yet).


texts:
I am setting up a contextual filter for several taxonomy fields on a content type that stores my organizations records.  I want to present my users with a nice looking url, not the TID.  For the contextual filter, I have selected Provide a Default Value and selected Use PHP Code. This is the code:

$term_name = "Open";
$termObj = taxonomy_get_term_by_name($term_name);
$term = reset($termObj);
return $term->tid;

For now, I'm hard coding the term until I can get it working, then I'll switch it to a term out of the URL. When I save the contextual filter, the preview shows "No query was run". After I save the view and visit the page created by the view, Drupal gives me a Page Not Found message.


texts: how to include globals.php in template.php file

texts: I need the variables from the globals.php and I can't seem to call/register them in theme's template.php file. These variables are needed for my custom hook function for the template. Am i missing something (since it's been global and be called somewhere else during rendering)?


texts: Are there any security implications for having the Temporary Directory inside the Drupal root folder?

texts: I'm having trouble finding the tmp dir of a particular host and I'm wondering if there is any reason not to just stick it inside the Drupal root.


texts:
I need a link with another render array around it. More specifically I need a link around an image.

In the D7 days I'd just use a render array of type link and then set HTML to true and set the text as the image.

I was hoping to put it in a preprocess function.


texts: User/register Page is not found in Drupal 6 site

texts:
The user login and user register page are not found in my drupal 6 site.It was working fine until before yesterday and I changed the user login page link as www.sitename/user instead of www.sitename/user/login but the register page is still not found.

Is there any way to get back the user/register page? I didnt installed any module recently.

Thanks in advance.


texts: How to re-render a particular field in template_preprocess_node or template_preprocess_field?

texts:
This is really really easy in Drupal 7: just use field_view_field or field_view_value. Choose the latter if you want to re-render a particular field value, or the former if you want to re-render the whole field (label and all values).

However, I couldn't figure out how to do this in Drupal 6. I resorted to implementing hook_nodeapi and changing the node content before it was rendered. This approach cannot be implemented from the theme, though, I'm looking for a theme solution.


texts: Custom template not used for custom entity generated with Drupal Console

texts:
I have created a custom entity via drupal console, and it created template item_entity.html.twig in template folder, but the entity is being rendered in some other way because any changes in template not work. How to make it rendered through the CREATED custom template?

Edit:
After editing hook_theme as here suggested the problem was solved.


texts: How to style a programmatically created page with a template?

texts:
I'm struggling with understanding theming pages with templates. I'm stuck with creating a new template for a programmatically created page. I have a module that shows a download page for a file. The page is basically a form where user can click Submit and get their file downloaded. I construct the whole form programmatically in a page callback. But what if I want to style it with a template? I fail to see how to do it. Here is my (simplified) code:

// Implements hook_menu()
function mymodule_menu()
{
    $items = array();
    $items['file/%mymodule_mycustomfile/download'] = array(
    'page callback' => '_mymodule_filedownload',
    'title' => 'Page Title',
    'page arguments' => array(1),
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
    );
    return $items;
}

// Implements autoloader %mymodule_mycustomfile
function mymodule_mycustomfile_load($fid)
{
    return ($fid > 0) ? (object)array('fid' => $fid) : FALSE;
}

// Page callback function
function _mymodule_filedownload($mycustomfile)
{
    return drupal_get_form('_mymodule_filedownload_form', $mycustomfile);
}

// Creates page form
function _mymodule_filedownload_form($form, &$form_state, $mycustomfile)
{
    $form['label'] = array('#type' => 'item', '#markup' => 'File ID');
    $form['fid'] = array('#type' => 'item', '#markup' => $mycustomfile->fid);
    $form['submit'] = array('#type' => 'submit', '#value' => 'Download');
    return $form;
}

// Submit button click handler
function _mymodule_filedownload_form_submit($form, &$form_state)
{
    die('On Submit');
}

You can see that I construct my form fully in _mymodule_filedownload_form(). But I want to have something like file-download.tpl.php for it and put things like Label there. I fail to see how to do it. My problems are:

1) I stumbled upon theme_hook_suggestions and by default Drupal suggests the following template names: page__file, page__file__%, page__file__1, page__file__download. When I created page--file--download.tpl.php and went to /file/1/download, my screen went blank. I do not know how to output my form in this file and I'm afraid I do not even want to restyle the whole page. I only need to style the page content (the form itself) and leave the page alone. Why can't I have file--download.tpl.php if I have node.tpl.php and comment.tpl.php?

2) As a side note, when you execute template_preprocess_page(&$variables) on node pages, you can see the defined $variables['node'] that contains full node object. How is it done? Can I possibly have something like $variables['mycustomfile'] on my file download pages?


texts: block_views module doesn't show created views

texts:
I installed the Block Views Visibility module on Drupal 7.23. I cleared the cache with drush cc all. There are several views I created. I also created a new block. If I click 'Views' there are no views except 'all_articles_view: Page' which I didn't create.

Do I have to do additional things?


texts: 7 - Views 3 - Displaying taxonomy description in a block

texts:
I am trying to create a view displaying a description of the current taxonomy term. This view will be a block in the taxonomy/term/% page, so the idea is that it uses the argument passed to pick the description in the database.

My view works fine in the Views' preview but does not display any result on the pages which  probably means that the argument is not passed to the block. Can someone help me fix my view?

EDIT

Contextual filter

The URL is /taxonomy/term/% and I am using pathauto aliases.


texts: How to render CCK image field within page.tpl.php

texts:
I have my image field's array $node->field_blog_image, but how do I render it as it does in the $page['content']?

The URI confuses me as its simply public://my_image.jpg


texts: is there a way to customize url alias by content type?

texts:
I have several contentypes, url alias are working fine, by default if there is a space in node title (or another token) is replaced with a dash "-", is it posible to change that beheavior by contentype and only on this special contentype replace spaces with nothing? example: my special contentype node title is= "word1 word2", this is replaced by "word1-word2", and i need to be "word1word2".

EDIT: i have allready pathauto module installed and working, path aliases are working fine, i need to change de default separator settings from a dash to "nothing" in one contentype only. Both answers bellow do not help me.


texts: Setting up video for Drupal- to play in popup

texts:
I've set up a Drupal website and would like to have video box that pops up when a user clicks a picture graphic. Sounds simple enough, but it turns out it is not straightforward in the land of Drupal, flash, codecs, and iphone... Here's what I'd like:

User clicks a link on my Drupal website, a video box player pops up as a mini-box player for the user to watch in a PC or Mac.
For iphone users, want the ability for them to view video on iPhone (which means it can't be flash).
Here's where I am so far. I recorded a screencast using both Camtasia for Mac and Screenflow. But I don't know which format to encode the video- or how to.

I've read that JW player (long tail video) is a good player because it will play both flash and HTML (good for iPhone), but then also read that Drupal and JWplayer does do a popup video window from a link. Is that true?

So before embarking further, I'd love some input on how to proceed? Which encoding format, how to achieve pop-up video player, and have ability to play on iPhone. Of course all through a Drupal site. Btw- I would be hosting the video on Vimeo, or Amazon's cloudfront.


texts: How to refer to a custom field in a node template?

texts:
For the basic page content type I added a custom boolean field called field_login_required.

In my node template node--page.html.twig I have

{{ title }}

    {% if content.field_login_required %}
        {% if user == 0 %}

You must be logged in to view this page Please click here to login

        {% else %}

{{ content.body }}

        {% endif %}
    {% else %}

{{ content.body }}

    {% endif %}

However content.field_login_required is null no matter whether the checkbox is checked or not. To test what was available I used

{{ dump(content|keys) }}

However the result of this is

array (size=1)
  0 => string 'body' (length=4)

field_login_required is omitted. Is there anyway to refer to a custom field in a node template?


texts:
Does anyone know how to create an expandable menu like they have on this page?

http://www.geofunders.org/events/geocc/registration

Note: scroll down to see the menu under 'Conference Policies'. First one is 'Participant Eligibility'.


texts: How to ask drush to add timestamps to output?

texts:
Some of the steps in our drush-make process take a while and having timestamps in the build-log would be useful -- for every line.

Is there a way to do this already, perhaps? The DRUSH_BACKEND pieces of JSON contain timestamps (seconds since Unix epoch), but they aren't shown for every step. Perhaps, there is something like a --timestamp flag in drush already?


texts: Configuring Drupal 6.20 to display a different icon in a specific region on a specific group of pages

texts:
I've added a block called 'Course Information', configured the block to display on a particular group of pages (courses/full-time/*). This works fine, but I don't know to configure Drupal to display a different icon for each of the pages.

At present, the block contains:

<img alt="An icon symbol" src="/sites/default/files/images/icon-1.png" />

This will display the same image on each page that the block is used. How would I go about having a dynamic filename inserted, like icon-2.png, icon-3.png, icon-n.png?


texts: added files to module: use drush to upgrade to a new version of this module will added files be deleted?

texts:
A co-worker has added a couple of .css files to the quicktabs 3rd party module.  What will happen if you use drush to upgrade to a new version of this module.
Will these added files be deleted or kept as-is?


texts:
Situation

We use gmap module to generate gmap and display markers on it.
When user click on marker we display popup, it works well if website display 100-200 markers only, however when it gets to 1000++ Drupal can't display such page.

Issue

Issue happens because Drupal exports all required information to display popup directly on page and it takes to much time generate that.

What I've done so far

I googled and did not find anything that could help me.
I know that google map API may deal with feed/xml (that's a direction I'm moving to), however I do not wanna create new wheel if it is already exist.

Thanks!


texts:
In Drupal 7 is it please possible to enforce all new users to upload an avatar picture during the registration process? I.e. how to make the user picture field mandatory?

When I try to edit the registration form fields at /admin/config/people/accounts/fields there are no settings for the user picture, I only see it being an account widget:


texts: Using RegEx with Rules to compare email addresses

texts:
I have a client content type with an email address and when a user creates an account I want to verify the users email address with the email address of the client content type to make sure that the user is an employee of the client and if so let them create an account.

My question is, can I make a rule which uses Regular expressions to compare the domain name of the two email fields?

Thanks

Kieran


texts: Drupal 7 Site Structure - Moving From Wordpress

texts:
I need a little advice or guidance on the structure of Drupal 7. I have used Wordpress for a number of years and I know it very well. Moving to Drupal 7 has got me a bit confused if I'm honest. Take an example of a news page which may have a description and possibly an image at the top then afterwards gives a list of news posts.

In Wordpress (including the Magic Fields plugin to create custom fields) I would create a news page type and news post type. Each would have there own template file. In the news page template file I would output the fields of page then call the Wordpress loop which would give me the list of news posts.

In Drupal 7 I understand that I would create two new content types news page and news post. I would also have two template files - page--news-page.tpl.php and page--news-post.tpl.php. What is the best practise for getting a list of the content type "news post" (list of nodes)?

I've done some reading on this and looked into views. If I create a view to do this, would I set it to a block then call that block within my "page--news-page.tpl.php". Or is there something similar to the Wordpress Loop?

I understand you can create a view as a page but then I would not be able to have fields specific to that page - like the description and image.


texts: how to get summary of content in following code

texts:
In my block code i have following code in one case:

$query = db_select('node', 'n');
    $query->condition('n.status', NODE_PUBLISHED);
    $query->condition('n.type', 'news');
    $nids = $query
    ->fields('n', array('nid'))
    ->orderBy('changed', 'DESC')
    ->range(0, 1)
    ->addTag('node_access')
    ->execute()
    ->fetchCol();
    $nodes = node_load_multiple($nids);
    $content = '

Latest News
';
    foreach($nodes as $record)
    {
        $content.='
'./*need summarry here*/.'
'.l('Read more', 'node/'.$record->nid);
    }
    $content .= '

';
    $block['subject'] = t('Latest news');
    $block['content'] = $content;

How do i get summary of content in there?


texts:
I applied a patch and I get a Warinig message.

Then it states that the patch was applied cleanly.

Can I trust this?

This is the complete code:

example@d565:~/www$ git apply -v SA-CORE-2014-005-D7.patch
Checking patch includes/database/database.inc...
warning: includes/database/database.inc has type 100755, expected 100644
Hunk #1 succeeded at 733 (offset -3 lines).
Applied patch includes/database/database.inc cleanly.
example@d565:~/www$


texts: drupal_goto not working in hook user login

texts:
I have $u variable which stores the path in hook user login to redirect users to the page.

drupal_goto($u);

I am not being redirected to the page- path $u.
drupal_goto not working.
I have tried everything increased te weight of the module,even tried with $_GET['destination'].


texts: How do I add a custom div with a class to CKEditor?

texts:
I have ckeditor installed via the WYSIWYG module. I need to select a group of paragraphs and give surround them with a div that has a class and end up with this

test text 1

test text 2

test text 3

test text 4

this div could also surround other elements like links, lists, etc. I have no problem adding custom styles but can't quite add any custom formats.


texts: A referenced node is missing--when did it disappear?

texts:
So, I inherited a long-standing and complicated drupal site with a lot of records that reference each other. The site started out in Drupal 6 and these references used to be CCK Nodereferences, but they ported to Drupal 7, and I think things are now mostly entity-references, though there might be a CCK Nodereference here or there.
I'm mentioning this because it's an area that I don't know much about and I think it might be relevant for what follows.

The problem is this:
There are some nodes that are referenced by ID by other nodes that seem to have disappeared. Let's say, for example, we have a content type "Chicken coop", which contains references to 100 "chicken" nodes. If I edit "Chicken coop", I'll see 100 fields, each with a name and value, for example, "Hen 1[nid:1]", "Rooster 50[nid:62]" but one of them will be a null reference. "[nid:4]", and when I build a view to list all the "Chickens", there will be no chicken with nid:4. It's like that chicken got removed from the database and removal didn't propagate to all the things that referenced it like it should have.
Obviously, I'd like to know how this happened, and I've noticed that we have had backups turned on for several years. I'd like to find out when this happened and what other things happened around this time. Did these null references appear at the same time?

I can download the backups and load them into a local mysql instance. How would I query to see if chicken nid:4 is still in them? This does not seem simple or intuitive from the drupal schema I've seen.
Does this problem seem familiar to anyone and do you have any suggestions on whether this was a one-time thing that's not likely to happen again?
Any other logs that you would recommend examining or troubleshooting steps I ought to take?


texts:
I'm using Pantheon and there doesn't seem to be a way to update nginx/apache config.

One of my templates is actually a single page app, and I'd like to tell Drupal to serve /node/1 for a couple of URIs.

Get the current path alias or path? shows how I am able to get the current path in the .theme file.

Is there a way to serve a specific node for certain paths?


texts: Install profile installation fails with "Base table or [error] view not found: 1146 Table 'xxx.system' doesn't exist'" on aegir

texts:
I tried to install a custom installation profile on aegir today, the installation failed with this message:

Exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or
view not found: 1146 Table 'xxx.system' doesn't exist'

A local installation in a vagrant via drush worked without Problems.


texts: How can I translate months of date field?

texts:
How to translate date field in Drupal 8?

I am not able to figure out how to translate months of date field into french language .

I have created a view of content news listing in which news content are listed, i have added date field from backend with custom date format (22 may, 2018) in views,enabled translation for date field also created custom date format for both languages, but month are showing in default language english.

By default its showing in english language (jan,feb,march....).

So I just want to translate the months of date fields into french language like April=avril , I am using default core translation module that is provided by Drupal 8.


texts:
Let's say I want to use $_SESSION['user_variable'] with a view as a filter value. I read that in Drupal 7 I could add such a value with custom PHP code. How should I do in Drupal 8? I didn't find an easy solution so far.

Would it be better to temporarily save a user's choice that is valid for the whole session in the database and tell the view to get the value from there?


texts: How to add a payment gateway with two different accounts?

texts:
I want to add two different accounts for a single gateway . Depending  upon Product_id or product_sku value it should use a corresponding account for payment.

How to do it? I have used the Drupal Commerce module.


texts: How are node and node_revision tables related?

texts:
I've noticed that the following does not work to unpublish nodes:

db_update('node')
  ->fields(array('status' => 0))
  ->condition('nid', $array_of_nids, 'IN')
  ->execute();

But it does if you follow up with the same update on the node_revision table. (But perhaps I should only be updating the status of the current revision (vid)?)

I found this confusing because the nodes in question do not use revisioning yet it seems that the revision table holds more authoritative data than the main node table (so if so, what's the point of node table?)

Can anyone explain how node and node_revision are related and therefore how to do a bulk update such as this 'properly'? (I'd prefer to avoid a costly loop of node_load, node_save if poss.) I'd like to understand the Drupal Way here.

(I have read node revisions which covers D6, but that did not give me the understanding I was after.)