texts:
I have installed my drupal in postgres. I've been using multiple databases in my customized module. Below is my settings.php:

$databases = array (
    'default' =>
        array (
            'default' =>
                array (
                    'database' => 'drupal-7.34',
                    'username' => 'drupal-7.34',
                    'password' => 'drupal-7.34',
                    'host' => 'localhost',
                    'port' => '',
                    'driver' => 'pgsql',
                    'prefix' => '',
                ),
            'import' =>
                array (
                    'database' => 'enrollment',
                    'username' => 'postgres',
                    'password' => '',
                    'host' => 'localhost',
                    'port' => '',
                    'driver' => 'pgsql',
                    'prefix' => '',
                ),
            'import_employee' =>
                array (
                    'database' => 'csudbnew',
                    'username' => 'sysdba',
                    'password' => 'masterkey',
                    'host' => 'localhost',
                    'port' => '',
                    'driver' => 'firebird',
                    'prefix' => '',
                ),
        ),
);

Below is my code in executing the query:

 $query = db_select('EMPLOYEES', 't1',array('target' => 'import_employee'));
 $result = $query
     ->fields('t1', array('LASTNAME'))
     ->condition('t1.EMPLOYEENUMBER','1016','=')
     ->execute();

This is where I get the error.

I aready enabled extension=php_pdo_firebird.dll in my php.inifile. What should I do next? I can query in my postgres databases except in firebird. Do I have to do more configuration?

Ive been following this tutorial. I downloaded the zip file in the site and unzip it in my drupal\includes\database\firebird.


texts:
Is it possible to disable the cache on specific admin pages ?
I'm trying to hide some menu in "admin/structure/menu" but because it's for different roles, the cache has to be flushed to make it work.

Any idea ?

Cheers


texts: I can't change the currency to € for the Drupal Commerce module

texts:
I can't change the currency to €.

In admin/commerce/config/currency I set the currency to €. (see capture 1)

But the products still show the $ simbol.(see capture 2)

Is this a bug?

As StryKaizer commented I need to change it as well in every product. My problem is that I have many products. Is there any way to do it in the database through a query?


texts:
I just moved a site to another server (Windows IIS 8.5). Public images are working perfectly, but private images seem to be broken.

By having a look at the browser's inspector, I can see that when I access an image directly, (e.g. http://example.com/?q=system/files/styles/medium/private/my-image.jpg&itok=AtJsTUJ1) I get a 200 status response, however the browser shows the broken image icon.

So far, I have tried the following things:

Set Drupal's default download method to private / public
Disable / Enable drupal_fast_404() in settings.php
Changing private folder's permissions

Has anyone experienced something similar or can give a hint on where to look for next?


texts: Making responses to public nodes only viewable by the creator and the originator

texts:
I've got a prototype site built in D6, pertinent modules:

CCK
Comment block
Node Comment
Views
Views Or

The site is built around a list of open requests; to solicit a private response. These nodes are of content type Request.

All open requests are public in that all users (logged in or not) can view these nodes.

When a response (comment) is received to an open request it should only be viewed by the author of the original request, or the author of the response.

These responses should be shown to these users on the original node as comments and on a seperate list.

How do I do this?


texts: Does Drupal 8 entities have any events I can listen to?

texts: I know we can use hook_entity_update() hook to do something when an entity is updated. But is there an event to listen for node updates/deletes, or other entities such for that matter?


texts: Drupal search - 2 search pages using their own settings

texts:
I would like to have 2 pages:
- http://domain.com/search-1
- http://domain.com/search-2

Where search-1 is limited to results of contenttype blog and search-2 is limited to results of contenttype news.

I've been looking for contrib modules but cannot find anything.
Please help me out, thanks.

Cheers,
Wietse


texts: How to send an email to select set of users for moderation states?

texts:
We are using the following modules below for content moderation. Currently have we have 5 people with the Content Approver role and all of them are sent an email when a state transition occurs. There is a need to send email alerts of moderation transitions for certain content types that need approval to just 2 out of the 5 Approvers.

How to send an email to select set of users when changing moderation state?

Expected Results:

When a content editor marks a page ready for Review, they are allowed to manually select one or more users to send an email alert to regardless of Role.

Enabled Modules:

Workbench v8.x-1.0
Workbench Email v8.x-1.0-alpha7


texts: How to handle complex redirection requirement?

texts:
I have a content type defined with a field storing the URL for accessing an external web resource and am looking for a way to have my Drupal 7 instance manage the redirection to this external site based on the nid contained in the incoming request path (ie. mysite.com/resource/123 redirects to the location stored in field_data_field_url where nid = 123).

The driver for this requirement is that our partner sites need to publish links to these resources that will not be subject to change. Drupal will house the database of resources and I am hoping to provide an endpoint that handles the redirect without further action from the user.

I have begun exploring the Services module in attempting to solve this problem but am not making headway in figuring out how to ultimately perform a redirection. I would appreciate input on whether this is an appropriate case for this web service approach or should I be looking at another way to tackle this problem within the Drupal framework?


texts: How can I change the author of a node before it is saved with hook_entity_presave()?

texts:
I have added code in a node presave hook before cloning a node as below to change it to the current user id

 $entity->setRevisionAuthorId($current_user);

and then I check with $entity->getRevisionAuthor and it has been changed in that presave function, however upon saving the author reverts back to the author of the original node that was cloned.

What is happening ? thanks


texts: Dynamically modify number of columns in view, responsive layout

texts:
I'm using one of the AdaptiveThemes for a site I'm working on. For the sake of simplicity, we'll say it's a site for set of webseries. On the pages for the episodes, I'd like to have a view that displays thumbnails for each of the other episodes in the series. The view will ideally be setup like Hulu. For example, here, each of the episodes is listed in a slideshow list.

Since the site is responsive, I need to have the number of items displayed change with the size of the window. So, full size might show 4 thumbs, and as the view port gets smaller, it might change to 3 or 2 thumbs at a time. How can I achieve this?

Bonus points if you can give me a hint for scrolling through the list like the hulu site, too. Would that just be an implementation of Views Slideshow?


texts: Tracking new user creation by marketing campaign

texts:
I have a use case where users may be linked to any page on a D7 site with a marketing ID (bound to $_GET) and I need to write this data to a field associated with a new user once they register. I can implement this under the pretense that the user's landing page is on Register (through altering the register_form via hook_form_{ID}_alter(), but if s/he starts from any other page, this identifier won't be preserved if and when they eventually decide to register.

What are my options to best implement this logic across all possible states for anonymous users, while preserving any kind of GET attributes (or cookies) to indicate this source id?


texts: How to guide user through multiple unrelated forms

texts:
I have a content type with a term reference field. I want to give user a convenient way of grouping multiple nodes of that type together. I see it like this:

The user creates a first node
When he goes to a node page, he sees a link "subjoin another document"
After pressing it the taxonomy term creation form is shown, user fills required fields
After saving the term he gets redirected to node creation form
Second node is created, taxonomy term fields of both nodes point to newly created taxonomy term

What puzzles me is how it's best to implement such a multiphase logic in Drupal, when we need to guide the user through several unrelated forms.


texts: Re-indexing of site stalled, & running cron won't advance

texts:
I have a site recently moved from D6 to D7. The search in D7 was not finding nodes containing the search terms, so I began a re-index in the search settings. This has stalled at 11% of site (with 3570 items left to index), and running cron does nothing to advance the re-index.

The log messages show that when cron runs, it encounters this error:

  EntityMalformedException: Missing bundle property on entity of type
  comment. in entity_extract_ids() (line 7766 of
  /var/www/html/[domain]/includes/common.inc).

And this notice:

  Notice: Undefined variable: key in comment_prepare_thread() (line 901
  of /var/www/html/[domain]/modules/comment/comment.module).

Also, there are many instances of this notice, which is associated with use of the site, not cron:

  Undefined index: weblinks in custom_search_form_alter() (line 232 of
  /var/www/html/[domain]/sites/all/modules/custom_search/custom_search.module).

None of these seem to affect the function of the site, and it's not clear to me that they are actually related to the stalled re-indexing. But it's all I've got to go on at this point.

If anyone could give me some ideas for how to troubleshoot this, I'd very much appreciate it.

Thanks!


texts: Quicktabs and views to create tabbed views

texts:
I see that quicktabs uses blocks as tabs.  This is fine if i create 4 views blocks for 4 single items of a content type and then add them to quick tabs manually.

Is there a workaround to show the latest 4 items of a certain content type using quick tabs and views?

Thanks,


texts: Expose a filter to turn a different filter on or off

texts:
I have a view of items that have a due date, and I want to be able to expose a boolean filter "Is overdue by more than 30 days"

I can create a filter on this due date as a relative date filter "<= today -30 days"; however this filter is always active on the view.

The best I've been able to come up with is to add a new boolean field on my content type "date_filter" that is always null, and in the view create a new exposed filter "is not null" (i.e, when active, will always be false).
Then add this filter to a new OR filter group with the above relative date filter. This works, as when the filter is "off" it returns true and overrides the relative date filter. When on, only the rows that fit the date filter are returned.

However, is there a way to do this without adding dummy fields? Ideally a module I can use to do this. I'd prefer not to have to write a hook just for this filter.


texts: Uc_product module for drupal 7 not found

texts: In my Drupal 7 installation, i want to enable the ubercart feeds module but it says :"Requires: Uc_product (missing), Feeds (enabled), Chaos tools (enabled), Job Scheduler (enabled)" . The problem is i cannot find the uc_product module in the drupal website, or anywhere, any help?


texts:
Since Drupal 8 is days away from release, I've started experimenting with rebuilding my personal site on it. The one feature I am really looking forward to is configuration management in code.

Unfortunately, my taxonomy terms are not exported by the config module. From what I've found googling on the subject, neither are menu items.

Which leaves me stumped. The natural way to set a sites structure (or information architecture) is a combination of content types, taxonomy vocabularies and their terms, and a set of menus. Or, at least, that seems to be the natural way to me.

While googling, I could not find any discussion on this subject.

So, how do I export the taxonomy terms and menu items that define my sites structure?

Edit to add some details:

