texts: Thought I tracked down what is dynamically changing a field label but still happening

texts:
I am doing some work on a site that has had many hands in it. On it there is an add node which has multiple fields. When you select one option from the first dropdown, it will change the label for another field. I am looking to remove this behaviour.

The documentation said it was done in the module that was created by a long gone company. They made their own module called Intranet Base. Inside, this chunk of code looks like it is doing the work of changing the label:

function intranet_base_preprocess_field (&$variables) {
if ($variables['element']['#field_name'] == 'field_booking_contact')
    {
        if ($variables['element']['#object']->type == 'calendar_room_bookings')
        {
            if ($variables['element']['#object']->field_booking_type['und'][0]['tid'] == 228)
            {
            $variables['label'] = 'Proctor';
            }
        }
    }
}

Removing this code does not change the behaviour on the site. I have, obviously, cleared the cache a few times. But, if I leave the function in and make a mistake on purpose, the website throws an error on that line, so it appears to be reading the file correctly. I also tried:

different users
different browsers

So, I figured some module must be controlling it. I looked up methods people have used before to accomplish this, but I could not find any other methods, even using this modules that are installed.

Conditional Fields
Rules
Triggers
Display Suite
Automatic Entity Labels

I have also check the js and css folder for the theme in use.

Is there someway I can track this down? Thanks!


texts:
We have a new Drupal 8 site and are having issues with the SMTP module. The account we are using to send email works successfully on our Drupal 7 sites and in other cases, but we cannot get it to work successfully on Drupal 8. I have also tried another Non-SSL account and am getting the same two messages over and over in the error log.

  Error sending e-mail from smtp@website.com to email@email.com: SMTP Error: Could not connect to SMTP host.

  Error sending email (from smtp@website.com to email@email.com with reply-to not set).

I have found many similar questions, but not a working solution yet. Any help would be greatly appreciated, thank you in advance!


texts: What is the difference between a view mode and a style plugin?

texts: It is possible that you can define the difference between a view mode and a style plugin. As far as I understand a view mode defines what fields are outputted and a style plugin decides how to render those fields. However, is a style plugin always connected with a panel?


texts: Getting errors trying to upgrade Commerce Kickstart 1.24 to 1.34

texts:
I’m trying to upgrade my install of Drupal Commerce version 7.x-1.24 to 7.x-1.34 but am getting an update failed notice that reads:

Commerce_kickstart-7.x-1.34-core.tar.gz does not contain any .info files.

but when opening that package i see there is indeed an info file, Commerce_Kickstart.info

I’ve been Googling this message to see if other’s are having the same issue but curiously i’m not finding anything.

Is doing this manually an option? if so, do i just replace what is in the profiles folder?


texts:
I'm using CSS to implement a banner image in my theme:

#banner {
    background: url("../images/banner.jpg") no-repeat fixed
}

Site users would like to be able to change the image within Drupal. I'm thinking of adding a file upload field to the Site Information admin form, and insisting that only a file with the same name (banner.jpg) is uploaded.

I wonder if it would be possible to use a Drupal variable in my CSS instead? Then a file name change wouldn't matter. I've used CSS in .php files before (setting the content type back to CSS in the header), but never tried this in a Drupal theme.


texts: Issues removing text decoration from links in a custom block

texts:
I'm replacing the Bartik menu with a custom one. To do this, I'm building a custom block and placing it appropriately.

That all works. However, I am having issues with Text Decoration: No matter what I try, I cannot remove the line from under links, and I have also noticed a "Doubled/offset" text look. When I edit the code on 'Tryit', everything looks fine; when I unclick 'source' in the block editor, everything also looks fine.

When I update the page, I see these issues.

My entire block code is the following one.

Home

Gallery

Contact

Extra

☰ Menu ☰

Here is an image of the issue:

Notice both the underline, and the 'Doubled text'? Thats what Im trying to get rid of. Thank you in advance.


texts: Extract hex colors from image field for taxonomy vocabulary

texts:
For a project in D7. I need to extract all the colors from an image field. I am looking for a module or solution to save the colors (ie Taxonomy term). So I can search on them.

I have found a solution for D6: https://drupal.org/project/visual_search

Is there an alternative for D7?


texts: Hotel Diamond and Metatag: the META information doesn't appear in front page

texts:
I have a site using Drupal 7 and the Hotel Diamond theme. I am trying to add META tags to all the pages in my site (description, Open Graph tags, etc.), and it's working in all of them except the front page. What I do is:

I have Metatag 7.x-1.13
In the admin page, I go to "Modules/SEO", and I make sure that Metatag, Metatag:OpenGraph, Metatag:Facebook, Metatag:Twitter Cards and Metatag:Views are activated.
I go to "Content" and, in each of the pages, I hit "Edit" and add the descriptions in "Meta tags".
I go to "Configuration/Search and metadata/Metatag" and, in "Global: Front page", I add my description for the front page.

When I check my pages, all of them have the proper META tags... except the front page.

I've seen this question, but I don't really understand the answer: how do you assign a node to be front? Besides, in the case of Hotel Diamond, there seems to be a front page already assigned that you modify by editing it directly when logged in.


texts:
I'm trying to make a twitter-like "following" system for a content-type I have.

Users have an entity reference to the content-type.

What I want is a user to go onto the content and click the "follow" button. The user's entity ref field would then be populated with this content and the follow button would turn to followed.

Users can follow multiple content.

Can anybody point me in the right direction for accomplishing this please?

Update

I've now got Button and Rules and am trying to set this up, however, I've immediately hit a sticking point: I can't find my content-type in Rules. Shouldn't it be entity:MyContentType?

Update 2

See my answer.


texts: Search index as custom view for taxonomy term with hierarchy. Showing all children results in term parent in taxonomy menu

texts:
Ok so title is pretty epic, but it goes like this:
Key elements: views, taxonomy_menu, taxonomy, search api, facets.

I created vocabulary "Products" (Drupal Commerce but I don't think it's important), and there term - "Chemistry" - which should be a root of tree of other more specific terms. I added some products. Next I enabled Taxonomy Menu and created a menu, so far so good, but I wanted to use search api, so I created a view of my search index with path:

  /taxonomy/term/%

That way I wanted to override view of my taxonomy, and be able to have facets in it. And it perfectly displays indexed products of terms that have them, but it fails to display all products of CHILDREN terms. So if I have my term "Chemistry" - after clicking it - I would like to be able to see every product of its children terms. I cannot see how can I do this with current approach, as it seems that I doesn't have contextual filters for that (as my view is displaying search index).

What can I do?


texts:
I created several views with a contextual filter that helps me pull with a user ID. For instance, if user ID is 45, I get this user's data.
I am now stuck in the next step where I created a page and added my blocks. I need this page to open when user visits advisor/45 and show the block content. But instead, I get The requested page could not be found. error. I tried /advisor/{nid}, /advisor/% in the path field but nothing makes it work.


texts:
Recently I found that multiple accounts are being created in my Drupal 6.22 website by someone from a particular IP. Is someone aware of any modules to limit the user to create only one account per ip?
Thanks.


texts: I need to store an array of integers for configuration of a custom module - which of these is right?

texts:
This is a list that is permanently recorded that should be able to change at a later time, either adding or removing items from the array at a user's discretion.

First method:

variable_set('module_listOfIntegers', serialize($arrayOfInts));

Second method:

$serialized = serialize($arrayOfInts);