Assume the site is a magazine. It has Fiction, World Events, Technical, and Letters sections. There will always be a /fiction, a /world-events, a /technical, and a /letters menu items. There are several kinds of content types, each can go into various sections.

So I create a vocabulary for the sections.

sections
- fiction
- world events
- technical
- letters

A taxonomy reference field is added to each content type.

Thus, when content is created it is tagged with the appropriate section terms.

If the site deploys without one of those sections, it is broken. Thus the menu items, and taxonomy terms should be considered configuration. Not content.

From what I've read, the main problem is that terms and menu items can collide if you try to move them between instances. Terms have a incrementing tid. Menu items also have an incrementing id. Though I do see the taxonomy_term_data and menu_link_content tables which seem to map uuid's with term and menu item ids. So, couldn't that be used to make exporting them feasible?

Also, isn't one of the main uses cases for taxonomies defining a site's structure?

I guess what I'm stuck on is that some menu items and some taxonomy terms really should be considered as configuration, not data. As in, if I were coding this instead of using Drupal, I'd hard code them. Thus, they should be exportable so that they can be committed to version control.

And that's why I'm asking "How do I export my site structure?"


texts:
I'm running a radio website on Drupal 7 http://punkrockradio.net/
We have podcast that user can listen with Pushtape Player using  Soundmanager2 API.
I have installed DownloadFile.

I would like to give my user the option to listen to the file or to download it.

Any idea?
Thanks in advance


texts: Adding a query string to menu items determined by the current node?

texts:
I'm pretty new to Drupal 8.  I'm trying to figure out how to programmatically add a query string to a menu item link, the specific query string is determined by the node/page the user is currently on.

For example, I've got a link on my primary menu that goes to http://www.example.com

If I'm on the 'about me' page I want the link to add a query string of '?origin=about'. (http://www.example.com?origin=about)

If I'm on the 'contact me' page I want the link to add '?origin=contact', etc.

Are there any modules where this can be done, or how might I go about doing this myself?


texts: Where does drupal determine which theme file to use for an entity field?

texts:
So I've got this problem where file_entity is ignoring the configured video formatter despite triple-checking the GUI configuration. Instead it's being rendered by theme_file_entity_file_video(), which shouldn't be happening.

But it is. So I'm digging back into core to see where the theme function responsible was established. I'm in drupal_render but I'm already seeing the theme function set improperly...

So my question: Where does drupal determine which theme file/function to use for an entity field?

Clarification: my question is, "How/where does the theme registry get built for an entity?" I want to watch it get built with a debugger.


texts: Drupal 8, very simple hierarchical form doesn't work

texts:
In a custom module, I create a new form. In the buildForm function, I define my form :

$form["planet"] = array(
  '#type' => 'textfield',
  '#title' => '1 : '.$this->t('planet'),
  '#maxlength' => 64,
  '#size' => 64,
  '#tree' => TRUE,
);

$form["planet"][0] = array(
  '#type' => 'textfield',
  '#title' => '0 : '.$this->t('land'),
  '#maxlength' => 64,
  '#size' => 64,
);

$form["planet"][1] = array(
  '#type' => 'textfield',
  '#title' => '1 : '.$this->t('land'),
  '#maxlength' => 64,
  '#size' => 64,
);

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

There are 3 fields, but this is the result :

Why there only first field displayed ?


texts:
How can create menu views tabs of node? In Drupal 7 i can create views like this:

when i visit node/1/teaser it's show good.

But with same setting in drupal 8.

when i visit node/1 show error:

  Symfony\Component\Routing\Exception\MissingMandatoryParametersException:
  Some mandatory parameters are missing ("arg_0") to generate a URL for
  route "view.menu_tabs.page_1". in
  Drupal\Core\Routing\UrlGenerator->doGenerate() (line 171 of
  core/lib/Drupal/Core/Routing/UrlGenerator.php).

and node/1/teaser show error:

  Symfony\Component\Routing\Exception\MissingMandatoryParametersException:
  Some mandatory parameters are missing ("node") to generate a URL for
  route "entity.node.devel_load". in
  Drupal\Core\Routing\UrlGenerator->doGenerate() (line 171 of
  core/lib/Drupal/Core/Routing/UrlGenerator.php).


texts: How do I disable APC caching just changing any Drupal setting?

texts: Is it possible to disable APC caching completely in Drupal 8 without modifying the php.ini settings (i.e. only by modifying the Drupal settings)?


texts: When using the search form, by default Drupal searches Content nodes, and there's a toggle to search Users (search/node vs. search/user). But the search/user appears to only search the default fields for the User nodes (username and email). I've added additional fields (Admin > Config > People > Manage Fields) to User nodes, but those don't get searched. How can I make the default search/user find users by those additional fields?


texts: Is there a way to generate thumbnails within Drupal?

texts: I see that Drupal 7 natively includes the GD toolkit. Looking at the documentation, there are Several Functions available to me that would seem to make it possible to, from an existing image, generate temporary thumbnails. The issue, however, is that any of the resizing methods seem to be destructive, and there is no simple way to copy images. PHP, of course, offers facilities that are low-level enough to handle this...and I'll use those if I have to...but is there a simple, Drupal way to programmatically create a thumbnail to a specified size?


texts: How to Bi-directional link two nodes from different content type?

texts:
Hello i am new to Drupal. I have used Joomla for very long time and some wordpress.

I want to link 2 or more nodes bi-directional. Meaning that if i link A to B, B must be also linked to A.

I will give you a simple example:

Lets say i want to make a Lyrics site. Where i will have 2 content types.

1) Artist / Band
2) Song Lyrics

The Artist / Band type will have information about the artist with maybe a photo and textaera for description.

The Song Lyrics will have the actual song lyrics (textaera).

Finally i want to link the Song Lyrics to an Artist / Band. So when i view the Lyrics page it will link to the Artist page. And when i go to the artist page it will link to all the lyrics that are available for that artist.

How can i do this in Drupal 7? Can i do it with the Core, or do i need to install additional Modules?


texts: An AJAX HTTP error occurred during the Drupal module update

texts:
On Druapl 9.1.5, during the Metatag 8.x-1.16 update from the site it gave the following:
 Debugging information follows.
Path: /core/authorize.php/core/authorize.php?batch=1&id=477&op=do_nojs&op=do
StatusText: OK
ResponseText: Warning: Use of undefined constant CONFIG_SYNC_DIRECTORY - assumed 'CONFIG_SYNC_DIRECTORY' (this will throw an Error in a future version of PHP) in require() (line 251 of /public_html/sites/default/settings.php).{"status":true,"percentage":"100","message":"Completed 1 of 1.","label":""}
The line 251 of the settings.php is the following:
 $config_directories = array(
      CONFIG_SYNC_DIRECTORY => 'sites/default/my_sync',
    );
What is wrong with the formatting? Any ideas?


texts: Views conditional fileds: multiple values

texts:
I have a content type with the following field:

List (float) - blue - green - yellow

In the view, I want a condition that says that if the value is "blue" display this: div class="blue"

If it is green display class="green"

If it is empty display class ="empty"

And so on...

I tried Views Conditional Module but it can't handle multiple values...

What is the best way to do this?


texts:
I have a content type that has an image attached. In a View I need to print the full path to the image.

I thought this would be easy but for some reason I cant figure it out. I can find the image field in the view, but when I rewrite the output I cant see any patterns for the file path.

In my view Ive created a relationship to the image field to the node, but this doesn't provide me with any more rewrite patterns, or any fields that look like they could be the image path.


texts: field_image_cache missing from all content types

texts:
I've had a strange thing happen to a Drupal 6 site. All images are missing from the site. Looking at the Edit screen for a node shows that the ability to edit and upload an image for any node is missing.

Further checking the content types shows that under 'Manage Field' the 'Image' field [field_image_cache] has be removed for every content type.

As far as i can see all the correct modules are still enabled.

Anyone got any ideas?


texts: What is the difference between hide() function and unset()?

texts: What is the difference between hide() and unset()? I want to hide some elements, I found hide() and unset(), but I don't know which one I should use.


texts: Setting user picture programmatically doesn't work

texts:
I have a cron hook to check the data of all users for a couple of reasons. One of them is to see if they have a user picture set. If not, i want to give them a default user picture, based on their gender.

I create this picture in the enable hook of my module, and i have a file id. However, when i try to set this on the user, it doesn't work. I've tried multiple things, like:

$picture = file_load(variable_get("default_userpic_$gender"));
$account->picture = $picture->fid;
user_save($account);

or

$picture = file_load(variable_get("default_userpic_$gender"));
$edit = array('picture' => $picture);
user_save($account, $edit);

and several variations along this theme. I've also tried to use a user_presave hook and add the picture to the edit there. However, when i check the user, the picture is still NULL. Does anyone know something that might cause this?


texts:
I'm trying to get xdebug to work with Dev Desktop.

I am following the instructions in this guide:

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

and I still get the message, "waiting to connect" well after it should have already connected and the site is showing in my browser.

My zend_extension also starts out as:

zend_extension="C:\Program Files (x86)\DevDesktop\php5_5\ext\php_xdebug.dll"

And I'm not sure which version to get off of here:

http://xdebug.org/download.php

I'm somewhat lost - I have no problems getting xdebug to work on OSX or Linux, but I seem to be having real trouble getting it to work on Windows


texts:
So I created a custom block and put the block on every page but unfortunately the block causes a white screen... I can't login to change the block because the block is on every page, as I mentioned.
Is it possible using an FTP program to access blocks via the server and delete/change them?


texts: PDO expecption error while adding class to the block with sql server

texts:
"PDOException: SQLSTATE[42S22]: [Microsoft][ODBC Driver 11 for SQL
  Server][SQL Server]Invalid column name 'css_class'.: UPDATE block SET
  [css_class]=:db_update_placeholder_0 WHERE ([module] =
  :db_condition_placeholder_0) AND ([delta] =
  :db_condition_placeholder_1) ; Array ( ) in block_class_form_submit()
  (line 99 of .....\sites\all\modules\block_class\block_class.module)."

Adding class to the block using block class module. while adding class to the block throwing pdo exception error coming. Please any one resolve problem.


texts:
Objective:
To override the default classes and divs that are spit out from the Form-API from my custom addressfield implementation in a Drupal Commerce checkout pane. I need to make the classes/divs predictable based on the number of seperate address forms their are. I dynamically create (x) addressfields based on the number of gift subscriptions (x) so that I can combine address information for subscriptions.

Note:
The addressfield form is a patch from the addressfield module which creates a form element type. This looks like this:

          $form['address'] = array(
          '#type' => 'addressfield',
          '#required' => TRUE,
          '#title' => t('Recipient\'s Address'),
          '#context' => array('countries' => array('AT', 'AS', 'BE', 'BG', 'CA', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'GU', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PR', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB', 'UM', 'US', 'VI'), ''),
          '#default_value' => array('country' => 'US'),
          '#description' => "Please enter the address you want to mail this gift to.",
          '#maxlength' => 60,
          );

However the problem arises when you load the page with the form. Drupal is dynamically creating numbers in the classes/divs that appears to be random. I would like to specify that number so that it conincedes with the number of subscriptions. So when i test i select (2) gift subscriptions and get  and .

As opposed to the current way it does things (screenshot)


texts: How to direct a specific role to a specific page

texts:
This is related to this question:

How do I redirect a user role on login (Drupal 6)?

My biggest problem is that the only rules available as far as I can see are on user login, period, nothing for a specific role. How would I go about setting the redirect ONLY for certain user roles, when using rules?


texts: Issue during Checkout process with DrupalGap Commerce

texts:
I'm trying to build an app with DurpalGap and his commerce module for my ECommerce website.

I've followed your tutorial but I still have some errors (all DPM are activated) :