$num_updated = db_update('module_config')
->fields(array(
  'listOfIntegers' => $serialized,
))
->condition('config_name', 'config_name, '==')
->execute();

And the final method could be creating a 2nd table with a single column where each row just holds the integer.  That seems a bit excessive for a simple array, though.


texts: REST Services module - Access denied for user anonymous

texts:
I'm Using Drupal 7, I installed Services module with all the requirements, according to this question and this video.

I'm trying to get all users with Postman where I give my credential, but I'm getting back that I'm an anonymous user.

How do I pass my credentials?
How to add a filter to that call ,for example get all users with specific role?


texts: Running simpletest tests with clean urls on nginx

texts:
Having Drupal 7 on nginx with enabled clean urls.
nginx config:

location @drupal {
rewrite ^/(.*)$ /index.php?q=$1 last;
}

When trying to run tests getting message:

  You are not authorized to access this page.

Looks like Drupal cant resolve correctly /batch?op=start&id=28 path.
Tests running ok if clean urls disabled.

Any advise on nginx or drupal config to resolve this?


texts: how to display data in view for specific content base on permission

texts:
I want to create the view where content of specific type will be visible according to given permission for current user's role.

For Example:I have created a role and given it the permission for create, edit ,delete Article Content Type. so the view should display all the nodes for article. This should be applicable on multiple content types also.

Summary : View should display only nodes for which user has permission for create,edit,delete.


texts:
After updating module webform_paymethod_select I noticed that Ajax on webforms stopped working. I was unable to edit any existing webforms or create new ones. This happens when JS Aggregation is enabled. Clearing caches did not help.

Console shows two error messages:

TypeError: D.ajax is undefined
  var beforeSerialize = D.ajax.prototype.beforeSerialize;

TypeError: Drupal.ajax is undefined
  Drupal.ajax.prototype.commands['getBlock'] = function(ajax, response, status) {

The first error is coming from jQuery update and the second one is coming from the boxes module. Disabling boxes module worked for me but it left an important part of my site broken.

I believe the reason is that Ajax is unable to load before boxes requires it. After this Ajax just does not load at all.

If anybody can help me out, I would appreciate it.

EDIT:

I couldn't quite figure out how to get Ajax to load before everything. I tried changing its weight in drupal_add_js() and modifying hook_boot() to get it to load first. This seemed dangerous as i couldn't guarantee that it would only apply to the pages i needed Ajax to be first in. I then turned to figuring out how to encapsulate the boxes modules' JavaScript code that was throwing this error. I noticed that the code was being encapsulated with the following:

(function ($) {
  ..
})(jQuery);

Drupal suggests using :

(function ($) {
  // All your code here
}(jQuery));

That didn't work either, so i used the following instead and this made the error go away (except for the error jQuery Update is throwing):

jQuery(function($){
  ..
});

I am now able to edit existing webforms. I don't really understand why this worked, so if anybody can provide some insight i would appreciate it.


texts: Show system message to user when node is published

texts:
I'm looking for a way to show a system message to the author of a node, when the node gets published (by an administrator)

I think this must be achievable with Rules, but browsing the web and searching on stackoverflow did not help me out (yet).

This is what I did in Rules so far:

EVENT:After updating existing content of type Event

CONDITIONS: Content is published

ACTIONS: Show a message on the site


texts: Editor being able to create tabs (quicktabs style) inside CKeditor

texts:
I am trying to provide a way for our content editor to create tabbed content inside the ckeditor, but I am a bit stuck.

Do you guys, have any ideas how to do that ?

What I have already tried ?

Quicktabs module and blocks for specific page...but this method requires too much administrator rights for the editor ( quicktabs and blocks access ).

Oleg


texts: Programmatically translate taxonomy terms

texts: I have a vocabulary of taxonomy terms I get through taxonomy_term_load($tid); and displays in views page. How do I get and display the terms depending on the user's language?


texts: Custom feed tamper plugin to convert an image GUID into a URI

texts:
I have a feed importer for image files, which stores a column in my source csv as the GUID of the final files in Drupal.

I also have another importer for, say, articles. In the articles csv, there is an "image key" column, that corresponds to the image GUIDs mentioned above.

I'm working on a custom feeds tamper plugin that can convert the GUIDs to the image URIs that have already been imported by the first importer, but I'm completely lost on how to retrieve the images in the code.

So, the question is: how do I convert an previously imported image file GUID into the actual image's URI?


texts: Tracking an authenticated user's first visit to a Panels page and forward them to another page on subsequent visits

texts: I'm looking to expose authenticated user stat information to CTools / Panels.  Basically, I need to have a Panel variant that says: If the user has never visited the page, display this variant, if they have, display this variant.


texts: views and contextual filter with entity reference to current user

texts:
I have a view that I need to filter based on the current logged in user, however a secondary entity reference is in-between the two.  Pretty sure I need to add in PHP contextual filter code but not exactly sure what is needed.

Scenario:

inventory has an entity reference to retail_location.
retail_location has an entity reference to users.
I need to display inventory based on the retail_location of the logged in user.

D7.


texts: What should I enter as "Database file" for a SQLite database?

texts:
So I've practiced making Drupal 7 before using XAMPP and I want to try to make a Drupal 8 page but I have no clue about what to put in the field you can see in the picture below. I made a database in PHPmyadmin.

What should I enter in the Database file field?


texts: Is it important to use base table in query?

texts:
Is it important to use base table for entity in query? For example if I want to get all user's id of specific role, should I do:

  $query = db_select('users', 'u');
  $query->distinct();
  $query->fields('u', array('uid'));
  $query->innerJoin('users_roles', 'r', 'u.uid = r.uid');
  $query->condition('r.rid', 3);

or

  $query = db_select('users_roles', 'r');
  $query->fields('r', array('uid'));
  $query->condition('r.rid', 3);


texts: Views missing filters for existing view. New view shows the filters

texts:
I've created a number of views without problem. But when I try to edit them most of the filters provided by other modules are missing:

When I create a new view the filters are there:

I've been able to edit them in the past, but only recently has this problem occurred.

Any thoughts on the cause, and also what can be done to fix it?


texts: Drupal Views argument menu - sending %! to end of URL

texts:
Im building this project managment site that uses organic groups to sort and name projects.

So I have example.com/project/6. Where 6 is the organic groups views argument of %1.

What I am struggling to do is be able to create links that send for example 'gallery' to the end of the URL so example.com/project/6/gallery would show the gallery for project 6.

I am trying to create a global menu where all items would work for any organic group you may be within. So if you were within project 5 (http://example.com/project/5) the same menu item of 'Gallery' could be used to display example.com/project/5/gallery.

I have tried with all normal drupal menu methods but %1 is never accepted. The main thing is to be able to send for example '/gallery' to the end of the URL, or use any other method to achieve this.

Hope I have explained myself correctly.

Many thanks in advance.


texts: Points-based tasks: pledging and tracking

texts:
I am a member of a social organization and run its Drupal 7 website. We will be starting a campaign in a couple of weeks to challenge members to pledge to accomplish certain points-based tasks (not related to the website), and want to track the pledges, completions, and rolled-up sums.

There are roughly 100 tasks, with different point values and descriptions. Tasks are individual: more than one member can pledge to do a task.
A member would sign up on a per-user page to complete certain tasks. The sums of a member's pledged tasks and completed tasks should be displayed on the per-user page, and there should be a summary of all members' pledged and completed points and tasks available as well.
A member needs to be able to return to his/her page to update pledges and completions.

I believe I can do something for this with Webform, but it may be somewhat awkward. I'm not sure I can do the per-member sums and the rollups easily. User Points might help a bit, but it's not really oriented toward this. I could write a module as well, but I'm  not sure I have time to do that. Suggestions for other modules or implementing this quickly are welcome.


texts: Shipping rules for group of countries (ex. UK or ITALY)

texts:
I'm creating the shipping rates depending on country. I've got groups of countries with the same rate.

I've installed Shipping 2.0 and Flat Rate module.

I've limited the available countries through the customer profile and then I've created the flat rates for group of country (ITALY or BRAZIL) and some for a single country (UK).

In the components I did this

Condition:
Order address component comparision

Address : Shipping address

Address component : Country

VALUE : GB

(REMEMBER, THE VALUE IS THE TWO LETTER ABBREVIATION, ITALY WILL BE IT AND UNITED KINGDOM IS GB. YOU CAN FIND IT LOOKING A THE HTML OF THE SHIPPING FORM)

I've added one condition per each country of that group. I've implemented with OR but for some reason it does not work.

This is the result:
Condition 1 : IT

OR

Condition 2: FR

This does not work, so I tried:

Condition 1: IT

--OR

----Condition 2: FR

But nothing...

What Am I doing wrong? It's something related to the "OR"?

The flat rate with single country works, the one with complex rules doesn't.

I SOLVED IT: IT WAS THE CONDITIONS POSITIONS. THE RIGHT WAY TO USE "OR" IS THIS:

OR

--CONTITION 1

--CONTIDION 2

HERE YOU CAN FIN A REALLE NICE RULES TUTORIAL


texts: File management- preventing the deletion of files referenced by nodes

texts:
I'm not a Drupal user normally but a client wants to move from a 200 page flat file site managed in DreamWeaver to a Drupal site.

Issue is that their secretarial staff who have been managing the site in DW want Drupal 8 to warn them before they delete a media file referenced by Drupal nodes.  This is for them primarily images and PDFs which they intend to add to the server via FTP.

Can anyone direct me to a module that provides either that warning functionality or a list of nodes referencing media and PDF files?


texts: How can I redirect users upon login sometimes but not break the "Forgot password?" function?

texts:
I'm using Rules to redirect users with certain roles upon login using the Page Redirect action.  The "Force redirect" option is set to true (changing this to false does not fix the problem, and if it is false then users who log in from a block on the front page are taken back to the front page, which is not what I want).

My problem occurs when a user forgets their password and requests a one-time login link via e-mail. When the user clicks the link, he/she is taken to the login page.  From this page, pressing "Login" will redirect the user according to my custom rule instead of taking the user to the page where the password can be changed.

How can I redirect my users using Rules without breaking the forgot password function?


texts: Credit card and check payments in one order type

texts:
I've created a store in Commerce 2.  The store has 1 order type currently, which uses the default workflow (Draft->Completed/Cancelled).  There is also 1 order item type only and all products belong to it.  We currently have 1 payment gateway for people to pay by credit card (live).

I am now being asked to add payment by check as a possibility.

I added a new "Check" payment gateway using the "Manual" plugin and things looked good, but when choosing it, the order gets the "Completed" status.  (Payment is "Pending" as expected.)  This is rather counter-intuitive for the staff.  Another status (even staying at "Draft") would be preferable.

I though to switch the order type to the "Default, with Validation" workflow (Draft->Validation->Completed/Cancelled).  This seems like to right solution for people paying by check... But the vast majority of people pay by credit card and their order should be immediately be completed without any validation.

I also read up on creating a 2nd order type with the "Default, with Validation" workflow, but that seems to entail having a completely separate order item type (and therefore separate products!) so it seems like the wrong way to go.

Is the solution to create a custom workflow that encompasses both
possibilities?  (With a way to transition from "Draft" to "Completed"
for credit card payments and from "Draft" to "Validation" for check
payments.)
Or is it better to use the "Default, with Validation" workflow and
have a subscriber wait for when an order is set to the "Validation"
state, verify the payment gateway and advance the credit card orders
to "Completed" automatically? (seems a bit hack-y)
Is there another solution to this (I assume) common problem that I
missed?


texts: Is it possible to put Drupal.settings javascript in separate file

texts:
I am trying to place all javascript in external files, is it possible to place Drupal.settings javascript in an external file? It is displayed like:

jQuery.extend(Drupal.settings, { "basePath": "/", "fbconnect": { "user_pictures": "allow", "language_code": "en_US",...


texts: Generate menu links for a view with contextual filter and parameters in the path

texts:
I have a view with a contextual filter, and a few tabs corresponding to a taxonomy. In my module.links.menu.yml I have something like this:

mymodule.apple_view:
  title: 'List of apples'
  route_name: view.fruit_view.page_1
  route_parameters: { fruittype: 'apple' }
  menu_name: main

So I have my tab "List of apples", but the URL has the form http://localhost/it/fruit_view?fruittype=apple (which works), but I'd rather have it as http://localhost/it/fruit_view/apple (which also works). I suppose there may be a parameter for .link.menu.yml to achieve this, but I cannot find the full documentation. I checked the documentation and the source, but that didn't help. Any suggestion?


texts: What is the fastest/simplest way to add/manipulate PHP on a page?

texts:
As a PHP developer familiar with MVC frameworks, I am having some difficulty figuring out Drupal.

I like the block setup. I am looking for some simple step-by-step guide to:

Add a block with my own PHP code.
Alter the html/php of other blocks.

Failing that, I would like to see some code which does these things.

Here is what I've been trying to do, more specifically:

There is a button. When it is clicked a DB query is executed.
Hide the "create new account" link on the login dialog. No account for you!


texts: I can't install views module. Error Memory or infinite loop

texts:
Possible Duplicate:
  How do I avoid the error “out of memory”?

In my site, I can't install Views module. When I check it on admin/modules and then I press on save configuration I've got these error:

  Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 32 bytes) in (...)/public_html/includes/menu.inc on
  line 3714.

This is the code of menu.inc file:

3709  $item += array(
3711    'access arguments' => array(),
3712    'access callback' => '',
3713    'page arguments' => array(),
3714    'page callback' => '',
3715    'delivery callback' => '',
3716    'title arguments' => array(),
3717    'title callback' => 't',
3718    'theme arguments' => array(),
3719    'theme callback' => '',
3720    'description' => '',
3721    'position' => '',
3722    'context' => 0,
3723    'tab_parent' => '',
3724    'tab_root' => $path,
3725    'path' => $path,
3726    'file' => '',
3727    'file path' => '',
3728    'include file' => '',
3729  );

Problem with 'page callback' => '', ??

It's like a infinite loop that crash, because 256 M for Drupal 7 it would be sufficient.

Actually the value of variable memory_limit of php.ini is 256M . I can't increase it because is a shared hosting, and 256M is the limit. I don't have access via SSH

I try to modificated this value in settings.php, but it's locked on 256 by hosting provider

php_info show this:

Directive        Local Value    Master Value
memory_limit     256M           256M

The list of installed non-core modules are:

Administration menu
Boost
Chaos tools
Libraries
Pathauto
Pathologic
Redirect
Smiley
Sub-pathauto
Tagadelic
TagCanvas
Token
Transliteration
XML sitemap

Thank for you reading. Grettings


texts: How to programmatically create forum topics using entity api?

texts:
I used this post and this post to get started but I was trying to use only the entity API.

Here is my code. So far the node creation works but I'm not able to save the node under the correct tid.

global $user;
$properties = array(
'type' => 'forum',
'uid' => $user->uid,
'status' => 0
);
$entity = entity_create('node', $properties);
$wrapper = entity_metadata_wrapper('node', $entity);
$wrapper->title = "My new forum topic";
$terms =  taxonomy_get_term_by_name ('General discussion','forums');

//$wrapper->taxonomy = $terms; //Doesnt work
//$wrapper->forum_tid = $terms->tid; //Doesnt work
//$wrapper->taxonomy_forums = $terms->tid; //Doesnt work

$wrapper->save();


texts: Menu items links should navigate to default language instead of current language in a multilanguage page

texts: I am using i18n module and I have a page in spanish language. So when I navigate to other pages in the website then, my url will be like http://mysite.com/es/about. In that spanish page, I have added few menu items. The menu items links should defaults to English language instead of the current selected (spanish) language. Please help. Thanks


texts: Unable to set the data property xxx as the parent data structure is not set

texts:
I currently use geofield to set latitude and longitude but rules gives me this error:

0 ms Unable to modify data "user:field-coordonnees:lon": Unable to set the data property lon as the parent data structure is not set.

So values are not set and I do not understand why, it's just a set data.
The value exists because I can see it in a "Show a message on the site". I've also tried to cast the value as Integer, nothing has changed.
Any idea ?
Configuration:

Geofield Map 7.x-2.3
Geofield 7.x-2.3
geoPHP 7.x-1.7


texts: How to exclude nodes in one taxonomy based view from another taxonomy based view?

texts:
I have a taxonomy term view that uses a contextual filter for "Has taxonomy term id" and displays nodes with the term. I have a view attachment set up that uses the same contextual filter and displays the most recent nodes with the taxonomy term and an image. The attachment displays on the same page as the taxonomy view, just above it.
How can I exclude the nodes from the attachment in the taxonomy term view?
Due to some nodes not having images, I cannot simply use the pager offset. I have tried the OtherViews filter and Views Exclude Previous module, but both are node based solution and did not work with the taxonomy contextual filter.


texts: custom block's BLOCK_VISIBILITY_LISTED not working on profile installation hook_install()?

texts:
Why this cannot work in my profile installation?

array(
  'module' => 'views',
  'delta' => 'views-block',
  'theme' => $default_theme,
  'status' => 1,
  'weight' => 0,
  'region' => 'map_region',
  'visibility' => BLOCK_VISIBILITY_LISTED,
  'pages' => '<front>',
  'cache' => -1,
),

Is just a copy of standard's profile hook_install() and i add a views block installed with the profile in $blocks array.

All is set right except block only visible in front page ("front" is set correctly in the block config 'pages' but the visibility setting is stuck to 'All pages except those listed')

Looks like the system module re-sets them upon install.


texts: Why do the database functions return all fields as strings?

texts:
db_select('my_table', 'a')
   ->fields('a')
   ->condition('a.campaign_id', $entity->campaign_id)
   ->execute()
   ->fetchObject();

my_table has some columns that are integers, but the query above returns strings.

Why does this happen? It seems strange to me that the query ignores the column types.


texts: How to handle GET parameters in the proper Drupal way

texts:
I am working on a module that will handle the email subscription functions for our newsletters.

Email newsletters are sent out to subscribers with a link on them for them to unsubscribe. This link is in the format http://www.site.com/opt-out?email={email_address}. This is how the links are formatted and I can't change that.

What is the proper way to deal with that parameter using Drupal? Of course I have access to $_GET['email'], but is this the proper way of accessing it in a Drupal module? What about input filtering? Should I just do a plain $email = filter_var($_GET['email'], FILTER_VALIDATE_EMAIL); ?


texts: How insert values from client page to database by use custom module

texts:
Help me pls. I need update database table in Drupal 8. Exemple on image.

When user click on button "ADD PRODUCT TO CART", cart value must update on page (its not a problem), cart value and user ip-address must be write to database.
Im try use ajax for this logic, but values do not write to database.
Js code:

jQuery('.cart button').on('click', function () {
var price = jQuery('.price').text();
var priceValue = parseInt(price.substring(0, price.length - 1));
var cart = jQuery('#cart');
var cartValue = parseInt(cart.text().substring(0, cart.text().length - 1));
cart.text(cartValue + priceValue + '$');

jQuery.getJSON("http://jsonip.com/?callback=?", function (data) {
    var ip = data.ip.toString();

    jQuery.ajax({
        type: "POST",
        url: "../myupdate.php",
        data: ["ip="+ip, "cart="+jQuery('#cart').text()]
    }).done(function () {
        console.log('done');
    }).error(function () {
        console.log('error');
    });

});

});

php code:

<?php
$ip = $_POST[ip];
$cart = $_POST[cart];
db_insert('abweb')
    ->fields(array('ip' => $ip, 'product' => 'some product', 'price' => $cart))
    ->execute();

This logic is implemented in the custom module. HELP PLS!!


texts:
Mock:
Site: http://www.mastersfunds.com.php5-23.dfw1-2.websitetestlink.com/funds-and-performance/equity-fund

Brief: The mock has the title with 2 font styles. The first part is in blue text and the fund/ticker is in a smaller, light gray font.

Is there a way to use VIEWS to display the TICKER font/html directly after the Title as displayed in the mockup? What VIEWS settings would I use?


texts: How to achieve european style VAT in Ubercart 3?

texts:
I would like to implement european style VAT taxes in ubercart.

Right now, this is sort of possible except for the fact that only the sell price is saved with taxes in the db.

What I need:

I need to be able to choose the tax on a per product basis. For example: food products usually have a VAT of 6% while most other items have a VAT of 21%. I need to select this at product creation.
I need to be able to save both the cost price and the sell price with a tax amount (this could be a different amount)

Possible solutions:

The first problem could be solved by creating a tax taxonomy, attaching this to the product and checking for it in rules. The problem is that I don't seem to be able to do any checks on the taxonomy of a product at the tax conditions.

I don't have any ideas (or a good enough understanding of ubercart) to solve the second problem.

I know about the uc_vat module but it is not available for ubercart 3.
And there don't seem to be any modules with similar functionality on drupal.org.

Any suggestions would be appreciated.


texts: How to implement a transaction process between users using the Privatemsg module?

texts:
I am trying to develop a transaction process between two users who can do transaction using a form with two fields:

a text message to communicate back and forth
a virtual point to trade the product instead of regular currency.

So I customized the checkout process in the Drupal Commerce module. And I tried the Privatemsg module for messages. And Commerce userpoints for the virtual currency. I also customized the "Price" field in Commerce Product field.

I thought I might use Commerce Extra Panes to replace the default checkout steps, but I am stuck because the Privatemsg message text field may not display in the extra pane (I created a content for Privagtemsg to be attached and Extra pane may include the content node with Privatemsg).

This process allows the store owner to use messages and virtual currency to negotiate with the buyer back and forth, so we need a form for them to fill. I also wonder if Rules may provide a form that allows users to enter whatever they want in the checkout process?

I am new in Drupal so I am not sure if this is a good approach. Do you think if this way works? Or any other solution?


texts:
I've configured my view to show only a teaser of the nodes it's loading, but for some reason, the title of the node just won't show up.

I've looked in my node.tpl.php  but as it turns out, this file isn't even used and my template.tpl.php only states this:

if ('teaser' == $vars['elements']['#view_mode']) {
  return;
}

What am I doing wrong?


texts:
My Drush was installed on /usr/local/lib/php/drush; I have now removed it from there, and installed it on /usr/share/drush.

I run the following commands.

chmod u+x /usr/share/drush/drush
ln -s /usr/share/drush/drush /usr/bin/drush

When I type which drush, it shows /usr/bin/drush, but when I run drush status or drush version, or any drush command, it doesn't show any result or error.

I was previously seeing errors related to Ioncube and Zend Guard Loader, but those have now been resolved, while Drush is still not working.

From php -v, I get the following output.

  PHP 5.4.23 (cli) (built: Jan  9 2014 23:00:41) Copyright (c) 1997-2013
  The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend
  Technologies
      with the ionCube PHP Loader v4.4.1, Copyright (c) 2002-2013, by ionCube Ltd., and
      with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies

My drush version is drush-7.x-5.9.


texts:
I'm using managed_file in a form to uplaod multiple images (D7).

$form['img_upload1'] = array(
'#title' => t('Image'),
'#type' => 'managed_file',
'#upload_validators' => array(
    'file_validate_extensions' => array('gif png jpg jpeg')),
'#default_value' => variable_get('img_upload1', ''),
'#upload_location' => 'public://uploads_users/mydir/'.$userId,
);

Allowed file-extension are checked when the user chooses an image and in the form-validate-function the filesize is checked. The images should have a max hight of 730px or max width of 970px.

I can find the dimesions of the uploaded picture bud don't know how to resize it. Is there a way to add a scaling-function (an image-style?) to the managed_file-formfield or to the validation-function to resize the image before ore after the upload?

Thanks

UPDATE
Thank you for your hints. The idea behind all was to have the original files available in a defined dimensions for an other purpose. Bud I see the benefits of using the "Drupal-way".


texts: I am looking for a method to put différents slideshows on different pages. I mean every pages must have his own slideshow. Is it possible?


texts: Output empty text instead of unevaluated token (in JS Block)

texts: I'm trying to output data through a block using JavaScript for Intercom. Most tokens work fine, but if the source field for the token is blank, the token itself is returned instead of any value. Of course, I don't want to pass the unevaluated token. Any tips?


texts:
I am trying to move the first chunk of code including the PHP logo call, and the breadcrumbs into the header region. I have created the block, and made it capable of reading PHP. I understand I need to write a preprocess function in template.php, but I am not sure how this is done. I am working in Drupal 7.

Can anyone show me an example, and explain how this works, or point me in the right direction?


texts: Search index only part of custom content type

texts:
If I add a search index  display on all my custom types, and set visible only a few columns, those columns will only be included in the search index ?

My problem is that i have columns i don't want to index (like file names), and i don't know how to do it.


texts: Show menu only when user ticks the checkbox

texts:
I have a menu for user to enter user details which should visible only to logged in user, it works fine. Now I want to add another restriction where I want menu to be displayed only to the user who ticked the checkbox during registration (i.e.,) In registration form there will be a checkbox when user tick the checkbox the menu should be visible otherwise menu should not be accessed by use. I tried following code but not working.

 function my_module_form_alter(&$form, &$form_state, $form_id) {
   if($form_id = 'user_register_form'
   $form['checkbox1'] = array (
      '#title' => 'XYZ',
      '#type' => 'checkboxes',
      '#options' => array('Sell themes'),

   );
 }
 function my_module_user_register_form_submit_handler($form, &$form_state) {
   $check = $form_state['complete form']['checkbox1'][0]['#checked'];
 }
 function check() {
   if($check !== 1) {
   return TRUE;
   }
   return FALSE;
 }
 function my_module_menu_alter(&$items){
   $items['node/add/detail']['access callback'] = 'check';
   $items['node/add/detail']['access arguments'] = array(1);
 }

$check return 1 if checkbox is ticked. But it is not working. Please Correct my mistake. Thank You


texts: Drupal 7 Views Contextual Filter Override Title, but Make Singular

texts:
I have been able to setup a view that uses contextual filters that are taxonomy terms.  The terms are categories and as such are written in the plural form, for example, "Posters" or "Flyers".  However, when I overwrite the titles by using the %1 override I want it to print out "Poster Templates" instead of "Posters Templates".

Here is my current configuration:


texts: how to get password as submitted by the user in hook_user_insert?

texts:
I have extended the core using hook_user_insert. but when i print the $edit argument inside the function i get password fields as encrypted.

Is there any way i can get the non-encrypted value of password as submitted by the user.

I am using drupal 7

Following is the $edit array

Array
(
    [uid] => 28
    [hostname] => 127.0.0.1
    [roles] => Array
        (
            [2] => authenticated user
        )

    [cache] => 0
    [administer_users] =>
    [name] => raul1
    [mail] => raul1@tst.com
    [pass] => $S$DskyNMYOrdQoEdErlYPN701I1jSBBrzetjSjb2XPzlooVcfcp8Rp
    [status] =>
    [notify] => 0
    [timezone] => Asia/Kolkata
    [signature] =>
    [picture] =>
    [picture_delete] => 0
    [picture_upload] =>
    [signature_format] => filtered_html
    [init] => raul1@tst.com
    [field_first_name] => Array
        (
            [und] => Array
                (
                    [0] => Array
                        (
                            [value] => Raul
                        )

                )

        )

    [field_last_name] => Array
        (
            [und] => Array
                (
                    [0] => Array
                        (
                            [value] => Garcia
                        )

                )

        )

    [is_new] => 1
    [created] => 1356067366
    [theme] =>
    [access] => 0
    [login] => 0
    [language] =>
)

is there any tweaking to get the user submitted password from D7 registration form?

I know its impossible to get back the hashed value. or how to find out the salt associated with each hashed password


texts:
I can't figure out where I need to place the crossdomain.xml (to let Flash communicate).

If I place it on the root of my Drupal installation, the cross-domain-policy is not working because the symlink redirects the user-agent to the multisite folder.

If I place the crossdomain.xml in the multisite folder, it doesn't work either.

What should I try?


texts: Is there a base form for fieldable entity settings?

texts:
I've build custom entity by extending ContentEntityBase class. It's very similar to the entity from content_entitity_example.

I'd like to allow users to manage fields display the same way they can do it with nodes. Is there a base form class that can generate the form for fields display settings automatically?

The example module provides entity settings form that is derived from Drupal\Core\Form\FormBase however it does not provide any form fields for managing the entity view settings - the form is just empty.


texts:
I am getting this error while changing the logo of my site,

i  have tried changing the permission through hosting provider, added php_value safe mode 0 in .htaccess file and even added one file in drupal folder named php.ini with

safe_mode = Off
file_uploads = On
upload_max_filesize = 256M

but still i am unable to change the logo and getting the error

  File upload error. Could not move uploaded file.


texts: How to get drupal to remove /drupal/ from all the links on the website

texts:
I first ran the install.php when drupal was reachable as example.org/drupal/, then later I changed the Apache configuration to make it into a virtual host.  Now that I can reach the site at example.org, the problem is, all links available on that page still have /drupal/ in them, and result in 404.

I have tried uncommenting "RewriteBase /" in the .htaccess file, and restarting Apache.  Nothing changed.  There is nothing of use in the settings.php file for the site.

There are a lot of web pages that seem to solve this, but they are either for older versions of Drupal or just don't work.

I can force the correct URL's down Drupal's throat with an additional rule in the Apache configuration to rewrite the URL without the /drupal/ link, but come on, there must be a less hackish way to fix this.

Also of note, I'm trying this out on Arch Linux, so some file paths might be different.  But this is a configuration issue, not a file path issue.

EDIT: for clarity, what I want is all links to show as example.org/blah without the /drupal/ being automatically inserted.


texts: How do I create template file for view field, My view machine name is page_search and field name is room type.


texts:
I'm trying to display an image on the search api page result. I tried the following way: Displaying Images in Search Results, but I'm getting a "Notice: Undefined index: node...template.php" error. Off course after changing the preprocess function to theme_preprocess_search_api_page_result. Am I getting this error because the following preprocessor works only for the search module? Is there another way to add an image to the search api result?

I'm using the following modules version:

Search API 7.x-1.17
Solr search 7.x-1.10
Search Api Page 7.x-1.2


texts: How to restrict entity reference displaying values?

texts:
I have a requirement which I feel quiet complex. I am using Entity reference in X content type to reference a content type(assume Y). This works fine by displaying all the values of Y in X.
  Y content type is having one field that is true or false type. So I want to display values in select list of X content type only which is having true value in the Y content type.So how can I achieve that, any suggestions will be appreciated.


texts: I would like to modify the styling of the tracker module and also move it's content from a separate user profile tab to the main tab. What is the best way to accomplish this? Modifying the core module would be a bad idea right? I may also want to edit the module to change functionality.


texts: How to integrate the Piwik web statistics tracking system in a Drupal site?

texts:
Right now, I put the Piwik code at the end of html.tpl.php.

How I can integrate it in a Drupal site, so that this JavaScript can be aggregated? Or better loaded and keep my template clean?

Can I put this code to an external JavaScript file (+ how?) and then just declare it at theme.info?


texts:
I currently have a site that has quite a lot of blocks (about 120 in 1 region and many others in other regions).

Recently the Block admin page stopped working for me. I can't add any blocks through that screen, however when I go to the block detail page, I can.

All new blocks are handed the weight 0, and I cant change that (not by drag and drop, neither by manually entering the weight).

Anyone who know how I can fix this? Is it because there are too many blocks?


texts: Multiple and similars forms - Webform or Content type

texts:
I am working on a project that require a lot of similar forms. I had the idea of creating a content type per form, but with only 2 content types for this forms I am close to 100 fields already and I am concern with performance and scalability.

The site runing Drupal 7 will have users that will fill this forms and since they are content type the permissions are easy to apply to allow the user to only see, edit and/or delete their own content. I started to think that maybe the webform module was better for this task as I will have a lot of forms, but that I will see them as nodes with the form attach to it.

My questions is:

Will the module webform allow the users to only see their content and have access over it (CRUD)?

Any other suggestion on how to accomplish this task is always appreciated.


texts: Why path prefix is always leading to en instead of User's preferred language?

texts:
I am working a multi-lingual website which has 9 languages enabled. But the issue I am facing is irrespective of user's preferred language, site will be always prefixed with en. The required behaviour should be when chinese preferred language user logged in, it should be prefixed with https://example.com/zh-hans. Below are the Language detection combinations I tried:

I tried with User Account Language Negotiation  module also. But no success. Can anyone help me in this regard.


texts: Where do pending drush database updates live?

texts:
I'm using drush to update the modules on our drupal site. I updated the video_embed_field module to the latest version.

This update required 3 database updates to occur, 7006, 7007, and 7008. For some reason 7006 failed as documented here. That link includes a patch which should fix the problem, the only issue is I have no idea where the patch needs to be applied. i've applied patches to drupal modules before, but video_embed_field does not appear to have a directory in sites/all/modules which is where I think the patch ought to go.

When I run drush updb it wants to apply those three database updates, but I can't find them stored anywhere in the file system (or any references to video_embed_field at all). Are these database updates stored in a table in the database, is their a folder somewhere I'm not looking at? Is there another folder where modules get placed?


texts: Enabling Views module causing cron to fail

texts:
Quite simply, I enable the super common "Views" module, and on Save nothing but a white page happens.
On a refresh (Where I agree to the form resubmission) the modules page comes back just fine.

Then I click the "Run cron" link, and that is also blank, and never shows anything else or redirects.

Visiting cron.php by itself, also blank.

I've seen some solutions, such as increasing php's memory_limit and mysql's max_allowed_packet, but neither have done anything.

Everything runs optimally again the moment I disable Views.

Some info:

Web server: nginx/1.4.6
PHP: 5.5.9
PHP memory limit: 256M
Drupal: 7.35

I've never had this problem before, especially with Views


texts:
I have a minipanel that out puts a price, based on the node, but without a currency symbol. I wanted to add a dollar sign so created a new .tpl file and added it as such:

<div class="<?php print $classes; ?>" <?php print $id; ?> <?php print $attributes; ?>>
  $<?php print render($content); ?>

However, the content renders a div as well, so on the front end I get:

$

49.99

Would anyone know where I can access this 'entity-property' div so I can drop in my '$' sign?


texts:
I am struggling with it, but I can't do it by myself. Google doesn't gave me links for tutorials other modules doesn't help me too.

I would like to export content types definition from Drupal site to another.

Could someone give me any hint how to do it?


texts: Remove taxes using Rules after coupon is redeemed

texts: I'm attempting to create a rule that removes taxes from a line item after a Commerce Coupon is applied. Is there a way to do this?


texts: How do I alter the submission button class?

texts:
<input type="submit" class="form-submit" value="" name="op" id="edit-submit">

I want to alter the class from "form-submit" to "form-submitone".

How can do I do it? Where does the class "form-submit" come from?


texts: How to add a 'read more' theme link to a custom view mode?

texts:
In Drupal 7 the Teaser view mode automatically comes with a 'read more' theme link. I need to retain the Teaser view mode and then create another called 'Snippet', which is basically the same as Teaser but has a lot less content in the trimmed area.

I created a custom module and added the view mode...

/**
* Implements hook_entity_info_alter().
*/
function mymodule_entity_info_alter(&$entity_info) {
    // Add a custom view mode
    $entity_info['node']['view modes']['snippet'] = array(
        'label' => t('Snippet'),
        'custom settings' => TRUE,
    );
}

But it doesn't activate the 'read more' link like Teaser does. Can anyone point me in the right direction with this please?


texts:
We've had a custom theme made out of two themes combined basically a news and a video content section--I've installed WYSIWYG and TinyMCE.  The weird thing is that the rich text editor only shows up when editing content in the video section, and not the news section. In the news section, not even the Enable Rich Text hyperlink shows up.

Is there a particular line of code I can look for that would enable the link (and therefore the editor) to show up in the news section?


texts:
We are using Drupal to drive the fields on a JSP page on a Java web site.  I can easily enough create a Long Text field and populate it with text such that a text element becomes a radio button or input field on the JSP.

But I also need to drive input fields that have dropdown items.

I am casting about looking for ideas of how to do that without brute-force programming.


texts:
I have created content type with CCK in which there are fields like taxonomy, filefield, textfield etc.
Now i want form structure of this content type.


texts:
i have a custom template for a custom module block. here is the one select box

$form['calculator']['state_select'] = array(
    '#type' => 'select',
    '#title' => t("State"),
    '#default_value' =>  $state_select_options_selected,
    //'#default_value' =>  'Please Select',
    '#options' => $state_select_options ,
    '#prefix' => '
',
    '#suffix' => '
',
    '#ajax' => array(
        'callback' => 'calculator_state_select_ajax_callback',
        // 'wrapper' => 'state-select-replace',
    ),
);

and here is the template function

function calculator_theme($existing, $type, $theme, $path){
 $themes = array(
'calculator_form' => array(
  'render element' => 'form',
  'template' => 'calculator_block',
  //'path' => $path . '/templates',
),
);
 return $themes;
 }

im displaying the form like this

print drupal_render_children($form['calculator']['state_select']);

the problem is that with the template the form ajax call does not work.


texts: Migration query works but migration fails due to sourceid not being found

texts:
Here is my migration class:

class TaxonomyPrice extends SqlBase {
  /**
   * {@inheritdoc}
   */
  public function query() {
    $table1 = $this->select('venue', 'v')
      ->isNotNull('price')
      ->condition('price', '', '!=')
      ->groupBy('price')
      ->fields('v', ['price']);

    $table2 = $this->select('item', 'i')
      ->fields('i', ['price'])
      ->isNotNull('price')
      ->condition('price', '', '!=')
      ->groupBy('price')
      ->union($table1);

    $table3 = $this->select('nodes_venues', 'nv')
      ->fields('nv', ['price'])
      ->isNotNull('price')
      ->condition('price', '', '!=')
      ->groupBy('price')
      ->union($table2);

    return $this->select('sc_article', 'sca')
      ->fields('sca', ['price'])
      ->isNotNull('price')
      ->condition('price', '', '!=')
      ->groupBy('price')
      ->union($table3);
  }

  /**
   * {@inheritdoc}
   */
  public function fields() {

    $fields = [
      'price' => t('Term name'),
    ];

    return $fields;
  }

  /**
   * {@inheritdoc}
   */
  public function getIds() {
    return [
      'price' => [
        'type' => 'string',
      ],
    ];
  }
}

When I run drush ms I can see the correct number of items being counted.

$ drush ms taxonomy_price
 Group: Taxonomy Migrations  Status  Total  Imported  Unprocessed  Last imported
 (taxonomy_migration)
 taxonomy_price                Idle    121    0         121

But when I try to run the migration it gives me an error related to the sourceid.

$ drush mi taxonomy_price
Migration failed with source plugin exception: SQLSTATE[42000]: Syntax error or access violation: 1055     [error]
'drupal_8.map.sourceid1' isn't in GROUP BY: SELECT sca.price AS price,
map.sourceid1 AS migrate_map_sourceid1, map.source_row_status AS migrate_map_source_row_status
FROM
{sc_article} sca
LEFT OUTER JOIN drupal_8.migrate_map_taxonomy_price map ON price = map.sourceid1
WHERE  (price IS NOT NULL ) AND (price != :db_condition_placeholder_0) AND( (map.sourceid1 IS NULL ) OR
(map.source_row_status = :db_condition_placeholder_1) )
GROUP BY price UNION SELECT nv.price AS price
FROM
{nodes_venues} nv
WHERE  (price IS NOT NULL ) AND (price != :db_condition_placeholder_2)
GROUP BY price UNION SELECT i.price AS price
FROM
{item} i
WHERE  (price IS NOT NULL ) AND (price != :db_condition_placeholder_3)
GROUP BY price UNION SELECT v.price AS price
FROM
{venue} v
WHERE  (price IS NOT NULL ) AND (price != :db_condition_placeholder_4)
GROUP BY price; Array
(
    [:db_condition_placeholder_0] =&gt;
    [:db_condition_placeholder_1] =&gt; 1
    [:db_condition_placeholder_2] =&gt;
    [:db_condition_placeholder_3] =&gt;
    [:db_condition_placeholder_4] =&gt;
)

I read through the documentation for getIds(), but I didn't see anything there that would help me figure out what's wrong.


texts:
I'm trying to create my first module. I'd like to know if I can use annotation route like Symfony instead of separated files.

For example, can I use the second snippet instead of the first one?

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

/**
 * @Route("/hello/world",name="hello_world")
 * @Method({"GET"})
 */
 public function myCallbackMethod() {


texts: What error has the value of one in regards to the file_save_upload in Drupal 6

texts:
I called file_save_upload and then form_get_errors. form_get_errors returned 1.

What is this error? I tried googling for this error, but I guess the words I used to search for it weren't good enough.


texts:
I need to make asynchronous page requests on every page load using AJAX, the idea being that a function in my module is called even when pages are cached.

The only documentation I've been able to find (Drupal 7) is for form handling using AJAX and handling links.

How do I call a module function from a custom AJAX request? Would I just implement hook_menu() and write a custom ajax request or is there a better way of doing this in Drupal 7?


texts: Comment Forms - place label inside the inputs

texts:
I'm theming a comments section on a page in a D7 site.
What I want is for the label for the forms items to show as a placeholder attribute rather than above the element.

I've used a hook_form_alter to add the placeholder attributes, e.g.

$form['comment_body']['#attributes']['placeholder'] = t('Add comment here');

…but don't seem to be able to hide the label. In a normal form I can set the label to hidden but there's no option under 'manage display' for the comment form.

Is there something I can do in my hook to do it instead? I know I can hide it with CSS but would like to know The Drupal Way™


texts:
I would like to get all nodes that are of my_custom_type type in Drupal 8.

I know I can get all the nodes (of any type) with \Drupal\node\Entity\Node::loadMultiple() and the list of all types by \Drupal\node\Entity\NodeType::loadMultiple().

But how to get only the nodes of given node type?

I really don't want to use specialized module for it (if it's possible), just keep it as simple as possible. I will use the solution in my custom module.

And loading all the nodes with \Drupal\node\Entity\Node::loadMultiple() and then check their type in foreach would hit the performance too much.


texts: How to change form_set_error() message in captcha module

texts:
I need to reset the default error message in the captcha module when you enter the wrong answer.

captcha.module line 616

form_set_error('captcha_response', t('The answer you entered for the CAPTCHA was not correct.'));

I'm not quite sure where this needs to be done. Preprocess function?

Thanks,
Josh


texts: How do I programmatically change a view title?

texts:
I would like to change my Views (page display) title programmatically.

For Drupal 6 I found Setting the View-Title programmatically in Views2, but it doesn't work for me.

    function mymodule_views_pre_build(&$view) {
  if ($view->name == 'view_machine_name') {
    $view->display['display_machine_name']->handler->options['title'] = 'New Display Title';
  }
}


texts: A reliable way to set #required on form fields that are attached to a form via field_attach_form

texts:
I need to be able to reliably set #required = TRUE on form fields that are attached via field_attach_form.  Some fields might be $form['field_name'][LANGUAGE_NONE]['#required'] = TRUE while others are $form['field_name']['LANGUAGE_NONE]['0']['#required'] = TRUE.

I first went to field_form_get_state() - I tried to change $state['instance']['required'] = TRUE and then use field_form_set_state(), this didn't work.  I can walk the array, setting the value every time I find a #required key, but that feels like a terrible solution.

For some context: consider a scenario in which an admin can permit access to a section of the site if a user completes certain fields attached to the user entity.  Section A might require first_name while Section B requires phone number.  These are admin configurable - the admin can create an access control and attach the whichever form fields she chooses to this section.  None of the form fields are required upon registration.

Edit: Still looking for a better solution but I ended up setting all of the #required = TRUE:

private function makeFieldsRequiredRecursive(&$field) {
  foreach (element_children($field) as $_field) {
    if (isset($field[$_field]['#required'])) {
      $field[$_field]['#required'] = TRUE;
      if (!empty(element_children($field[$_field]))) {
        $this->makeFieldsRequiredRecursive($field[$_field]);
      }
    }
  }
}


texts: My Feature depends on a module. Do I have to specify that module's dependency, as well?

texts: My Feature depends on Views. Views has a dependency on Ctools. Do I have to specify Ctools as a dependency in my feature as well.


texts: Allowing role permissions to a content type based on the date

texts:
I'd like to allow a certain role can add new content of a certain content-type ONLY between two dates. Before or after these dates the role shouldn't be able to create a new content of this content-type.

Is it possible through the Drupal core or any module? I haven't found anything about it.


texts: how to write views for our own custom module?

texts:
I am new to drupal. I have created one form submission module like this

 <?php
function form_test_permission()
{
return array(
'submit_form_test' =>array(
'title' =>('submit_form_test'),
'description' =>('submit the form_test form'),
),
);
}
function form_test_menu() {
$items=array();
$items['application']=array(
'title' =>'Application Form',
'type' =>MENU_NORMAL_ITEM,
'access arguments' => array('submit_form_test'),
'page callback' =>'drupal_get_form',
'page arguments' => array('form_test_form'),
);
return $items;
}

function form_test_form($form,&$form_state){
$form['firstname'] =array(
'#title' =>t('Firstname'),
'#type' => 'textfield',
);
$form['lastname'] =array(
'#title' =>t('Lastname'),
'#type' => 'textfield',
);
$form['addr']=array(
'#title' =>t('Address'),
'#type' => 'textfield',
);
$form['age']=array(
'#title' =>t('Age'),
'#type' => 'textfield',
);
$form['submit']=array(
'#value' => 'submit',
'#type'=> 'submit',
);
return $form;
}
function form_test_form_submit($form,&$form_state) {
$ft_id=db_insert('form_test')
->fields(array(
'firstname' => $form_state['values']['firstname'],
'lastname' =>$form_state['values']['lastname'],
'addr'=>$form_state['values']['addr'],
'age'=>$form_state['values']['age']
))
->execute();
drupal_set_message(t('Saved.'));
}

if I go like localhost/drupal-example/application.. this module works.. But I want to display this module in front page.I referred a lot. But it doesn't works. Can anyone guide me how to write a view function in this module?


texts: How do I change the layout of the fields used in a node?

texts:
I have a content type which has a large number of fields, for example:

first name
last name
company

By default, when a user adds a new node, these fields will appear one under the other. I want to change the layout, and place the "last name" field to the right of "first name."

Can you tell how I can implement this? Is there a module I can use?


texts: How to retrieve image URL from Media Bundle field in Twig Template

texts:
I have created a custom media bundle using the Media Entity module.
Here is a screen grab of the media bundle:

I have created a Twig template media--image.twig.html

I am able to retrieve all of the field values via the content variable in Twig but I'm having difficulty retrieving the field_image URL.

Here is a snapshot of the output from {{ kint(content.field_image) }}:

How do I extract the URL?  I can see a target Id, so presumably I can load the entity in the preprocess function and pass through the variable but I would've expected the full target object to be available within the Twig template?


texts:
I just finished the installation, everything went fine but when I go to view my site I can not login. I cant get to /user

have a look:
www.huf.co.nz

all worked fine on my local before I tried to make live

I have cleared all cookies and cache


texts: Is there a way to conditional sort criteria in views

texts:
Is there a way to make a conditional sort criteria with views in D7?

I want to do the following stuff:

if node property = x
  use this sort criteria
else
  use this one


texts: How to get list of contents of a particular content type programattically

texts:
How can i get a list of contents of a particular content type for example "Basic Page". I want basic page title list in a drop down.

I want list of nodes in a drop down and while selecting each will show the content body. How can i do this?


texts: will webform work with views bulk operations?

texts:
Given a webform that submits emails sometimes the destination mailbox might not be available.
As far as drupal is concerned the submission was successful.
I can resubmit individual submissions.
I need to resubmit n number of previously submitted forms in D8 and thought VBO would be a good answer but got stuck.
update:
@nikit recommended mass_email which is not exactly what i want to do. I ned to resend the existing submissions.


texts: How to use entityQuery to select if a multiple value entityReference field does not contain the id

texts:
I have an entity with a user entityReference field, which may contain multiple values. I wish to select using EntityQuery the nodes that do NOT contain the uid in the query.

$query
  ->condition('field_shared_with_user.target_id', $uid, '<>');

This only works to exclude $uid if there is only ONE value in the field. If $uid is present but some other uid is also present, it incorrectly includes this node in the result.

What is the correct syntax for writing a condition for a multiple value field?

The most I can find about writing these queries is here:

https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!Query!QueryInterface.php/function/QueryInterface%3A%3Acondition/8


texts: EntityFieldQuery causing column not found PDO exception

texts:
I have a very simple node type set up in drupal, see it here

And I'm trying to get the node id based on the email field (the email is unique to each node, just like the nid). My query looks like this:

$query  -> entityCondition('entity_type', 'node')
-> entityCondition('bundle', 'mail_entry')
-> fieldCondition('field_email', 'value', $email);

But drupal is complaining with:

  "PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_data_field_email0.field_email_value'"

I don't really understand what's wrong.


texts: How do I set up multiple sites with one database or multisite Apache configuration?

texts:
I have a problem in multisite with Drupal 7.26. The name of the site is multisite, and the IP is 192.168.1.99.

I created a folder that hosts a new site (/var/www/multisite/sites/site1), copied the settings.php file into the site1 folder; the 127.0.0.1 site1 line is present in the hosts file.

This is the content of /etc/apache2/sites-available/site1.

<VirtualHost *:80>
  ServerAdmin webmaster@localhost
  ServerName site1
  DocumentRoot /var/www/multisite/sites/site1

  <Directory />
    Options FollowSymLinks
    AllowOverride All
  </Directory>
</VirtualHost>

I executed the following commands.

sudo a2ensite site1
sudo /etc/init.d/apache2 reload

If I use 192.168.1.99/multisite/, it works; if I use 192.168.1.99/site1, I get the following error:

  The requested URL /site1 was not found on this server. Apache/2.2.22
  (Ubuntu) Server at 192.168.1.99 Port 80

What did I do wrong?

should i add any redirect base code in .htaccess file?

    Solution: Give Symbolic link form mulitsite to site2
    Executed that command line
    ln -s /var/www/multisite /var/www/site2

    Rename example.sites.php to sites.php

    $sites['192.168.1.99.site1'] = 'site1';

    put this line in sites.php

I got a result . Thanks for post the answers this questions

Reference URL:

  https://drupal.org/node/2622
  https://drupal.org/node/43816/


texts:
How can I create an archive block like this, only for Drupal 7 (views 3)
http://chrisshattuck.com/blog/how-create-monthly-archive-block-drupal-blog-views


texts:
I'm trying to add a new component or populate an existing hidden component on a web form programmatically.  I found this:

http://drupalcontrib.org/api/drupal/contributions!webform!webform.module/function/_webform_client_form_add_component/6

However I have not found any hooks, which would be the preferred way to do this.  I'm essentially just checking to see if there is a hook or how to access that function in a custom module if no hook exists.


texts: How to upload a csv file with an admin form?

texts:
In a custom module, I created an admin form but I need an input to upload a csv file. When the file is uploaded I need to parse in and then I add data to db.

I already made "add to db" and "parsing" functions because when I installed the module, a default file is parsing and added to the db.

Thanks.

EDIT :

I'm using Drupal 7...

The data is stocked in a custom table that is create when the admin user will install the module. There is no node or content type. I just need to save all data of the CSV file (5 columns) in the table by an admin user form. 1 time par month the admin user need to update the table with a new .CSV.

In frontend I have a form and when the user will submit it I check that the code is in the table.

My issue is that I didn't know how to upload the file into a Drupal directory and then access to it after the form submit.

As I said above I already created a parsing function and I tested with a CSV file directly in the module directory, it's working. Data is insert into the table that I have created.


texts:
Where can i alter commerce product twig template variables?
When i display commerce product mymodule_preprocess and mymodule_preprocess_entity never called.

Doesn't exist mymodule_preprocess_node(&variables) for commerce product entity?

Thanks
Fabio


texts:
I need something like a drop down pager for a view with many pages.
Either drop down with all pages listed, or maybe more fancy like this one here:

http://www.zeit.de/2014/18/sextourismus-ostafrika/seite-5

(Scroll down to the comments part. Hovering the comments-pager pops up a grid with page-numbers)

Is there a module for that or an easy way to build it myself? I didn't find a solution.


texts: How can I make a response cachable by browsers?

texts:
I am working on a Drupal Controller implementation that would return a generated image as response. I used Symfony's Response and I was trying to add ETag header to it:

use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class MyController extends ControllerBase {

  public static function viewGraph(string $id, Request $request) {
    $response = new Response();
    $response->setEtag($etag); // some etag genrated from $id
    if ($response->isNotModified($request)) {
      return $response;
    }
    // ...
    return $response;
  }

}

I expected to see the "ETag" header in my response. But there is nothing. I've even tried CacheableResponse and it didn't work as well.

What's wrong with my approach? What is the right approach to it?


texts: Drupal 6: integer field, how to output the value + a 3% up for a field, programmatically

texts: I have a production website with a content type that has 3 integer fields. Now the website owner wants to raise those values in a 3%. Since there are hundreds of nodes for that content type, is there a way to modify the output in a 3% via a PHP snippet?


texts: Found user with uid of 0 (zero) in users table... huh?

texts: Is it normal to have a user with uid of 0 in users table?


texts: Why am I seeing so many duplicate images in my thumnails folders?

texts:
Why am I seeing tons of duplicate images in my sites/default/files/data_export_import/styles/test_thumbnails

There are so many in there, like 4 gigs, I'm going over quota, how can I clear this and not delete the images that are being used? Site has 256 pages...

How can I clean this mess up?


texts: How do I find the Delta of a CCK Multivalue Field

texts:
I have two unlimited multi-value cck fields in one content type: field_before and field_after . In my custom node template file, I need to match up the deltas of each before and after value so I can display my content like this:

Before 0
After 0
------
Before 1
After 1
------
Before 2
After 2

So how do I get this output in my node.tpl file?


texts: How to Add Existing File to file_managed. File is Blank

texts:
I have manually added some files to the Private Files directory on my Drupal 7 site and wish to add them to the file_managed table in the database.

This is what I have attempted:

Load the existing file with the file_get_contents($PATH_TO_FILE) function.
Used the file_save_data($loaded_file, $destination, FILE_EXISTING_REPLACE) function save the file and add it to the Database.

The Result:

The expected file is in the File System but is 0 bytes and blank
File is added to Database

The main issue is that the existing file isn't getting uploaded properly and is being displayed blank. How can I fix this?


texts: How to theme the $content variable's contents?

texts:
I am trying to theme the teasers of a particular content type.

I have gotten to the point where I created a file of name node-content_type-teaser.php, where content_type is the relevant name.

The trouble is, I am unable to style the actual $content. It outputs the teaser of the text in a <p> tag, and an image thumbnail (I get it from a CCK field). I just need to change the order, and output the image first, so I can float it.

To summarize, how do I control the order in which $content is output?


texts: Send email to users with same Taxonomy term selection in node

texts:
I have a node type "Question" which has a term reference field called "Question about". Now I'm trying to create a rule to send emails when a new "Question" is created to the users who have the same term reference. Both term reference fields are connected to the same vocabulary (Question category).

So it looks like this:

EVENT: On new content (question) with a term reference
CONDITION: term reference field is same in "Question" and "User"
ACTION: email to users with the same term reference field called "Specialist in".

Can php be a solution? Please help :)


texts: How to validate Hierarchical Select when adding new terms

texts:
Is there a way to validate Hierarchical Select when adding new terms in sub level.

As for now the module is allowing new terms to add but there is no validation such as if I add a new term which is already existed, throw an error saying that "Term name already existed".

Is there any hook available when adding a new term so that we can validate before saving new term.

PS: I even had tried Taxonomy Dupe check, it doesn't support to Hierarchical Select.


texts: How to unpublish all nodes of a user after is assigned a role?

texts:
I am interested on this scenario:
After a user is assigned a role,all his published nodes get unpublished.
I am interested in doing this with rules and VBO.
I tried but no luck.
I used :Event:User profile is update
Action:Load all node with VBO.
Seems I am missing something.Anyone help?
thanks


texts:
I set up a view with taxonomy id as the argument and am trying to figure out how to alias the term id with its name.

Trying to turn url.com/discussion/8 -> url.com/discussion/term but the argument must still be the id b/c I need to to pass it by URL to a node edit form from a link on the view display.


texts:
I'm working on tripal with drupal 7.x
I have created new view. i had chosen the fields and i have this table.

i want to add the link for each row of the column map Name. i put this tag
but i want to change the ID (85) for each row it correspondd to the ID of the map. How can i do? Thank you


texts: Can I create non-default EntityReferenceSelection?

texts:
I have the following EntityReferenceSelection plugin:
/**
 * Provides an entity reference selection for my_entity.
 *
 * @EntityReferenceSelection(
 *   id = "extra:my_entity",
 *   label = "...",
 *   entity_types = {
 *     "my_entity"
 *   },
 *   group = "extra",
 *   weight = 1
 * )
 */
class MyEntityExtraSelection extends DefaultSelection {

  protected function getAllowedIds() {
    return [...];
  }

  protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
    $query = parent::buildEntityQuery($match, $match_operator);
    $query->condition('id', $this->getAllowedIds(), 'IN');
    return $query;
  }

  public function validateReferenceableNewEntities(array $entities) {
    $entities = parent::validateReferenceableNewEntities($entities);
    $allowed = $this->getAllowedIds();
    return array_filter($entities, function ($entity) {
      return in_array($entity->id(), $allowed);
    });
  }

}

I'd like to call it extra:my_entity because I don't want this filtering to occur by default, every time I use it, only when I refer to it using the 'handler' => 'extra' setting explicitely.
But the core plugin manager gives these errors:
Warning: uasort() expects parameter 1 to be array, null given in Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager->getPluginId() (line 65 of core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php).
Warning: end() expects parameter 1 to be array, null given in Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager->getPluginId() (line 66 of core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php).
Warning: key() expects parameter 1 to be array, null given in Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager->getPluginId() (line 67 of core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php).


texts:
I have a Views of users.

Does user_load($row->id); will load a user from cache?


texts: With Omega, how to inline branding zone with header zone

texts:
I want set my branding (logo) zone to 4 cols to the left, and the header zone (8 cols) with the two header regions, inline to the right.

Do I simply do this in CSS? Do I specify the branding and header zone wrappers?


texts: Uncaught TypeError jquery function is not read anymore

texts:
I've on a Drupal 6 site which run since 2 years, a new problem at first with CloudZoom but i start to think that it's a little more than that.

I've errors in the firebug console which says :
Uncaught TypeError: Object function ... has no method 'cookie'
or Uncaught TypeError: Object function ... has no method 'cloudzoom'

So Cloudzoom don't works anymore on some language... what is strange is that it still work in english.

I've take a look at the code and it's ok, it worked in the past ans still work in english. I also make sure that JS file are call in the right order jquery>librairies>myOwnJs.

what i need is to understand the error message "Uncaught TypeError: Object function" : what can generate that kind of error, where to search. I spend a lot of time on that and don't really know where to look now.


texts: Save tags in parent and children of vocabulary with shs module

texts:
How can I save my tags in parent and children of vocabulary with the shs module?

When I save my tag in children with the shs module, I want to show my content in parent and children path.


texts: How can I change the style of a specific CCK field?

texts:
I need to change the position to fields of content types. How can I modify the style of a specific field?

When I check the code for knowing the class, I see this:

<input id="edit-field-first-name-0-value" class="form-text text" type="text" value="" size="60" name="field_first_name[0][value]">


texts: How to get data from previous step in Drupal commerce checkout process

texts:
I have Drupal commerce checkout process where user choose shipping and in next step choose payment method.

I need data about chosen shipping in payment method form alter.

Is there any way how can i get info about chosen shipping in payment method form alter?


texts:
I created a view in drupal 8.
Name home page client view block &
machine name home_page_client_view_block.
Now I want to theme this view.


texts: drush cim creates and immediately deletes field

texts:
Importing the following yml fails. With UUID it wants to be deleted. After removing the UUID it fails with field type doesn't exist. Any ideas? Is there some kind of order that might make the import fail.

uuid: null
langcode: de
status: true
dependencies:
  config:
    - field.storage.node.comment_forum
    - node.type.forum
  module:
    - comment
_core:
  default_config_hash: Tqw7kBEqm9_VZSK9bsNBAgJqAmJGP6cKEzXtf_KlqBo
id: node.forum.comment_forum
field_name: comment_forum
entity_type: node
bundle: forum
label: Comments
description: ''
required: true
translatable: true
default_value:
  -
    status: 2
    cid: 0
    last_comment_name: null
    last_comment_timestamp: 0
    last_comment_uid: 0
    comment_count: 0
default_value_callback: ''
settings:
  default_mode: 1
  per_page: 30
  form_location: true
  anonymous: 0
  preview: 1
field_type: comment

After doing a drush cex and reverting the affected file I now only have left those two lines when doing a drush cim. So the field seems to be created and deleted again. I can't find any config that is triggering that delete. Any clue?


texts: How is the views row plugin set? Can I use a views row plugin from a different module?

texts:
I'm writing a custom display plugin for views in Drupal 8, and I'm having a hard time figuring out how the view row plugin is decided.

I'm basing my plugin on the views Serializer style in the rest module. The serializer style is calling out to a row style, either DataEntityRow or DataFieldRow:

public function render() {
  $rows = array();
  // If the Data Entity row plugin is used, this will be an array of entities
  // which will pass through Serializer to one of the registered Normalizers,
  // which will transform it to arrays/scalars. If the Data field row plugin
  // is used, $rows will not contain objects and will pass directly to the
  // Encoder.
  foreach ($this->view->result as $row) {
    $rows[] = $this->view->rowPlugin->render($row);
  }

Somewhere along the line, the rowPlugin is being set to one of the aforementioned styles but I can't figure out whether it's set somewhere and I'm missing it, or if it's auto detected in some way. As far as I can tell, the row plugin is never directly instantiated anywhere.

If it is some sort of automatic detection, is there any way for me to hint or force the use in my own code? I could happily use the DataFieldRow plugin in my own class, but I don't know how.


texts: How to get ordered list display for Top Emails in Forward Module?

texts:
I'm using the Forward module for keeping track of article content being emailed thru my site. I've been looking thru the module files to see where it is rendering the top5 (I modified it to Top10, instead) entries as an unordered list and have been unable to locate where this is.

Can anyone help with this?

Below is a sample of a basic unordered list showing from the Forward module block (I need this to render as an ordered list, instead):


texts: Syntax to use form_alter with array in name attribute

texts:
I would like to modify some custom fields with form_alter in a contact form.

I know for example how to change placeholder for this "name" field  :
Note : I removed all the unnecessary html elements to make my question clearer

<input name="name" >

In form_alter :

$form['name']['#attributes']['placeholder'] = t('Nom');
$form['name']['#title_display'] = 'invisible';

But I don’t find the correct syntax when the name is with an array like :

<input name="field_prenom[0][value]" >

How to use form_alter with field_prenom[0][value] ?

I’ve tried this but it doesn’t work :

$form['field_prenom']['0']['value']['#attributes']['placeholder'] = t('Prénom');


texts: How can we check whether block is enabled or disabled in .theme file?

texts:
I am displaying a block in twig and i am passing twig variable from hook_preprocess_page. But the issue when i disable the block from backend still its showing up in frontend. Im not able to get status of the block. Can anyone help me. Below is my code:

$lang_block = Block::load('dropdownlanguage');
  //if (!empty($lang_block)) {} also i tried.

  if (isset($lang_block)) {
    $content = \Drupal::entityTypeManager()->getViewBuilder('block')->view($lang_block);
      $variables['language_block'] = $content;
  }

In .twig file :

{%  if language_block %}
   {{ language_block }}
{% endif %}


texts: How to display panes/views/blocks based on time of day and day of week?

texts:
Building a D7 site, I need to be able to automatically enable/disable Panel panes and/or views (or in the worst case scenario blocks) based on the time of day - different contact info for out-of-office hours and some other stuff. I also need to display drastically different sets of panes and views on the frontpage based on the day of week.

My temporary solution is to set up a number of Panels pages (for changing panes/views) and duplicate themes (for changing blocks) and run cronjobs with Drush's variable-set to change frontpage from one Panel page to another and to change theme to the one with different blocks enabled.

As simple as the above is, it's a terrible long-term solution because all other, unrelated changes made to the site then often require being made more than once and it's really hard to keep track of.

So is there a more straightforward way to configure per-pane, per-view or per-block setting to get enabled/disabled based on time of day / day of week?


texts: How to remove the Destination parameter from an URL in Drupal 7?

texts:
I have a blog posts, and when an anonymous user visits it and and clicks the link "Login" or "Register" to post comment (under blog entry), then its url looks like this:

  http://example.com/user/login?destination=node/55%23comment-form

But I don't want that parameter of destination here. I just want a simple link like so:

  http://example.com/user/login

Any suggestions?


texts: How to display forum on a custom URL on my site?

texts:
The default URL of forum is ./forum but I want it to move to ./discuss/forum
How can i accomplish same?


texts: How to display a views' localized title (taxonomy term view)?

texts:
I am struggling to do what should be very simple and I am heading to a very complicated solution.

I have seen posts suggesting something like:

$view->page_title = t($view->page_title);

But this doesn't work because $view->page_title is simply not set in my view, even if I set the title manually.

I have tried this in a PHP snippet in the view's header and in the views-view--page.tpl.php:

$term = i18n_taxonomy_localize_terms(taxonomy_term_load($view->args[0]));
$view->page_title = t($term->name);
drupal_set_title($view->page_title);

Here $view->page_title gets set with the localized term name but the page's title is not set. I guess it is because the snippet is executed after the title is set. So I created a module:

function MYMODULE_views_pre_render(&$view) {
  print_r($view);
  if ($view->name == 'taxonomy_term_view') {
    $term = i18n_taxonomy_localize_terms(taxonomy_term_load($view->args[0]));
    $view->page_title = t($term->name);
    $view->build_info['title'] = $view->page_title;
  }

It works, but I have to create a condition for each and every taxonomy term view. I can't imagine this is the right way to do it. is there a simpler approach?


texts:
I'm on 7.39 and I get a lot of reports from users that re forced to reset their password every time they visit the site.

I'm honestly clueless about how to debug and haven't been able to find similar support requests on the forums.

Any ideas are extremely welcome

update
Here's feedback from a user that couldn't even reset:

*If I use this link: http://www.tambourhinoceros.net/user/user-id/orders/order-id:

  You are not authorized to access this page.

If I try to login ... with this e-mail adress and my password ... nothing happens.
If I request a new passwort this message
appears

  There was a problem with your form submission. Please wait 6 seconds
  and try again. You must be a human, not a spam bot, to submit forms on
  this website. If you insist that you are a human, please try again. If
  error persists, contact webmaster using contact link at the bottom of
  this page and give all the details of this error (your browser,
  version, OS). Form is submitted too fast. Please spend more time
  filling in the form.

*


texts: Views and Panels Newbie... Maybe simple...Hope its simple

texts:
I have a simple view that does not page. It contains about 50 records (three fields each). When I import the view into column one of the panel page, it displays the entire contents. I wish to equally divide the content into the two columns.

I have done this before in PHP. I have the code to do this in PHP. But this is D, so,...

I tried to mock up the effect, to get a look at the output, by placing the same view in the second column. But Panels apparently did not do another query. The second column was blank.

Any ideas why the view would not copy into the second column, or how I might achieve my goal to divide the query into two columns using Views and Panels the Drupal way?


texts: How do I use Drush 8 site aliases in Drush 9?

texts:
In Drush 8, my site aliases are loaded correctly from ~/.drush/mysite.aliases.drushrc.php.

E.g.

$aliases['dev'] = array(
  'root' => '/var/www/html/mysite.dev/docroot',
  'uri' => 'mysite.prod.acquia-sites.com',
  'remote-host' => 'mysite.ssh.acquia-sites.com',
  'remote-user' => 'mysite.dev',
  'path-aliases' => array(
    '%drush-script' => 'drush' . $drush_major_version,
  ),
);

However these aliases aren't loaded in Drush 9.

$ drush site-alias
{  }

How I should define site aliases in Drush 9? Is there any migration process?


texts:
I have a problem with Context path condition. I would like on the conditions region to assign something like path/* where * indicates all its subpaths. For instance, if we have path/subpath1/subpath2 the context condition should match on path, subpath1 and subpath2.

Is it possible to do that on Context?

Thanks in advance!


texts: Upload and set default file in managed_file field on module install

texts:
I have managed_file in my module configuration form and one text field, so I want to set default values for these fields on module install.

At the moment I have this in config/install/my_module.settings.yml:

title: 'Hello!'
langcode: en

and this in config/schema/my_module.schema.yml:

my_module.settings:
  type: config_object
  mapping:
    title:
      type: string
      label: 'Title'
    langcode:
      type: string
      label: 'Language code'

Now, how I can upload some PNG image file on module install and how to define it in my_module.schema.yml and my_module.settings.yml in order to set it as default?

Update

If I want to leave this field empty is this right way to define it in config?

config/install/my_module.settings.yml

title: 'Hello!'
image: NULL
langcode: en

config/schema/my_module.schema.yml

my_module.settings:
  type: config_object
  mapping:
    title:
      type: string
      label: 'Title'
    image:
      type: integer
      label: 'Image'
    langcode:
      type: string
      label: 'Language code'

This doesn't work, the problem is to define managed_file in schema file, how to do that?


texts:
Drupal can automagically detect the language to use when displaying content :

Based on URL
Based on User preference
Based on Browser language.

However, when I request a url like : http://mysite.com/toot/lala, Drupal detects the english language (browser settings), but it doesn't rewrite the url to : http://mysite.com/en/toot/lala

I'm afraid that this behavior will induce Duplicate Contents errors.
Does someone know how to correctly set this redirection ?


texts: Using theme_get_setting getting empty value

texts:
I am using theme settings in my Drupal 7 theme to provide a theme option as follows.

$form['mythemename_settings']['loaderImage'] = array(
  '#type' => 'fieldset',
  '#title' => t('Loader Icon'),
  '#collapsible' => TRUE,
  '#collapsed' => FALSE,
);

$form['mythemename_settings']['loaderImage']['loader_img'] = array(
  '#type' => 'file',
  '#title' => t('Upload Loader Icon Image'),
  '#default_value' => theme_get_setting('loader_img','mythemename'),
  '#description' => t("Upload your desired loader icon."),
);

I then use theme_get_setting('loader_img') to call the value of the setting, but it returns an empty value. I have also added settings[loader_img] = "loading.gif" in my theme.info file, but I am still getting only the empty value.

My intention is to add a Image browse button which can be accessed in the admin end  and can be changed time to time. I have uploaded the image but I couldn't find my image inside my projects. Do I need to set a path for the image to get uploaded?

Where are the values of the settings page get stored in the database? I checked my whole database but I couldn't find the value I saved.


texts:
How does a module tell Drupal which mail plugin should be used? The SMTP Authentication Support module uses the following code in the submission handler of its settings form.

$values = $form_state->getValues();
$config = $this->configFactory->getEditable('smtp.settings');
$mail_config = $this->configFactory->getEditable('system.mail');
$mail_system = $mail_config->get('interface');

// Updating config vars.
if (isset($values['smtp_password'])) {
  $config->set('smtp_password', $values['smtp_password']);
}
$config->set('smtp_on', $values['smtp_on'])
  ->set('smtp_host', $values['smtp_host'])
  ->set('smtp_hostbackup', $values['smtp_hostbackup'])
  ->set('smtp_port', $values['smtp_port'])
  ->set('smtp_protocol', $values['smtp_protocol'])
  ->set('smtp_username', $values['smtp_username'])
  ->set('smtp_from', $values['smtp_from'])
  ->set('smtp_fromname', $values['smtp_fromname'])
  ->set('smtp_allowhtml', $values['smtp_allowhtml'])
  ->set('smtp_debugging', $values['smtp_debugging'])
  ->save();

// If an address was given, send a test e-mail message.
if ($test_address = $values['smtp_test_address']) {
  $params['subject'] = t('Drupal SMTP test e-mail');
  $params['body'] = array(t('If you receive this message it means your site is capable of using SMTP to send e-mail.'));
  $account = \Drupal::currentUser();
  // If module is off, send the test message with SMTP by temporarily overriding.
  if (!$config->get('smtp_on')) {
    $original = $mail_config->get('interface');
    $mail_system['default'] = 'SMTPMailSystem';
    $mail_config->set('interface', $mail_system)->save();
  }
  \Drupal::service('plugin.manager.mail')->mail('smtp', 'smtp-test', $test_address, $account->getPreferredLangcode(), $params);
  if (!$config->get('smtp_on')) {
    $mail_config->set('interface', $original)->save();
  }
  drupal_set_message(t('A test e-mail has been sent to @email via SMTP. You may want to check the log for any error messages.', ['@email' => $test_address]));
}

This code is not working, since in the log set with the mail.log directive I see the following, where it is evident that Drupal is still using the mail plugin definined in PhpMail.php.

  [11-Mar-2016 06:36:14 UTC] mail() on [/home/domain/public_html/core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php:101]: To: edited@email.org -- Headers: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: 8Bit X-Mailer: Drupal Sender: edited@email.org From: Edited <edited@email.org>

I cleared the log before sending the test email from the administrative page of the SMTP Authentication Support module; so, I am sure the log is caused from sending the test email.

Since the method used from this module doesn't seem to work, what is the correct way to set the plugin Drupal uses to send emails?

Update

To make my question clearer, there are two things that are not clear to me in the code being used.

The code is setting the mail plugin Drupal should use, just for the test email, but as I can see that method doesn't work, since Drupal still uses the default plugin.
Apart from setting the mail plugin for the test email, the module doesn't change the mail plugin set by Drupal. How can Drupal know to use the mail plugin implemented by the module, then?


texts: $form_id: What is the difference between #id and #value?

texts:
I am trying to find the $form_id using the Devel module.

Sometimes when I output a form, $form_id is output with a single value.  However, sometimes the output of dpm($form) looks like this:

What is the difference between #value and #id here?  Which is the $form_id?