The first page I made is the product list, following your example.
When you click on a product, the product is displayed but only title, image and add to cart button (I can't reach to have the price and offer displayed... whereas it is configured in the Drupalgap Manage display product)
Issue : cart.json doesn't exist -> I've created a JSON View of "Shopping Cart Form" and It seems to work now.
An issue occured when you click on the add to cart button (no product ID), I've changed "field_product_entities" in the Commerce.JS (line 650 -> SKU) & (line 851 -> Field_produit_entities) and the console doesn't show the error by now.
But now I have : "Failed to load resource: the server responded with a status of 400 (: You must specify a valid order ID)" / POST: https://rechargetonmob.nc/?q=drupalgap/line-item.json - 400 - / ["You must specify a valid order ID"]

How do I manage with it ?

Thanks for your help, I wish you a very nice day !
https://rechargetonmob.nc/mobile-application/index.html


texts:
Using the Adaptive theme on Acquia platform and seeing an issue with mobile rendered views being cached and served to desktop browsers with block regions hidden for mobile display. The issue seems sporadic for certain pages.

Clearing Varnish and/or Drupal caches fixes the issue. I think I know what's happening but not sure why. I'm considering disabling Drupal's cache.

I'm working in a sys admin / back end capacity so am limited, experience wise, as to where to look for the source of the problem.


texts:
I have created a Content Type that allow to download PDF files. Meanwhile I want to have this file available in a html version; as in Modules' notes in Drupal's website.

So the easiest way is to: create this html version as a new node, and use node reference field type to link to this node. But this process takes two steps to do it, and within large nodes it will take while to find the referenced node.

So what is the more sufficient way to add a related node to a content type?


texts: How to display a block-view with fields of a referenced entity when the referencing entity is view in full mode?

texts:
I think the question i got may not be hard to answer, but i'm struck and it seems i can't find any solution.

Basically, I want to build a block-view with some fields of a certain node B that is referenced from node A using an entity-reference field.

The problem shows some similarities with the one exposed at a previous question but also some differences. Overall, I guess my problem should be solved without additional theming.

Right now I'm building a view that shows content of the content-type that node B has, and then i'm (mis)using a contextual filter (entity-reference field from node A) and a relationship (referenced entity).

It doesnt work, so I think i'm doing something in the wrong way.

What am i missing?

Thanks.


texts: How do I keep the cron from removing a poll from my front page?

texts: I am running Drupal 6 and cron from my crontab. I created a poll on a site that I have inherited and moved it into the first sidebar where it appeared until the cron ran. I can duplicate this (cron runs every hour) . How do I keep it from doing this?


texts:
Is it possible to assign a content type to a field using profile2 module ? The website is developed in Drupal 7.

For example i have a content type product and another one images. I would like to have a profile which has as fields all the fields from product content type and also to be able to add more than 1 image content type to the same profile.


texts: Two Drush bam-backup errors: Command not Found & Could not find a Drupal setting.php file at

texts:
I am trying to use Drush to backup a standard 7.12 local installation, but I am getting two error messages when running drush bam-backup:

The drush command 'bam-backup' could not be found.
Run `drush cache-clear drush` to clear the commandfile cache
if you have installed new extensions.

Could not find a Drupal settings.php file at ./sites/default/settings.php.

The bam module is enabled in my system.

Regarding the second issue, I have checked in the corresponding directory and it contains a default.settings.php file, but no settings.php file.

Is this a configuration issue, or a more fundamental bug? How can use Drush to backup my installation? Thanks.

P.S.:

I am on Windows 7 and I have used the Windows installer available here to install Drush. The bam version is 7.x-2.2 and Drush version is 5.0-dev.


texts: Where is the "Send mail to all users" action?

texts:
I installed and configured the Rules module.

When I try to add a rule like notifying a new comment to all users, I do not see the Send mail to all users action.

Is that normal? Is there any other module to install?


texts: why filters are not working in view query alter?

texts:
why filters are not working in  view query alter here is my code what i am doing wrong:

     if ($view->id() == 'answer_key_form' && $view-
     >getDisplay()->display['id'] == 'page_2') {

     $competetive_array=array('234','235' );

           foreach ($query->where as &$condition_group) {
           foreach ($condition_group['conditions'] as
            &$condition) {

            if ($condition['field'] == '

 node__field_akf_select_product.field_akf_select_product_target_id') {

      $condition = array(
        'field' => 'node__field_akf_select_product.field_akf_select_product_target_id',
        'value' => $competetive_array,
        'operator' => 'IN',
      );

    }
  }
}

if my url arguments are www.test.com/field_akf_select_product_target_id=234 its giving me same result if i pass any random no in url parameter like field_akf_select_product_target_id=886 still its giving same result it should show no result found..


texts: Is there a way to find internal links to a specific web page?

texts: For example, for a page called mysite.com/about can you determine any other pages that link directly to this web page? The goal is to determine all of the webpages that exist in mysite.com that have a link to the about page.


texts: pass taxonomy term value to content type

texts:
on view page there would be a 2 level taxonomy term listed as menu.
If i select any leaf taxonomy term for e.g (mobile -> mobile accessories) whereas mobile accessories is the leaf taxonomy term.

Then a content type page say "ABC" should be called having the (mobile -> mobile accessories) as default field value.

Am using conditional field module, which will display only the required field related to the taxonomy term being selected.

Thanks you in advance....


texts: Can Pressflow 7 be a drop-in replacement for Drupal 7?

texts:
The Pressflow site mentions that it is used by many Drupal 6 sites, and in the FAQ, in answer to the question "What's the deal with Pressflow 7?" says

  Pressflow 6 made significant improvements to Drupal core in
  scalability and performance and most of these features have been
  contributed back to Drupal 7 core. Until well understood performance
  patches are created for Drupal 7 Pressflow development will be slow.
  Additionally, as Drupal 8 matures, significant enhancements will
  likely be backported to Pressflow 7.

That sounds to me like a very indirect way of implying that there are lots of problems with Pressflow 7 that cause people to avoid using it, but stated in a way that no one would understand unless they're already aware of the problems.  The answer seems like more of an explanation (indirect and implied) of why there are problems, than really an explanation of what the situation is with Pressflow 7.

So, can anyone tell me in plain English what the situation is?  Is there some reason I wouldn't want to replace a normal Drupal 7 site with Pressflow 7?  Or some reason it is simply impossible?  (Or is the problem simply that Pressflow 7 has not been optimized to the same degree that Pressflow 6 has?)


texts: Extending a base template file such as field.html.twig renders no results?

texts:
So I have a custom content entity that has the typical attributes. Name, Author, Creation Date, ect. In the 'view' tab of this content entity, it displays said name, author, ect.

When I hover over the name or title, it will display that this particular area uses field.html.twig as its default base template. I created my own custom template that extends the base template, and wanted to edit it so it would look different.

However, doing so renders the field invisible. I tried copying the base template and pasting it into my custom twig template, however the field is still invisible. Only when I delete my custom template does it revert back to the original base template and display the field.

Here is where I am confused. My custom twig template is taking precedence, it shows that in the debug info, but I am copying the field.html.twig code into my custom code before I start editing. Why then is the fields disappearing off the page or not rendering considering that I am using the exact same coding?

Just for reference, this is a custom module template and not a themeing template I am working with.

Here is a picture of what the field looks like when its displaying properly, otherwise it vanishs.

My hook theme code for this particular field:

  $theme['field__parent_task'] = [
    'render element' => 'content',
    'variables' => ['content' => NULL],
    'file' => 'task.page.inc',
  ];

I don't know what to put for the key names in the theme array, so I just copy and pasted from another one that was already there.


texts: Guidelines For Features as building blocks

texts:
Any guidelines on how to use features module as building blocks for a consolidated drupal site from a prototypic approach, so that most of the functionality is just a plug and play using feature.

I am afraid my question might be too broad to answer, but looking for initial pointers basically the important things need to be taken into account while building features so there can be least chances of conflicts.


texts: How to create a Bean type programmatically?

texts: I'm building a module that creates set of blocks using Bean module. How do I can create a Bean Type programmatically in order to be able to create the blocks?


texts: How to make custom blocks print unsanitized markup

texts:
Goal: I like to create a block to display phone no and a link as shown below:

Structure > Block layout > custom block > Add custom block, added this:

When I go to my site, I see this:

How can I create a block based on my above goal?

Update 1

Full HTML shows no CKEditor

FULL HTML > Configure shows this:

Block:

My page still shows html code:


texts:
In views bulk operations, you can select fields and then edit them by clicking on "Modify Entity Values".
When you do this, a screen appears asking you to select the entities you wish to modify and the values you wish to set. Is there a way of using a custom template to theme this screen?

Additional Info:
The top part of the screen lists provides check boxes for all the entities the user can edit. The user has to tick a check box to edit an entity. The bottom of the screen lists all the values that can be set.
I would like to use Jquery so the values on the bottom only appear when the corresponding check box at the top has been ticked. Is this possible?


texts:
I have been working on a Drupal.org project and I want to make sure that pass all the coding standards. For some reason I got these problem with the README.txt encoding and I dont know how to solve it.

 ./README.txt: UTF-8 Unicode (with BOM) English text, with CRLF line terminators README.txt

Bad line endings were found, always use unix style terminators
./README.txt: the byte order mark at the beginning of UTF-8 files is discouraged, you should remove it.

Can anyone tell me how to solve this problem ? I'm currently using Sublime Text 2 and I save my README.txt as UTF-8 Unicode with BOM and this did not fix my problem.

Here is the README.txt https://gist.github.com/darol100/e24059dbacc4f7e205ad
http://pareview.sh/pareview/httpgitdrupalorgsandboxdarol1002309319git


texts:
I have set all my fields labels as hidden in content types > display fields.

It seems like Views overrides this by displaying labels of the filter fields.

How to hide them?


texts: Are there modules for managing inline images?

texts:
I would like to include inline images in my posts. Is there an easy way to:

find (and delete) unreferenced images
find which content references a given image
(ideally) keep things working if I decide to rename an image file
don't show the uploaded images except where referenced manually ("Image" field seems to show all linked images below the post)


texts: 8 - How do I load a Term entity from an EntityReferenceItem?

texts:
I have a content type with a taxonomy term. I can load the first EntityReferenceItem using

$node->country->get(0)

then I can tid doing ->target_id (and then manually load the Term object via Term::load.

But is there a function of EntityReferenceItem that I can call to get it to load the corresponding term? I'm thinking something like:

  $node->country->get(0)->getReferenced()

I don't see anything at the Drupal API reference


texts: Creating two entities at once using entity metadata wrappers

texts:
I'm currently facing a situation where I need to create a new instance of a certain entity and attach a file to it.

Since the main entity should 'reference' the file (the same way a node references a user, by an entity property) there are several things I can do.

Method 1

Save the main entity
Save the file
Update the main entity with the file id.

Method 2

Save the file with temporary status
Save the main entity with the file id.
Update the file to a permanent status.

Since both methods would require me to perform 3 operations in a row I thought it might be simpler to do this with an entity metadata wrapper like this:

// Create the file entity.
$f = entity_create('file', array(
  'uid'               => $data->uid,
  'filename'          => $data->filename,
  'url'               => $data->uri,
  'filemime'          => $data->filemime,
  'filesize'          => $data->filesize,
  'status'            => 1,
));

// Create the main entity.
$e = entity_create('main_entity', array());
$entity= entity_metadata_wrapper('main_entity', $e);

$entity->title       = $data->title;
$entity->...         = $data->...
$entity->file        = $f;

$entity->save();

This however saves the main entity with $entity->file = 0, and the file does not show up in file_managed. Which conflicts with the answer to "How to set value of file field with entity_metadata_wrapper" that implies I can use a new stdClass().

Is there some other error in my entity metadata implementation, or is it not possible to save (create) two entities at once like this?

Update

Apparently my understanding on entity metadata wrappers was completely wrong; While reading the comments on the Entity metadata wrappers documentation page I assumed I could do things like this:

// Changing the author's email.
$wrapped_node->author->mail->set('foo@bar.baz');
// Adding to the answer of @Zakaria Elhariri.
$wrapped_node->field_page->status->set(0);
// Save the changes.
$wrapped_node->save();

I thought saving the main entity would update the nested entities, so I'd expect the email of my account to be changed and the linked node of Zakaria Elhariri's answer to be unpublished. But none of this is true. Why is this is the examples?

  To update the user's mail address one could use

  <?php
  $wrapper->author->mail->set('sepp@example.com');
  ?>

Or is entity metadata wrapper broken somehow?


texts: Programatically create field collection into Profile2 on new user creation

texts:
I've set up my own custom multi-step registration form, because I just couldn't find a way of making anything out there do what I want. I've found other questions on here like this one and this one which have basically got me 95% there. My main problem now is that I've got a series of field collections in my Profile2 fields, and I just can't seem to find out what my code needs to be in order to get it done properly.

*At this point in the code I've created a new user ($user), and their profile2 ($profile2) and I'm trying to format my fields from my form so that I can throw them all into the $profile2 object.

field_activities

field_start_year
field_end_year
field_text

My code so far is:

$field_collection = entity_create('field_collection_item', array('field_name' => 'field_activities'));
$field_collection->setHostEntity('profile', $profile2);
$field_collection->field_start_year = $entry['start_year'];
$field_collection->field_end_year = $entry['end_year'];
$field_collection->field_text = $entry['text'];
$field_collection->save(FALSE);

And the error I'm getting is:

  Fatal error: Call to a member function setHostEntity() on a non-object

Which would make more sense to me if $profile2 wasn't an object, but it is.

I've got too many unknowns to figure this out at the moment, is it the right code? can I build a create a field collection item on a newly created profile2 object? do I populate all the fields of the profile object first, and then once it's saved, then add the field collections, etc.


texts: Is there advantage to using Drupal.settings, as opposed to directly passing json-encoded var to javascript function

texts:
Inside my custom views template, views-view-myview.tpl.php, I have a variable ("$myvar"), which I need to pass to a custom javascript function.  Here is how I am currently doing it:

A.  json-encode $myvar

<?php
$my_json_var = json_encode($myvar);
?>

B.  Pass the variable as an argument to my custom function, on page load

<script>
Drupal.behaviors.mystuff = function (context) {
  my_js_function(<?php print $my_json_var; ?>);
});
</script>

I am noticing that Drupal developers generally pass variables to javascript using Drupal.settings, and I am wondering whether I should switch and use Drupal.settings instead.

Question:
Is there any disadvantage of doing things my way, as described above?  Is there any reason it would be better to switch to Drupal.settings.
Note:  $myvar is relatively large, say 100k.

Thanks very much


texts: Adding a reference to a bundle in a node

texts:
I would appreciate suggestion for this common scenario in Drupal 8, which may be different to how I do it in Drupal 6. I don't want to do any programming.

I have two content types: (1) Articles (title, author, body) (2) Authors (First name, Surname, Biography).
Authors are not users.

When adding a new article, I want the option to select either (a) An existing author from a list, or (b) Add a new author to the list, and select it.

When displaying the article, I want to see the author's First Name and Surname, and optionally a Biography teaser, and then the body of the article.


texts: Custom theme block position is not importing

texts:
Problem:

Making a custom theme with blocks placed in different regions.

Place custom blocks in theme using the UI.
Export config. drush cex vcs
When it came time to import my config in a new environment custom blocks not appearing in proper region despite .yml files for individual blocks being present in my default config directory...

How to import configuration so that blocks from my custom theme appear in the correct region?


texts: Feature revert deletes existing Strongarm variable

texts:
I got a Drupal 7 feature, which contains certain Strongarm variables, such as admin_theme. This feature has been created, released and reverted multiple times, always without fault. Suddenly, the last feature revert leaded to a deletion of some variables which are clearly defined in Strongarm.

The only thing that helped "a bit" was to remove the variables from the feature, release & revert them, and then add the variables again and release and revert once again.

This can't be a solution for the production release because this one has to work in one time. Why can it be that a Feature revert deletes variables from the database (variable table) which are clearly stated in the feature?


texts: I have a large set of Content Types,each with a fair amount of fields.  IS there a way to programatically report on whether those fields are required or not?  It is tedious to click on each field to check it.


texts: What module will show me all sql queries being run on the loaded page?

texts: My site is running slow and I suspect its a module, but not sure which one. Is there a module that can display all the sql queries being run on a loaded page? If there isn't maybe there is a command line tool that others use to monitor this data?


texts:
I know it is possible, but is it advisable or even in common sense to try to implement second (own) login i.e. mysite.com/login2 and access that way to custom layout (admin page), where is some custom data to manage our own hidden things, nothing related to drupal tho.

The reason for this, I love drupal, and I would use it for frontend publishing and managing site easy. But thing is I need some sort of portal (module for drupal) to handle data from my other sources where this own login and admin comes handy.

This is currently done with custom coding, but is it possible to integrate this "custom code" to drupal with modules and use durpals see, friendly urls, database handling etc advantages?

I don't expect this to happen in no time, need to learn a lot deeper but if there is a change to do this in reasonable time and without breaking drupal itself, I would love to start developing this :)


texts: Where to store JS and CSS that is not associated with a module?

texts:
I've been given a ZIP file with the JS, CSS, HTML, and assets for a stand-alone jQuery application.  We would like to host this application through our Drupal 7 site hosted on Acquia Cloud.  I am looking for best practices on where to store this application. I've included additional info below but can supplement if there's other relevant info.  Can anyone suggest where I should store these files?

Due to some business-related decisions, we will always receive updates to this application in a ZIP file.  It may or may not receive updates. If it does, we'd like our content admin team to be able to manage it through Drupal or FTP.  It has not yet been decided if the application will be embedded in a page or accessed on it's own.

In our current site, we are not able to upload an entire directory and keep it in the same structure.  Each file must be uploaded manually.  We are fairly new to Drupal so I don't know if there is a module that would get us around this issue.

I am not allowed to make changes to the code or alter the directory structure (as that would require changes to the file references).

If there are no best practices for this, we can store it somewhere else and link out to it.  I would prefer to avoid this but if that's the recommended best practice, we can do it.


texts: Using JSON:API to replicate content on external location

texts:
I would like to create content on another Drupal instance using JSON:API. Using the jsonapi_extras service, serializer.normalizer.entity.jsonapi_extras, entities can serialized but contain more node information than is required for remote location.

What I need to do is to prune this JSON object further to only include what is required, but haven't found an elegant way to do this with the EntityToJsonApi class. It seems like a workaround might be to request this JSON object from the HTTP API and limit included data with sparse fieldsets, but wanted to get some feedback on the best way to achieve this.


texts: "Content Type Edit/Add" gives Whitescreen, no errors loged, what to do?

texts:
I am running a Drupal Commerce Kickstart 1 on top of it (D7)site on localhost/xampp (1.7.7).

Now:
When I go to Content Type (/admin/structure/type), and click Edit on a given   type or New Content Type, i get the white screen or a server 500 error.
I can access manage fields and manage display on the same page.
When I go to drupal error logs, there is no trace of the error.
Neither can I find a trace of the problem in /opt/lampp/log/error_log.
Tried to increase allowef script time / php memory limit in php.ini - no result.

The site works without problems on a remote testing server, and has been  working without problems for a long time locally. So most probably it's local configuration, but I am not sure what to do.

Maybe some of you have an idea about what can I do?


texts: Specific number of values in field setting per role

texts: Is there any way to limit user input a field with 1 value in select list, but make it unlimited for admin?


texts: Running Drupal code inspections via PHP Storm returns incorrect results

texts:
When I run PHP Code Sniffer inspections in PHP Storm (latest version) for Drupal code using the latest Drupal coding standards (from the Coder module), I get incorrect results. Running the inspections manually on the command line seems to return the proper results. I don't know why.

Here's the output of running phpcs manually against this test file from the CAS module:

/Users/bosborne/.composer/vendor/bin/phpcs --standard=/Users/bosborne/.composer/vendor/drupal/coder/coder_sniffer/Drupal tests/src/Unit/Subscriber/CasSubscriberTest.php

FILE: ...ules/contrib/cas/tests/src/Unit/Subscriber/CasSubscriberTest.php
----------------------------------------------------------------------
FOUND 11 ERRORS AND 4 WARNINGS AFFECTING 15 LINES
----------------------------------------------------------------------
  16 | WARNING | [x] Unused use statement
  99 | ERROR   | [x] Expected "MockCondition" but found
     |         |     "MockCondition;" for @var tag in member variable
     |         |     comment
 131 | ERROR   | [x] Array indentation error, expected 6 spaces but
     |         |     found 8
 132 | ERROR   | [x] Array indentation error, expected 6 spaces but
     |         |     found 8
 133 | ERROR   | [x] Array indentation error, expected 6 spaces but
     |         |     found 8
 134 | ERROR   | [x] Array indentation error, expected 6 spaces but
     |         |     found 8
 135 | WARNING | [x] A comma should follow the last multiline array
     |         |     item. Found: ]
 148 | ERROR   | [x] There should be no white space after an opening
     |         |     "["
 149 | WARNING | [x] A comma should follow the last multiline array
     |         |     item. Found: ]
 162 | ERROR   | [x] There should be no white space after an opening
     |         |     "["
 163 | WARNING | [x] A comma should follow the last multiline array
     |         |     item. Found: ]
 177 | ERROR   | [x] Object operator not indented correctly; expected
     |         |     6 spaces but found 35
 193 | ERROR   | [x] Object operator not indented correctly; expected
     |         |     6 spaces but found 28
 194 | ERROR   | [ ] If the line declaring an array spans longer than
     |         |     80 characters, each element should be broken
     |         |     into its own line
 564 | ERROR   | [x] Inline comments must start with a capital letter
----------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Lots of errors and warnings!

But when I configure my PHP Storm (latest version) to run the inspections on the same file, I get just two weak warnings, and the filedoc one it complains about is wrong (file docs are not required on namespaced files).

So something is out of wack here, but for the life of me I cannot figure out why PHP Storm is returning the wrong output.

Environment info:

Using version 8.x-2.9 of the Coder module
Using version 2.7 of phpcs
Code Sniffer is setup in PHP Storm using the same exact path that I use when running the command manually (see config image below)
Inspections are setup in PHP Storm to use "Custom" inspections and I proide the path to the Drupal coding standards (the same path that I use when running it manually)

EDIT: I also filed an issue with PHP Storm directly: https://youtrack.jetbrains.com/issue/WI-34029


texts: Why recurring order becomes completed immediatelly after payment (no fulfillment status)?

texts:
I'm using Commerce datatrans module which originally supports only offsite payments. However I added extra functionality for recurring payment and it works well.
Only issue I have is that when method createPayment() I added is called by cron job and payment is made that order gets status "Completed".
For default types of orders (non-recurring ones) they have status "Fulfillment" so when all items are shipped order status can manually be changed to "Completed". I expected same thing with recurring orders.
In createPayment() function I added code I found on official documentation for that method:
$next_state = $capture ? 'completed' : 'authorization';
$payment->setState($next_state);
$payment->setRemoteId($transaction["uppTransactionId"]);
$payment->setExpiresTime(strtotime('+5 days'));
$payment->save();

Not sure should I change order status from that method. But again some other code is changing it form "Draft" to "Completed".
So my question is why it's not changed to "Fulfillment" but to "Completed" as soon as payment is done?


texts: How can I print node author's last login date on page.tpl.php?

texts: I could easily find out how to print the current user's last login date but what about the node author's one?


texts: How do I programatically create a Bean 'instance' in code?

texts:
I am trying to make a sort of hook_setup_beans() function (similar to hook_setup_blocks()) to create some bean instances by default when a user turns on a bean_example module I am making. This would be called from hook_install().

Is there a standard path for doing this?

I am playing with bean_create() and bean_save() right now.

Thanks

p.s. I also asked this at https://drupal.org/node/2173783


texts: Jquery popup stops the ajax in the form fields

texts:
I have created a .js script that creates a popup box next when a button is clicked. This pop shows a lost of the different content types you can add from that popup. When you click on one of those links it will load the form elements through AJAX. That is all working great but there is a major problem.

The AJAX fields within the form that is loaded onto the the popup does not work itself, I can enter in some text but no AJAX is performed. The field type of the that field is an entity reference field.

Can anyone help me on this one please? Thank you in advance!


texts:
I have created a view and put it on a custom page using panels.

Sadly my query is too complicated and the page times out after about 10 seconds. On top of this i wanted my page to provide a 'loading' indicator to provide some feedback.

Now i am aware of batch api as being the most reasonable solution, at what stage can i get my view query to execute a batch run? I have thought about hook_views_pre_execute() but i think this is too late.

Has anyone any idea how to process a page load with batch api, or an alternative solution?


texts:
In a Drupal site, I've a hashtag appended to my url. Example:

www.myUrl.com/content/node#.UFnCybLN9Nu

I don't know where it comes from and I don't know how to remove it. Any ideas?


texts: Webform limit to multiple choice question

texts:
Anyone know of a way to take a multiple choice (checkbox) question on a Webform and only allow the person to select two or three options and all other options become disabled? Using WebForm module?
Version: 7.x-4.15


texts: Is there a way to add pagination to only a tableselect returned from ajax callback?

texts:
Have a simple form with few inputs as a filter criteria. Selecting these and clicking on a submit button executes a callback function that returns a table and a pager.

Code:

//submit button
$form['action'] = [
'#prefix' => '
',
'#name' => 'ajax_action',
'#type' => 'button',
'#value' => $this->t('Submit'),
'#ajax' => [
'callback' => '::setMessage',
'wrapper' => 'scrollable',
'method' => 'replace',
'effect' => 'fade',
],
'#suffix' => '

',
];

//table element
    $form['table'] = array(
   '#prefix' => '

View Data
',
   '#type' => 'tableselect',
   '#header' => $header,
   '#options' => $options,
   '#disabled' => $disabled,
   '#attributes' => array('id' => 'sort-table'),
   '#empty' => t('Select criteria and search data'),
    );

//pager element
  $form['pager'] = array(
  '#type' => 'pager',
 '#suffix' => '
',
  );

 //function to obtain #options
    if ($form_state->getTriggeringElement()['#name'] == 'ajax_action') {
        $options = array();
        $header = [
            'subject_id' => t('Subject ID'),
            'ct_availability' => t('CT Availability'),
             'sex' => t('Sex'),
             'race' => t('Race'),
             'cardiovascular_disease' => t('Cardiovascular Disease'),
             'registration_age' => t('Registration_Age'),
               ];
        $options = $this->getOptions($form_state); //function to get #options
        $form['table']['#header'] = $header;
        $form['table']['#options'] = $options;
        }

//callback function

public function setMessage(array $form, FormStateInterface $form_state) {
return (array($form['table'], $form['pager']));

}

This gives the ajax response including a table with the data and a pager
The pager has rendered fine but the problem here is that, clicking on it would redirect leading to an error:

"An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (125 MB) that this server support."

Which I believe is due to the url leading to invalid redirection as below:

  hostname/search_data_form?ajax_form=1&_wrapper_format=drupal_ajax&page=1

I've referred to a similar problem form this post

But here I'm not theming the form in any twig file and have a challenge to understand how to make the pagination work within the area having table as an ajax response.

Have also referred to another post

which suggests to replace the url but the whole page gets reloaded with such approach.

Is there a suitable working approach to have a table with pagination as an ajax response?


texts: How to upload multiple images as multiple nodes?

texts:
I built a social network website that is like Instagram (users can follow each other, upload images and ...) but it focuses on some event. People send us tens of thousands of images every year and we present them on their profile in the website.

Every thing is fine with this website. The only problem is for users who send many images (usually more than 50), It is difficult for them to click on Create New Content link for every image and save that image and create new content again. To solve this problem I allow the images content type to have unlimited number of image field and used Multipleupload Imagefield Widget to allow users to select multiple files at once.

But every content must have exactly one image, so if a user selects multiple images for a content, we need to have a mechanism to separate every image as a distinct content, we can also share the Title of the content among all of them.

The only solution I found so far is to build a module that check for the number of images and create new content for each one on node save hook. I would like to know is there any other solution? any module or strategy to handle this requirement?

Thanks.

UPDATE

as @Gokul N K recommended I installed Bulk File Nodes Module, I also installed Plupload module. After selecting the Image field in Bulk Photo Node Settings vertical tab, This is what I see in node/add/image

and I can't add any image, By clicking on next button this page is reloaded.


texts: How do I refresh a view (or a page) after a new comment has been posted?

texts:
I have a view that displays comments for a node.
When user1 posts a new comment then that comment appears automatically in the view for user1. But for user2 viewing the same node, the new comment does not appear automatically without a page refresh (ie, the view does not get refreshed automatically).

I have tried to find an event in rules to trigger an event that could look like "refresh page" or "refresh view".

Any hint?


texts:
I want to have content type tutorial, with descriptions step by step, consisting of text paragraphs and pictures as an explanation (like clickable thumbnails or just picture).

I know how to add field like text text and image, add set a possibility of make it's number unlimited. But how allow user to arrange order of pictures and text?

Example:

TITLE of PAGE

PARAGRAPH 1

PICTURE 1

PARAGRAPH 2

PICTURE 2

PICTURE 3

PARAGRAPH 3

PARAGRAPH 4


texts: Is there a way to trigger an action on a php exception in Drupal 7?

texts:
Whenever a php error/exception occurs, I'd like to log the error and optionally send an email off to the site admin.  Is there an easy way to do this with Drupal 7?  Maybe an existing module or a combination of existing modules?

I have a long, non-drupal technical background, and I've done this many times over in other frameworks and custom stacks (mostly Python).  Not that all frameworks should be created equal, but I figured I'd ask if there was a module for this before going off and developing my own.

I feel like I should be able to use the standard "recent log messages" for my purposes, but two things would need to be added to it.  First, I would need to log php exceptions.  Second, I would need to have the ability to send these log messages in an email.  Now, I understand that logging php exceptions to the "recent log message" table wouldn't be totally all inclusive since the logging php code itself could have a bug in it.  But if that was my only only limitation, I'll settle for the 95% solution.

Any direction at all will be appreciated.


texts: Query returns 0 rows on JQGrid filter due to translated rows

texts:
I have a JQGrid table that can be displayed in different languages. The data for this table is stored as English text and translated when output. The JQGrid table can be filtered by text.

The issue I have, is that when the JQGrid table is filtered, the query will run against the English text. E.g.

Original table:
Yes
No

Translated table:
Oui
Non

User is French and tries to filter for 'Oui':
Database query will return zero results because 'Oui' does not exist in the database table. If the French user queries for 'Yes' then Oui will show because it matches the database and is translated on output.

This is using custom integration with JQGrid.

Since all string translation is cached and as far as I know there are no database tables available to join on, how can I get translated filtering to work?

Any ideas on the best way to handle this?


texts: How to link Question node to current page?

texts:
I would like users to be able to ask questions related to current page without going to another page as it works now in the Relevant Answers module. There is a related issue: http://drupal.org/node/1826492

I can create a custom block with form in it, and create new Question node on submit.

How can I link that new node to current page?


texts:
I am working with a company setting up a drupal website. I am responsible for entering our product information into the drupal tables. I am having difficulty getting a straight answer/an answer that makes sense as to what the values for nid and vid should be in the drupal_node and drupal_node_revision tables should be. I am being told by our vendor that the values for nid and vid need to be the same (ie 27 and 27) but that doesn't make sense to me. Shouldn't the vid just start at 0 or 1 and increment up from there. Isn't it simply what the node table uses to read the current version from the revision table.

I know very little about drupal so I may be wrong but their answers aren't making sense to me. And as the nid is automatically incremented in the table, I have no way of knowing what the nid value is until after the insert. So I would have to read the value and run an update statement, which seems really sloppy.


texts: Implement sticky footer for acquia_marina

texts:
I've searched for a Drupal-friendly sticky footer solution for the Acquia Marina theme for Drupal 7, but I couldn't find anything.

2 examples are given here for Drupal 6: http://drupal.org/node/554048. The first solution is JavaScript-based and the second is CSS-based.

Will the CSS/JS examples given work for Drupal 7? If not, can anyone suggest a simple solution to get the footer to stick to the bottom of the browser window?

My site is running drupal-7.10, fusion-7.x-1.x-dev and acquia_marina-7.x-1.x-dev.


texts: Drupal -> User error: Failed to connect to memcache server

texts:
I had someone install memcache for one Drupal project. Apparently we moved to another hosting. Upon completing the migration, the site is having issues with memcache.

Can someone guide me on how to remove the error? Please see below. I believe this is the right section for the topic, but if you find it inappropriate for this category, please feel free to move it. Thank you.

User error: Failed to connect to memcache server: 127.0.0.1:11211 in dmemcache_object() (line 415 of/home/searchpa/public_html/sites/all/modules/memcache/dmemcache.inc).


texts: Adding a CDN feature for a new installation: now or later?

texts: If you are setting up a Drupal 6 website from scratch, is it important to install a CDN module (or similar service) immediately? Or will adding such a feature be easy to do later on--even with multiple image files or static files already being used on the site domain?


texts: Traslation reset issue while upload on server

texts:
I'm facing strange issue on server.

Using bitbucket & git for file & data management.

When data push to our development server 5-10 translations always reset to English.

We have 2 languages English as default & Chinese as another.

What will be cause of reset only those 5-10 tanslations?


texts: I can't find how to get image url. I have images in /themes/custom/mytheme/img directory. I think there must be some way to get path to current theme or somethink like that.


texts:
I need to build a simple JSON webservice for an iPhone application and i would like to give drupal a go :)

Here is the content structure i need, admins should be able to create a Newsletter a news letter should contain (title, description, categories) and then it should be possible to create "news sections" each section should contain (title, text, image) so a section is a group of content and it should be possible to create multiple sections in a newsletter.

First question: how would you structure the above content ? i tried two ways of doing it

created two content types "Newsletter" and "News section" and inside the News section i created a entity_reference to the parent newsletter. works fine, but its not so nice for the admins as they cant really get a overview of what their newsletter is when editing because the content is separated into multiple nodes. also the admins cant sort them.
created a single Newsletter and added the module "field_collection_item" where i setup the "section" fields. This works quite well since it gives the admin a nice way of getting an overview of all the content of the newsletter. But to be honest it looks very messy the admin interface. And i feel like this is a "wrong way of doing it"

When structure is sorted i would like to expose the data as JSON, i found the Services module which seemed perfect. But i have alot of problems exposing the related data, for example if i like to expose a newsletter i would like that all the related news sections is included in the export, but only the id's are exported, i tried alot with Views etc. but cant get it to work properly so i ended up writting a custom hook which looks up the related content. Again i feel like im missing a better way of doing things.

Im very new to drupal so im hoping to get a bit of feedback on how i could build this very simple service in a nice and clean way that makes in intuitive for the admins to administrate the newsletters.


texts: How do I allow date-time filtering on my custom entity's ISO date field

texts:
I have a custom entity with a datetime field. This datetime is saved in the database as an ISO string. I would like to use Views on this entity, and select entities with dates before, after, or between certain dates. I see if I make a view against the system log, these options are presented when filtering on Timestamp. How can I enable the same filtering options on my field?

The field definition is:

$fields['set_datetime'] = BaseFieldDefinition::create('datetime')
  ->setLabel(t('Set DateTime'))
  ->setDescription(t('Date and time fermentor was set.'))
  ->setSettings(array(
    'datetime_type' => 'datetime',
  ))
  ->setDefaultValue('')
  ->setDisplayOptions('view', array(
    'label' => 'above',
    'type' => 'string',
    'weight' => -4,
  ))
  ->setDisplayOptions('form', array(
    'weight' => -4,
  ))
  ->setDisplayConfigurable('form', TRUE)
  ->setDisplayConfigurable('view', TRUE);


texts: how to create a apply button in view table result ?

texts:
I have created a view with display format as table
I want to create a button in the last column for every row
So that when user click on that button form then form open.
So how can I create that button for every row


texts: How do I redirect a node to a path followed by a wildcard?

texts:
I have a basic page node that contains two views in block form. The views both contain contextual filters captured from the URL. How to I publish my node to allow the user to visit /report/2002, or /report/2004, or /report/2010. The blocks are configured to display on /report/*. How do I do the same for a node?

Do I need to make my own controller with custom routing?


texts: How can I remove the descriptions from the registration page programatically?

texts:
Using the custom module mentioned here https://www.drupal.org/node/754542#comment-2775706 I was able to remove the descriptions from the user login page.

function alterlogin_form_user_login_alter(&$form, &$form_state) {
  $form['name']['#description'] = t('');
  $form['pass'] = array('#type'  => 'password',
                        '#title' => t('Password'),
                        '#description' => t(''),
                        '#required' => TRUE,
                       );
}

however when I try

function alterlogin_form_user_register_form_alter(&$form, &$form_state) {
  $form['name']['#description'] = t('');
}

the description stays the same. I know it's targetting the page because

function alterlogin_form_user_register_form_alter(&$form, &$form_state) {
  $form['name']['#description'] = t('');
  $form['pass'] = array('#type'  => 'password',
                        '#title' => t('Password'),
                        '#description' => t(''),
                        '#required' => TRUE,
                       );
}

creates a password field on the registration page (that I assume does nothing).


texts:
I've neglected a site for a while, and now I need to update some modules that are several versions out of date. Can I just jump to the newest version of the module or do I need to copy each version in order and run update.php each time?

Also, if several modules need updating, is it OK to copy all the files across and run update.php once, or do I need to copy each module individually and run the update each time?


texts: How create a role that only can create users?

texts:
I want to create a role in Drupal. I want create role assign to specific user.
Specific user can create only user and not anything.


texts:
I want to add a custom VBO action.

It display in the actions list of the view, it should like a tree, like this:

-Add Role-

RoleA

RoleB

-Remove Role-

RoleA

RoleB

And When I select RoleA(-Remove Role-), check some users, click the submit.

The users checked should be removed RoleA.

How can I code a custom VBO action like this ?


texts: if i am on a node page how can i get one of the taxonomy terms for that node?

texts: In drupal 8, if I am on a certain page, how can I get the taxonomy terms for one particular taxonomy that that node has ?  I want to do this in a custom module


texts: How to create a node based on views results

texts:
I'm looking for a way to accomplish the following:

Use views to select users that match a certain criteria.
Create a "campaign" targeted at only those users. The campaign should ideally have all users' names/ids attached to it.

Many thanks.


texts: Why is JW Player not working in custom Content Type?

texts:
I am having a weird problem.

I downloaded JW Player and used it on my page (Default Page Content Type) to show video. It worked seamlessly. Now there was one requirement that there would be a page with different fields. I hence created a custom Content Type with different fields (including video of-course).

Now I am attaching a VIDEO normally in both the fields, but one page with the custom content type weirdly doesn't show the video. What it shows it blunt listing of the Video Link.

How can I make JW player in my custom content type page (making it show <object> tag).

Below I'll list both the outputs:

Default Page (Correct Output)

        <object type="application/x-shockwave-flash" data="http://player.swf" width="100%" height="100%" bgcolor="#ffffff" id="a76593f3ee69e066" name="a76593f3ee69e066" tabindex="0"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="seamlesstabbing" value="true"><param name="wmode" value="opaque"><param name="flashvars" value="netstreambasepath=page24_2.mp4&amp;skin=glow.xml&amp;autostart=1&amp;controlbar.position=none">

        </object>

Custom Template Output of a Video (Wrong)

      page24.mp4


texts: Migrating existing groups from Commons 2.x to Commons 3

texts:
I've just installed Commons 3 on a sandbox server and am curious where to begin migrating groups data over. I realize this is may also apply generic D6 to D7, but is there additional consideration for a Drupal Distribution? What steps should I take to move content and groups from Common 2.x to Commons 3.x?

That is, how can I move existing groups from Commons 2.x into Commons 3.x that will include content types attached to those groups (discussions, postings, events, wikis)?

I know that Activity Streams are different between these versions and we can live with out that, but I'd like to bring over content attached to the appropriate groups and users.


texts: Checking two databases when logging in a user with a custom module

texts: I am trying to create a module that will check for two databases when logging in a user to Drupal. If drupal's native login is a success but the external application does not have that account, then the module will create an account on the external application. If the account is not on drupal but is on the external application then drupal will create a local account. If the user does not exist on either database then the login will fail. Which hook(s) would I need to implement this in a module?


texts:
I would like to export everything in the watchdog table to a CSV file occasionally using hook_cron(). I do not have access to PHPMyAdmin and don't want to waste time with modules like so.

Right now, I have all records for the watchdog table, but I can't figure out how to format messages properly.

$log = db_query("SELECT uid, type, message, variables, severity, location, timestamp FROM {watchdog}")->fetchAll();
dsm($log);
// Output: "message => '%type: !message in %function (line %line of %file).'"
//         "variables => 'a:6:{s:5:"%type";s:6:"Notice";s:8:"!message";s:27:"Undefined index:..."

How the heck am I supposed to replace symbols in $log['message'] with what's in $log['variables']?

I have tried using t($log['message'], $log['variables']) and format_string($log['message'], $log['variables']) but this won't work.


texts: Custom module with same twig template and two paths (e.g /pub and /pub/{id} )

texts:
I created a custom module to show nodes by taxonomy in a specific html twig. I created a controller that contain two functions. The first function called "content" pass an array to template twig contain all themes and all nodes. I create a path (e.g: /pub) for that. The second function called "contentByTaxonomy" pass an array to twig that contain nodes by specific taxonomy. I create a path (e.g /pub/{id}). The (/pub) works fine, but (/pub/{id}) return "page not found". I just want to know what is missing in this code.

file : custom.module

function custom_theme($existing, $type, $theme, $path) {
   return [
        'my_template' => [
            'variables' => [
                   'items' => [],
            ],

        ],

    ];
}

file custom.routing.yml

custom.content:
  path: '/pub'
  defaults:
    _controller: '\Drupal\custom\Controller\PubController::content'
    _title: 'Pub'
  requirements:
    _permission: 'access content'

custom.contentByTaxonomy:
  path: '/pub/{id}'
  defaults:
    _controller: '\Drupal\custom\Controller\PubController::contentByTaxonomy'
    _title: 'Pub Theme'
  #methods:  [GET]
  requirements:
    _permission: 'access content'
  #options:
   # parameters:
    #  id:
     #   type: entity:node

My controller (\modules\custom\src\Controller)
Note: getNodesByTaxonomy() and getNodes() are defined and return array.

class PubController extends ControllerBase {
    public function content() {
                    $items = $this->getNodes();
            /* pass array to twig template */
            return [
                '#theme'=> 'my_template',
                '#items'=> $items,
            ];

    }

    public function contentByTaxonomy($id) {
                    $items = $this->getNodesByTaxonomy($id);
            /* pass array to twig template */
            return [
                '#theme'=> 'my_template',
                '#items'=> $items,
            ];
    }
}

My tiwg template : (\modules\custom\templates\my-template.html.twig)

 {% for item in items %}
     {# here i display my items #}
 {% endfor %}


texts:
I have this code:

function material_base_preprocess_node(&$variables){
    $node = $variables['node'];
    $language = \Drupal::languageManager()->getCurrentLanguage()->getId();
    $variables['username'] = $node->getOwner()->getTranslation($language)->field_name->value;
    $variables['mediums1'] = $node->getTranslation($language)->field_mediums->value;
}

this line works fine:

 $variables['username'] = $node->getOwner()->getTranslation($language)->field_name->value;

but this

 $variables['mediums1'] = $node->getTranslation($language)->field_mediums->value;

gets error:

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

InvalidArgumentException: Invalid translation language (en) specified. in Drupal\Core\Entity\ContentEntityBase-&gt;getTranslation() (line 789 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).

Why this code works for user, but not for node and how to fix that?

this one works

$node->get('field_mediums')->entity->getTranslation($language)->name->value;


texts: List registered users who are currently viewing a page

texts:
I'm looking for a module that, given a page URL, returns the list of users who are currently viewing it. The list should be dynamically refreshing to show page view activity in real-time.

Is there a module for that?


texts: Does drush support everything I can do with web admin interface?

texts:
I have just learned about Drush. Its great command-line tool. With two words, I can update drupal code within seconds.

I want to know whether I can do everything I do with web admin interface or not?


texts: How to update user data after login in D8?

texts:
I am trying to update user data after login in Drupal 8.3.x.
I have implemented the hook_user_login function as follows:

function custommodule_user_login($account) {
  // We could use $account->getAccountName() as username
  $user = user_load_by_name('myusername');
  $user->set('field_user_customfield', 'VALUE');
  $user->save();
}

The problem is that the modification is not being saved.
If I execute the modification from Devel PHP execution area, everything works fine and the change is reflected.

Note: I am using the CAS module for login. Maybe that module is removing any change I do here?

What could be the issue? Can't we modify user data from user login hook in D8?


texts: "An illegal choice has been detected. Please contact the site administrator." When I try to submit the form this validation error is thrown

texts:
function user_form_edit_form_alter(&$form,&$form_state,&$form_id) {

    if ($form_id=="user_register_form") {

        $form['profile_user_profile']['field_user_group']['und']['#ajax'] = array(

                                                                        'event' => 'change',
                                                                        'wrapper' => 'edit-profile-user-profile-field-user-type-und',
                                                                        'callback' => 'get_user_type',
                                                                        'method' => 'replace',
                                                                        'effect' => 'fade'

                                                                        );

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

 }
}

function get_user_type(&$form, &$form_state) {

      $selected_user_group = $form_state['values']['profile_user_profile']['field_user_group']['und'][0]['tid'];

  //  return '<pre>' . print_r($form, 1) . '</pre>';

   // 14= USB , 15= Primary Contractor , 16 = Subcontractor

     $output = "";
     $output .= '<select class="form-select required" name="profile_user_profile[field_user_type][und]" id="edit-profile-user-profile-field-user-type-und">';

    //  if USB then Director, USB Staff, USB Project Manager, Subcontractor
        if ($selected_user_group == 15) {

                $output .= '<option value="8">PC Staff</option>';
                $output .= '<option value="9">PC Project Manager</option>';
                $output .= '<option value="10">SC</option>';

        }

        else if ($selected_user_group == 16) {

                $output .= '<option value="10">SC</option>';

        }

        else {
            $output .= '<option value="5">Board Member</option>';
            $output .= '<option value="6">USB Staff</option>';
            $output .= '<option value="7">USB Project Manager</option>';

        }

     $output .= '</select>';
     return $output;

 }

//  Submit Handler Function

function  user_form_edit_form_alter_submit($form, &$form_state) {

        if (isset($form_state['values']['profile_user_profile']['field_user_type']['und'][0]['value'])) {

            $user_type_name = $form_state['values']['profile_user_profile']['field_user_type']['und'][0]['value'];

            $user_roles = db_query("SELECT name, rid FROM role where name='%s'",$user_type_name);

                $LastCreatedUsername = $form_state['values']['name'];
                $fetch_uid_arr = db_select('users', 'u')
                    ->fields('u', array('uid'))
                    ->condition('name', $LastCreatedUsername, '=')
                    ->execute()
                    ->fetchAssoc();

                $uid = $fetch_uid_arr['uid'];
                $rid = $user_roles['rid'];
                $nid = db_insert('users_roles')
                    ->fields(array('uid' => $uid,'rid' => $rid,))
                    ->execute();
        }

}

?>enter code here


texts: How to display a field of the parent store in my module?

texts:
I have a Drupal 8.7 site with the Drupal Commerce 2.14 module.

I created a marketplace (several merchants on the same site). In the store type, I created a "Text (formatted, long)" field with the machine name field_terms_and_conditions.

In this field, the merchant writes his general conditions of sale, which the customer will have to accept during the order process.

When the customer orders in several stores, this will create several shopping carts (the name of the store is displayed above each shopping cart). It works very well. Now that Drupal Commerce is handling the address book, the orders are very fast.

Currently I have created a view that displays the contents of the field field_terms_and_conditions on a page. I also created a custom module to display a checkbox with a link to the general conditions of sale in a modal window.

I want to directly render the field field_terms_and_conditions in the modal window without using a view. How to do this ?

/src/Plugin/Commerce/CheckoutPane/MarketplaceTermsAndConditions.php :

<?php

namespace Drupal\commerce_marketplace_terms_and_conditions\Plugin\Commerce\CheckoutPane;

use Drupal\Component\Serialization\Json;
use Drupal\Core\Form\FormStateInterface;
use Drupal\commerce_checkout\Plugin\Commerce\CheckoutPane\CheckoutPaneBase;
use Drupal\commerce_checkout\Plugin\Commerce\CheckoutPane\CheckoutPaneInterface;
use Drupal\Core\Link;
use Drupal\Core\Url;

/**
 * Provides the completion message pane.
 *
 * @CommerceCheckoutPane(
 *   id = "marketplace_terms_and_conditions",
 *   label = @Translation("Marketplace Terms and Conditions"),
 *   default_step = "review",
 * )
 */
class MarketplaceTermsAndConditions extends CheckoutPaneBase implements CheckoutPaneInterface {

  /**
   * {@inheritdoc}
   */
  public function buildPaneForm(array $pane_form, FormStateInterface $form_state, array &$complete_form) {
    $store_name = $this->order->getStore()->getName();
    $store_id = $this->order->getStoreId();
    $pane_form['#attached']['library'][] = 'core/drupal.dialog.ajax';
    $attributes = [
      'attributes' => [
        'class' => 'use-ajax',
        'data-dialog-type' => 'modal',
        'data-dialog-options' => Json::encode([
          'width' => 'auto'
        ]),
      ],
    ];
    $link = Link::fromTextAndUrl(
      $this->t('terms and conditions of the store "@store_name"', ['@store_name' => $store_name]),
      Url::fromUri("internal:/store/$store_id/cgv", $attributes)
    )->toString();
    $pane_form['marketplace_terms_and_conditions'] = [
      '#type' => 'checkbox',
      '#default_value' => FALSE,
      '#title' => $this->t('I have read and accept @terms.', ['@terms' => $link]),
      '#required' => TRUE,
      '#weight' => $this->getWeight(),
    ];
    return $pane_form;
  }

}


texts: Make views slideshow responsive - remove inline styles

texts:
How does one remove the inline hard coded styles of height and width from views slideshow? I'm trying to make views slideshow responsive.

I'm trying to make my slideshow responsive (no i'm not interested in flexslider or another slideshow module at the moment).


texts: How to set up a train schedule content type in Drupal 7?

texts:
I'm trying to set up a site in Drupal 7 to list train schedules.

My concept is this: create a content type to manage each train.  I'm setting up each train like an airplane flight.  Each train leaves station A at a certain time, stops at a few other stations and ends at station X.

The content type needs to be able to handle which stations it will stop at (Taxonomy terms since values will be re-used) &  what time it will stop at each station.

As I said, the station names can be Taxonomy terms but I'm having trouble with the times.  While station names can be re-used, times each train stops at each station will vary.

Is there a module that will allow me to select a taxonomy term (individual station) and then allow an additional field to be edited on-the-fly to input a time?

I'm also open to alternative suggestions for setting this up.  Thanks!


texts: How to add checkbox to existing administration page

texts:
For a custom module i would love to add a checkbox to "BANDWIDTH OPTIMIZATION" under "admin/config/development/performance". I know how to add a new admin page but this is just one checkbox and i think it would fit more there.

Can anyone tell me how to do that?


texts:
I am a newcomer to Drupal. I am developing a website with multilingual support and I have translated most of the contents, blocks etc. but wasn't able to translate the Quicktab tab title.

I am using i18n, languageicons and languagedropdown modules for this purpose. How do I translate Quicktab tab title?


texts: Display main menu vertically (Drupal. 7.9)

texts:
I am not sure how this has happened. but wherever I render the block of my main menu, it displays it's links horizontally rather vertically. Essentially I want to create a main menu that displays its links vertically.

Anybody have a lead on how this can be done ? I am tempted to go into the CSS and alter the theme myself but given that Drupal probably has a switch that allows me to alter the way a main-menu is listed, I want to caution myself.

Thanks!


texts: Email sent using rules chops characters off email from address

texts:
I'm sending out an email using rules. I'm leaving the from field blank, so that it just uses the site-wide address.

For some reason it seems like Drupal is cutting characters off the from address. This is on my local dev machine so the email looks like this: admin@website.meeples

When the email is supposed to get sent, I simply get a message saying "Unable to send e-mail. Contact the site administrator if the problem persists." so I checked my syslog, and all the from headers say "someone@website.meep" and the email can't send because my machine can't resolve that domain.

What the hell? Why has it modified the from address? I've tried changing the site email to "admin@test.com" and when I do that nothing gets modified (IE I see admin@test.com in my syslog). So why is it changing my website.meeples domain?


texts: Change format of webform emails via hook

texts:
I'm trying to alter the output of webform submissions in emails. At the moment, I'm just looking for the correct function. I can see there is a hook to alter the rendered output, which is being hit, but it is not changing the output of the emails. Am I replacing the Theme function in the correct place?

function seven_webform_submission_render_alter(&$renderable) {
  $renderable['#theme'] = 'seven_webform_submission_table';
  dpm($renderable);
  kpr($renderable);
}

function  seven_webform_submission_table($node, $submission, $email, $format) {
  return 'test';
}


texts: In a form, using #ajax to add a callback when a button is pressed. When the button on my form is pressed, I wish to call some JavaScript when the button is pressed and once again when the AJAX call is complete. can anyone suggest?


texts: Output rendered entity in twig template of views style plugin

texts:
How do I output a rendered entity of a taxonomy term in a views style row plugin template?

I am able to access the field gamma from the entity reference field beta of a row with the following code:

{{ row['#node'].beta.entity.gamma.value }}

but this taxonomy term has a complex rendering of its own fields, including images, through another template. I would like to utilize that effort here, if possible, instead of pulling out each field individually.

I was hoping something like:

{{ row.content.beta }}

would work, but it doesn't.

Guidance would be appreciated!

Edit: To clarify, the style template is something like this:

{# iterate rows #}
{% for row in rows %}
  {# create marker for each row #}
  {{ row }}
  {# get a row #}
  {% set last = row %}
{% endfor %}

{% if some_condition %}
  {# do something with one of the terms #}
  {{ last['#node'].beta }}
{% endif %}

I need access to one of the row's taxonomy terms, only if there is an exposed filter in effect, tested by "some_condition" through a preprocess function that parses the URL. I don't know if there's a better way of doing that, either, but it would all "work" if I could output the rendered term.


texts: how can i define a maintenance template within a custom module?

texts:
i have done this within a module for defining custom templates when having status error

function custom_module_preprocess_region(&$vars) {

  $header = drupal_get_http_header('status');

  if( $vars['region'] == 'content' ) {
if ($header == '404 Not Found') {
  $vars['theme_hook_suggestions'][] = 'content__404';
}
if ($header == '403 Forbidden')  {
  $vars['theme_hook_suggestions'][] = 'content__403';
}
 }
 }

 function custom_module_theme() {
   return array(
'content__404' => array(
  'template' => 'region--content--404',
  'variables' => array('xxx' => null),
  'path' => drupal_get_path('module', 'custom_module').'/templates'
),
'content__403' => array(
  'template' => 'region--content--403',
  'variables' => array('xxx' => null),
  'path' => drupal_get_path('module', 'custom_module').'/templates'
),
'maintenance' => array(
  'template' => 'region--content--maintenance',
  'variables' => array('xxx' => null),
  'path' => drupal_get_path('module', 'custom_module').'/templates'
),
 );
 }

How can i implement it just the same to override the theme maintenance tpl ?


texts:
I am using Commerce Stripe as the payment gateway on my website.

Everything is configured properly, and but still while checkout I am getting this error:

"Error making the payment. Please contact shop admin to proceed."

When I checked my recent logs I found this warning there:

  Commerce Stripe is currently tested with stripe-php library versions
  1.17.1 through 1.18.0. You are using version 3.12.1, and you should downgrade.

Do anyone have any idea, what the issue is??


texts:
It's been almost 2 days I've been trying to get over this issue but I can't. So I have a content type and in Manage Display section I have a "rendered view" field using node reference, Display Suit and Node Reference View Formatter modules. I tried the module side by updating to the latest version (tried dev also) but it's not it.

anyway everything was working just fine but after a while I wanted to change some configuration in display of my content type, and when I click the edit button the Ajax thing cant be loaded and I get 502 bad gateway system/ajax error.

I checked nginx server logs and I got this:

  recv() failed (104: Connection reset by peer) while reading response
  header from upstream, server: news.example.com, request: "POST
  /system/ajax HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host:
  "tools.example.com", referrer:
  "http://tools.example.com/admin/structure/types/manage/article/display"

I'm running a nginx server with drupal 7, I already tried increasing php memory_limit, maximum_post_size, fastcgi_buffers & fastcgi_buffer_size, and didn't helped at all.

I'm not sure if it's a server issue or drupal-related, I have no Idea how to debug this, I really appreciate any help.


texts:
I made a couple websites on a drupal multisite setup.. and I want to start using https. And.. I'm just lost. Can anyone help me get started?

So, here's the details of how I have things set up..

So I have like a drupal 7 install on ubuntu, with 3 sites.. all in the var/www/html/sites folder, so for example, the folders are named

site1.example.com
site2.example.com
site3.example.com

and the sites.php file directs the requests so like

$sites = array(
    'domain1.com' => 'site1.example.com',
    'domain2.com' => 'site2.example.com',
    etc
);

and as far as dns is concerned, each domain just points at the IP of the ubuntu server and drupal handles the rest.

All that is so far so good. Got several working sites.. each domain goes to the right site.. etc. But they use http. How.. do I go about.. getting a certificate that handles the 3 sites so that they can use https?  I've not set this up before.. I've been trying to read through whatever I can find.. but I'm confused! Sorry, not sure what to do, I'm just .. lost!


texts: Attach different CSS styles on a node basing on publishing date or other PHP properties

texts:
I want to attach a different CSS style to a node, basing on the node publishing date or some PHP properties.
What would be the best way to do this?


texts: How to add wrapping elements & classes to a table in a view?

texts:
I'm building a custom theme using bootstrap 3, I need responsive tables. Yes, I'm aware of responsive_tables but I didn't like it. I want to use bootstrap's native .table-responsive. for that I need to wrap table like this:

    ...

I need to add couple more classes to the
 element.

How to do that?