texts: Unset specific css files defined in the .info file

texts:
I am trying to unset specific CSS files that I have included in the .info file in specific languages. For example, I have Arabic as a language option in my website, and I am including the ar.css file with:

drupal_add_css(drupal_get_path('theme', 'ninesixty') . "/styles/framework/ar.css");
drupal_add_css(drupal_get_path('theme', 'ninesixty') . "/styles/framework/rtl_960_24.css");

I have to remove the 960.css and 960_24.css files from the Arabic language as those files define the left to right text direction.
I am trying this using these two lines, without success:

unset($vars['css']['all']['module']['styles/framework/960_24.css']);
unset($vars['css']['all']['module']['styles/framework/960.css']);

In order to understand when the user is using Arabic (for the front page, firstly) I am using the following code:

if ($vars['is_front']) {
  $langcode = $GLOBALS['language']-> language;
  if ($langcode == 'ar' || $langcode == "fa") {
    drupal_add_css(drupal_get_path('theme', 'ninesixty') . "/styles/framework/ar.css");
    drupal_add_css(drupal_get_path('theme', 'ninesixty') . "/styles/framework/rtl_960_24.css");
    unset($vars['css']['all']['module']['styles/framework/960_24.css']);
    unset($vars['css']['all']['module']['styles/framework/960.css']);
  }
}


texts: Migrate Site from aegir Drupal hosting platform to Acquia hosting

texts:
I have three sites hosted in Aegir hosting environment. No I need to move them to Acquia hosting. Here are some doubts I have:

Should I need to move the code as a normal multisite setup to
Acquia?
Since the codebase is extracted from aegir environment, I don't have
any files on the drupal root like install.php, update.php?

Sorry I haven't worked so much with aegir. So this might sound dump. Please help me with this.


texts: How can I categorize nodes by countries?

texts:
I have a created a content type "person", added to it custom field "country". I have downloaded the "countries" module and installed it.

I would like to categorize "person" nodes by countries, i.e. by clicking on the person's country, I could see all persons who live in the same country.

I don't think taxonomy could do the trick since I will have to add around 140 vocabulary terms also, node reference seems not to work properly...

Any help?

Thanks
Sam


texts: Is there an anti-spam advantage of using reCAPTCHA module instead of just CAPTCHA by itself?

texts:
What is the advantage of using the reCAPTCHA module over the plain old CAPTCHA module?

Are spam bots less likely likely to beat reCAPTCHA?

Thanks


texts: Multiple Group Managers in Organic Group

texts:
The "Owner / Group Manager" of a group appears to be the person that created the container (let's say a node). That, of course, is controlled by the UID of that node.

Is it possible to have multiple "Group Managers". If that is possible, it would seem to mandate something else controlling the status of "Group Manager".


texts: How to share fields between commerce variation types?

texts:
Assume I have more than 100  different variation products and all of them share same fields ( such as commission rate, Brand, Weight and etc). As I understood so far, I need to create 100 product variation first.

Now, my question is:

Do I need to add each of these fields for each variation separately? or is there any way to add them only one? e.g how can I add these fields to the product entity so that every time I create a variation, it automatically adds all these fields, similar to sku and price?

p.s: I use commerce_kickstart-7.x-2.40

Any help will be highly appreciated!

Thanks


texts: User relationships. Override mysite.com/relationships page with views

texts:
Is there any chance to override mysite.com/relationships page with views? I guess the answer would be yes. But how? Can somebody explain to me in details. :)

P.S. I've tried to create my own page view, with path /relationships, but there's so much settings... messed up me :(


texts: Which Drupal clients allow editing of non-Blog nodes?

texts:
I'm looking around at some different techniques for posting content to our heavily-customised Drupal instances.  We use a custom node type and I would like to be able to post content to that node type from a desktop client.

All of the clients I've found so far are general blogging clients - are there any available that support custom node types?  Are there any restrictions around what they can / can't do?


texts: Set Image Custom Field as Open Graph Image in Metatags

texts:
I have installed the Metatags module along with the Open Graph and Twitter Card extension modules. In my default content type, I have added an Image field that allows an image to be uploaded for use on Facebook and Twitter.

Now I cannot get the Metatags module to accept this image custom field as the entry for the og:image and Twitter Card Image fields. I've tried entering [node:field_image] but the meta tags do not get added to the source code. If I enter a URL the tags appear.

How do I get Metatags to dynamically include a corresponding image for each page in the Open Graph and Twitter Cards metadata?


texts:
I am trying to figure how to rename this field. I know for example with this content type, I can go into the content type and edit the field name for this content type, but that will give the new name to my other variants using this content type (if I'm not wrong).

Is there anyway to change the name of this one specific piece of content without editing anything else?

Thank you!


texts: Why drupal includes *.profile file on every page?

texts: I developed an installation profile that contains many various hooks. After an installation process, it is still included on every page, and all my installation hooks are executed. Please explain me why it happens, and by which way I can avoid including *.profile file after the installation.


texts: Link to a Media entity file from text editor

texts:
The idea is to create an hyperlink on some arbitrary text typed in CK Editor. That link should target a file uploaded to a Media file entity.

Media entity download filter already makes it possible but it has to be done in two separated steps (create the media entity+upload that file then create the link via Linkit).

An acceptable flow could be :

type some text and select it
click a toolbar button (my first thought was entity embed)
select an existing Media File or create/upload it
save to generate the link

It's (almost) doable via a combination of Entity Browser, Entity Embed and Inline Entity Form but that will output the Entity itself (displayed with a specific view mode).

Is it possible to achieve something similar with or without an existing contrib module from the Media ecosystem ?


texts: How can I load the #totals property for the receipt theme in a custom module?

texts:
I am trying to manually output the customer's receipt on the checkout complete screen in a custom module.
I have the receipt printing nicely except for the "totals" variable.
My current custom code is the following.
$renderable = array(
      '#theme' => 'commerce_order_receipt',
      '#order_entity' => $order,
      '#billing_information' => NULL,
      '#shipping_information' => NULL,
      '#payment_method' => NULL,
      '#totals' => $this->orderTotalSummary->buildTotals($order), // <-- this is the problem
    );

 return array(
      '#theme' => 'custom_blocks_checkout_complete',
 '#order' =>  \Drupal::service('renderer')->render($renderable),
    );

As you can see, it's using $this->orderTotalSummary->buildTotals($order) to generate the #totals property and this was copied from the OrderReceiptMail class in the Order module. How can I get this property to populate from my custom module please?


texts: How do I insert HTML just before the body closing tag?

texts:
I am looking for the best way to insert arbitrary HTML content into a page before the closing body tag, similar to the way drupal_add_js() adds JavaScript to the bottom of a page.

I am coming from a Wordpress background, and in Wordpress this could be accomplished by using the wp_footer() hook.

I have looked into using hook_page_alter(), but I was wondering if this was the correct way to do this or if there is a better way of accomplishing this task.


texts: How Print individual fields in a view row by row

texts:
I have so much fields in a content like "title", "field_image", "field_description", and i use a view for create a block and put it on my front page...

I will make a slider with a jquery plugin (jssor slider), i need use the structure of jssor slider. then in my view, i use "views-view-fields--[name_machine]--block.html.twig" for print individual fields. but the file "views-view-fields..." print for each content, run all code on this file,and i need to put the initial containers of this plugin only once, and the code of the images several times.

I try to put the initial containers of the plugin in the "page.html.twig" but when i print the block with the "views-view-fields..." inside
he puts a lot of code and many labels and containers that I do not need and the plugin stops working. let me show the files.

my page.html.twig
          {# Header #}
      {% if page.banner_front %}

        {% block banner_front %}
            {{ page.banner_front }}
        {% endblock %}

then my views-view-fields--banner--block.html.twig:

                        {% if fields.title.content %}
                            {{ fields.title.content }}
                        {% endif %}

                        {% if fields.banner_description.content %}
                            {{ fields.banner_description.content }}
                        {% endif %}

                    {% if fields.field_url.content %}

Ver más

                    {% endif %}

to work correctly, the label
 must be left of the label
, but when the region is printed the system prints many labels and containers that damage the structure of the slider.

On Drupal 7 i used inside of the foreach the code of the images, and outside the inicial structure, and works well but now, i dont know how to this.

Thanks a lot.


texts: Drupal add google analytics event tracking query strings to url

texts: I have Drupal 7 site for sending the newsletter. I am using simplenews module for sending newsletter. I want to add google analytics tracking query strings to all links in the newsletter so that it is tracked in my google analytics account. How can I achieve this?.


texts: Producing collapsible field sets with theme functions

texts:
In an older Drupal 6 instance, I'm updating a module to produce a collapsible fieldset with the following:

function my_module_function($table_collections) {
    // include JavaScript for collapse functionality
    drupal_add_js('misc/collapse.js');

    foreach($table_collections as $table) {
            $to_return .= '<fieldset class="collapsible collapsed">';
            $to_return .= '<legend>' . $title . '</legend>
' ;
            $to_return .= theme_table(array_keys($table[0]), $table);
            $to_return .= '
</fieldset>';
    }

    return $to_return;

}

My question, is there a better way to wrap this in a complete theme function? theme_fieldset and ctools_collapsible_theme(&$items) appears to be for forms. Is there a more standard or better approach than what I have above?


texts: How to get the list of blocks for the current page?

texts:
I'm trying to get the list of all blocks for a certain page, but I can't figure how to do that.

How do I get the list of all the blocks that are rendered for a page, independently from the region where they are put?


texts: How variable_get and variable_set works in drupal

texts:
How do variables work? Is it as simple as using

variable_set('myvar', 'my_value');

to set, and

variable_get('myvar');

to retrieve?

Additionally, where are these variables stored, and do they have any sort of categorisation/access control (i.e. can any module get the variables set by any other module)?

Update from comment

I can see a line like $custom_theme = variable_get('admin_theme', '0');
But i cant see any variable_set('admin_theme') in anywhere in the module though .


texts: Save and preview differences in hook_form_alter()

texts:
I've created a module which uses hook_form_alter(). When a form is loaded (node/add) I hide a field, and the hook works fine. The problem appears when I do a preview of the form. When the form appears again I see the hidden field (the hook doesn't work). Why?

I hide the field through the line:

$form['field_versio']['und']['0']['value']['#type']="hidden";


texts: Comment not respecting line breaks (Drupal 7)

texts:
All of my comments for all of my content types do not respect show line breaks.  I have tried to dig pretty deep into this issue but I now feel quite stuck.

This is what I discovered.

The problem is not related to the text formats. (I have verified that Convert line breaks into HTML is checked.)
The problem may have to do with safe_value. I used dsm() to show content of the $vars variable inside the hook_preprocess_field() implementation of the theme, which shows the value of the comment body has line breaks, but save_value doesn't.
The issue is not related to the format. With dsm() I have verified that the comment body is using  the Filtered HTML input format, which I believe is correct.

This is what dsm() outputs for the comment body.


texts: How to block (or redirect) external image source?

texts:
Users can add images to content. They're supposed to be uploading them to the site, but occasionally people will reference an image hosted elsewhere in the src='...'.

What is the best way to prevent these images from working (or even better, redirecting to a "This image is blocked" image)? I imagined using a hook of some sort to modify the content, or possibly a module that adds a filter to weed out these images. But it seems like a situation I could be overthinking.

Any suggestions?


texts: New Drush install instructions use Composer for install, even on Drupal 7?

texts:
The current Github install instructions for drush (http://docs.drush.org/en/master/install/#git-clone-ie-manual-install) say as the last step:

  From Drush root, run Composer to fetch dependencies.

  $ composer install

Since Drupal 7 does not usually have Composer installed, I assume these are Drupal 8 specific instructions.

Where can I find a link to instructions for installing Drush for a Drupal 7 install, where composer is not present?


texts: Can't sync site config from git, entities exist of type x

texts:
For whatever reason I seem unable to find a good resource to explain syncing the actual structure of a site (like blocks and configs).
I'm using git currently and am doing local development using lando. I have just been using the same folder this whole time but recently had to do some things and needed to clone my repo.
I've got the site running but it's back to the "defualt" state and made me install drupal and such.

I have the config/sync folder but cannot use drush cim or sync via the UI.

The configuration cannot be imported because it failed validation for the following reasons:
Entities exist of type Taxonomy term and Vocabulary Blog Categories. These entities need to be deleted before importing.
Entities exist of type Shortcut link and Shortcut set Default. These entities need to be deleted before importing.
Entities exist of type Paragraph and Paragraph type Webform + Content. These entities need to be deleted before importing.
Entities exist of type Paragraph and Paragraph type Standard Content. These entities need to be deleted before importing.
Entities exist of type Content and Content type Page. These entities need to be deleted before importing.
Entities exist of type Content and Content type Homepage. These entities need to be deleted before importing.
Unable to install the Commerce Store module since it requires the Path alias module.
Unable to install the Commerce Number Pattern module since it requires the Path alias module.
Unable to install the Commerce Order module since it requires the Path alias module.
Unable to install the Commerce Product module since it requires the Path alias module.
Unable to install the Commerce Cart module since it requires the Path alias module.
Unable to install the Commerce Checkout module since it requires the Path alias module.
Unable to uninstall the Path alias module since the Path module is installed.
Unable to uninstall the Path alias module since the Pathauto module is installed.

This is spat out by the UI.
I had tried to do something with the uuid but it obviously didn't work. I'll say that's because, again, I can't seem to find a good explanation of how this actually works.


texts: Date API: Proper method of parsing dates

texts:
I'm working on a simple event sign up module. The functionality is split in two modules, one which provides an Event content type with title, description and date (from - to) fields, and the second with sign up functionality and sign up window dates for Event content type. The problem is that I don't seem to find a way to properly parse and do comparisons and calculations on the event/signup dates.

Date API documention is quite light on specifics on this area, so it has not been much of a help.

How can I use the Date API to obtain DateObject from the event date stored on the node?
How can I determine whether the stored event is an all day event?


texts: How to get my Back To Site button to point to the correct location?

texts:
I recently logged out of my Drupal 8 site to see the pages not obscured by the admin menu.

I then logged back in (/user/login) and, to my surprise, it sent me to /user/1.

When I tried to click the "Go To Site" link - it sends me BACK to /user/1.

I did nothing out of the ordinary except log out.

How do I get my Back To Site button to point to the correct location (mydomain.com/) again?


texts: How to add a custom field to apache solr?

texts: How do you create your own solr field using Drupal 8's search api?


texts:
I assume that as soon as you add a contextual filter, that is not a fixed value, the View becomes uncachable since it becomes dynamic, right?

Is there a clear cut way to tell if the View gets cached or not?


texts: D6 -> D8 : Migrate only taxonomy terms from a specific vocabulary

texts:
When doing a D6->8 migration, my taxonomy term migration template imports all the taxonomy terms found in the source D6 site into my specified D8 taxonomy.

How do I filter only the terms that belong to a specific vocabulary? For a D7 migration all I needed was:-

source:
  plugin: d7_taxonomy_term
  bundle: tags

Bundles are not part of D6 so is there a way to do this in the yml file? Like ...

source:
  plugin: d6_taxonomy_term
  ???


texts: Is there a way to achieve multi-page selection. Everytime I go to the next page, my selection gets lost. Any chance to keep my selection over multiple pages?


texts: Why do uploaded files gets saved with an all-caps file extension?

texts: On my product site any uploaded images get saved with the .JPG saved in all-caps. I don't see the same issue on my local development machine so I would think it has to be a server issue? The live site uses NGINX.


texts: Datepicker and form_state with different formats

texts:
I'm using custom form for getting results from a web service.

This is a part of my form

<?php

$form['starting_date'] = array(
   '#type' => 'date_popup',
   '#title' => 'Starting date',
   '#date_format' => 'd.m.Y',
)

As you can see I'm using the date_popup from the Date module.

It's displaying correct with this format d.m.Y. but after submitting the form, I've got error from a web service, because the string I'm passing . form_state['values']['starting_date'] . on print, the values are with different format.

Lets say a user selects 10.02.2014 (today), the form_state displays as 2014-10-02.

How can I fix that? The web service has to receive only with this format d.m.Y to display the results, otherwise it doesn't work.


texts: Admin edit of older order forces to add values to newly added required fields

texts:
In our drupal-commerce e-shop orders were already working for more than a year. Later we wanted to add some required fields (phone number and "I agree with ...." checkbox), phone field few months back and the checkbox just recently (as part of GDPR-ready effor).

Today we realized that admin editing of order to move it in workflow (change state) forces the admin to fill-in the phone number field and to check the checkbox. That is not good.

Also it looks that in order list is the name of admin now ... for those edited orders.

Does anyone know how to fix this behaviour? Any existing issue? We just want to be able to change the order state and not to change anything else.

Versions: Drupal 7.59, Commerce 7x-1.14


texts: Feeds module is stripping html tags from xml

texts:
I tried my best to find an answer, but now I am finally stuck.

I am using Drupal 7.36, Feeds 7.x-2.0-alpha8 and used already 7.x-2.x-dev.

I am trying to import a XML file using the Feeds module with a simple structure:

<?xml version="1.0" encoding="UTF-8"?>
  <persons>
    <person>
      <number>
12
</number>
    </person>
    <person>
      <number>

2

</number>
    </person>
</persons>

But all I get after the import is the plain text 12 without any HTML tags.

I created a custom Content type named Persons and added one field to it, which accepts as text processing 'filtered text'.

For this purpose I checked, that my filtered text is accepting p, li and ul tags. For that I edited all relevant text formats at:
admin/config/content/formats

Anyway, after for the purpose of solving this issue I do actually just use Full HTML now, without any restrictions. If I type in HTML manually into a Person content entity the HTML tag stays there properly.

In the Feeds module I added an importer and chose under Processor (in my case node processor) 'texte-format' Full HTML. Here I added as a bundle my Person content type.

As parser I use XPath XML parser.

Fetcher is File-Upload.

The importer is properly attached to Persons content type under basic settings.

Anyway, always, when I import my XML, it strips off the HTML tags.

I do not use any WYSIWYG module.

What am I doing wrong?


texts: cache_render database table growing in size

texts:
I am having a drupal 8 website where cache_render table is growing to GBs. I am not sure why this growing huge, any starting pointers would be helpful.

Thanks


texts: Filtering on node whose user ID is equal to the current user

texts: In Drupal 6 you can have a filter node.uid = current user. How do you do this in Drupal 7?


texts:
I am trying to add some custom view options. I am not even sure if what I'm trying to do is possible.

Basically I want to put a custom option under the Other category.

It would look like:

My custom options: disabled

When the user clicks on "disabled", it should show a custom form where the user can set some settings for that view.

I have looked into this, but couldn't find anything that would let me add custom options here.


texts:
I have a peculiar problem. I have 3 sites on a Debian/Nginx setup.
Let's call them site1.com, site2.com and site3.com.
After upgrading to 7.20, site2.com and site3.com image styles stops being created while site1.com is working. I installed fresh Drupal 7.22 in a subdirectory in site1.com and site2.com (also upgraded all the sites to 7.22). The fresh installations won't create image styles either. I thought the fresh installation in site1.com subdirectory will work since site1.com itself works fine but that's not the case. I'm totally lost here. The Nginx site conf settings are the same for all the sites so I'm not sure it's a server issue. I have spent the past few days reading about this but can't an issue similar to mine.

I just followed the instruction here http://drupal.org/node/244924 to fix any file permission issues but the image styles are still not generated. I also tried this module http://drupal.org/project/image_allow_insecure_derivatives, it didn't work either.


texts:
I am using the User Points module to award points to user after performing below actions :

submit story - give 10 points
submit design
like design
like story

I have created rules to grant points to user after performing above events & it is working fine.

Now I want to provide a consolidated configuration page where admin can change award point
without touching to rules.

Using this interface admin can easily change the award points.

Like :

submit story - give 15 points.

Can we assign Points value by variable in rule?

If yes, how?

One way I have tried by creating content type userpoint and created 4 integer field for same. Where we can store value for Point n use in particular rule ->action.

Any one has done this? Please guide me.


texts: How to expose the user's email on the user's detail page?

texts:
Currently in the manage display page there is no way to display the email field in the manage display page. How do you expose this in Drupal 8 contacts details page?

There can be a work around for this as in user template or views-block rendering on profile page.


texts: What is the difference between hook_menu(), hook_menu_alter(), and hook_menu_link_alter()?

texts:
So, I am fairly new to Drupal (about 8 months in) and I am using Profile2 with 3 different profile types. Everything is working excellent, except for I wish I could wrap my head around how I can override the Profile2 view button when you click on, let's say Main Profile. So, if you are familiar with profile2, you know that it comes with a default profile as soon as it's activated, and when you click on it within the User Menu, you are presented with a screen with the local menu tabs called View, and Edit.

All I want to do is keep the View button, but change the path to either a panel page or an actual Views page.

I've explored hook_menu(), hook_menu_alter(), hook_menu_link_alter(), and to tell you the truth, I just don't get how those work. I believe hook_menu actually adds new "nodes" or paths to the system with their own page?

I think I have a lot to learn when it comes to these three functions (hook_menu(), hook_menu_alter(), and hook_menu_link_alter()) I just need a savior to explain these to me.

As a sub question, along with the View, and Edit button, how would I go about adding an extra local menu button to this row? Like upgrade my account, or view your bill?

Any light would be appreciated, and I do have the Devel module installed, as well as the theme developer tool. I tried making a custom module, and running a DPM on those functions above, but it's not even outputting anything.


texts:
First of all, apologies if this has already been covered, but since I have no idea of what I'm looking for, it's a bit hard to find information about my problem.

Then, the problem: I'm looking for a way to create pages with any number of any type of (pre-existing) fields. For example, I may want a plain old page with its body text and that's it. Then some day I might want a page with body text and a picture gallery, and that's also easy. Then I might wake up one morning and want to have a page with a gallery to begin with, then some text, then another gallery, then a list of mp3 files. And then whatever I need on a daily basis.

Now, as this is for my personal web site, I could easily get my hands dirty with HTML and be done with that, but suppose one day one crazy client of mine comes up with a similar request. What am I supposed to do? Surrender to the evil "15yo nephew" that "can do it no sweat in a matter of hours and a fraction of your paycheck"? See, I use my web site as sandbox/gym to prevent situations like these :)

Any suggestion is welcome (although I'd rather keep Panels as a last resort, and I'm not even sure it does what I'm asking).

EDIT Here's a good example of what I'm trying to achieve, except that that site is uses Wordpress so I'm guessing everything has to be done by hand


texts: How to grant access to anonymous users to submit contact form in webform module

texts:
I installed Webform module and also Permission per Webform to configure permissions for each webform. this is configuration in  Permission per Webform:

but anonymous users are still unable to see the Webform submit form. how can I enable them to see and submit the form?


texts: How to add field to views programmatically at rendering phase?

texts:
I need to do it all programmatically.

First I've added field to view query:

/**
 * Implements hook_views_query_alter().
 */
function mm_views_query_alter(&$view, &$query) {
    if ($view->name == 'my_view') {
        $query->fields['my_field_alias'] = array(
          'field' => 'my_field',
          'table' => 'my_table',
           'alias' => 'my_field_alias',
        );
    }
}

It seems to work, at least I'm seeing proper changes in SQL query.

Now I'm trying to add this field to display:

/**
 * Implements hook_views_pre_view().
 */
function mm_views_pre_view(&$view, &$display_id, &$args) {
    if ($view->name == 'my_view') {

        $view->add_item($view->current_display, 'field', 'my_table', 'my_field', array(
            'label' => 'My Label',
        ), 'my_field_alias');

    }
}

What I am missing?


texts: How do I change the Default Query of a Views Exposed Filter with hook_form_alter()?

texts:
I searched for an entire day on this issue and found no working solutions that affect the "initial query" of an exposed form in Drupal 7.

I have a simple checkbox exposed as a select list; the options are All, 1, or 0. It defaults to All on default. I'm trying to change it to 0. With that said, I was able to successfully set the default value of my exposed form (doesn't affect the initial query) and rename the options with a custom module:

function MODULE_form_alter(&$form,&$form_state,$form_id) {
//dpm($form);
  if($form_id == 'views_exposed_form') {
    $form['field_checkbox']['#default_value'] = '0';
    $form['field_checkbox']['#options']['All'] = t('Both');
    $form['field_checkbox']['#options']['0'] = t('Unchecked');
    $form['field_checkbox']['#options']['1'] = t('Checked');
  }
}

I tried to interpret merlinofchaos' advice in the only relevant advice I could find on this (9 year old thread) and might not even be relevant to D7.

function MODULE_NAME_form_alter(&$form, $form_state, $form_id) {
    //print $form['#id'];
    if($form['#id'] == 'EXPOSED_FORM_NAME') {
        if (!isset($_GET['EXPOSED_FILTER_NAME']))  {
            $form_state['input']['EXPOSED_FILTER_NAME'] = '0';
        }
    }
}

Though the above code changes the $form_state['input']['EXPOSED_FILTER_NAME'] variable from "All" to "0", it doesn't change the default query. I have dpm'd both $form and $form_state, but I don't know what needs to be changed. Any advice would be extremely appreciated!


texts: How to add terms and conditions in the ubercart?

texts:
I had tried site displaimer module.

It needs node title or id. What is the node id or title for ubercart checkout page ?

I also had tried uc_tc module. It seems only for drupal 6.

Any advice? I just need terms and conditions appear at ubercart checkout page.

Many Thanks


texts: Fatal Error: image.effects.inc for Drupal 7.12 Modules/image/ Directory

texts:
I'm getting a message that says:

Fatal error: Cannot redeclare image_effect_info() (previously declared in sites/all/modules/image.effects.inc:14) in /modules image.effects.inc on line 62

This messes up my whole theme and my homepage when I visit it I'll get the
previously mentioned error.

When I remove the file image.effects.inc and replace it with new it temporarily
fixes the problem. I have figured out what is causing the error. When I go
to the image module and try to edit scale, effect and update it posts the same
error above.

http://www.myriadangel.com/ -----/**/media/image-styles/edit/thumbnail/effects/1

Is there a patch for this error in image.effects.inc ? Or what would be causing
this to happen. This is part of Drupal 7's core files located at:

drupal.7.12/modules/image*/image.effects.inc*

Error occurs when editing a thumbnail under image styles within the modules.
And randomly my theme will crash with the above fatal error at the end of the
page.

Thanks a lot!
Troy


texts: Given a form, how do I find the fields present in them?

texts: How do I get the list of fields present in a certain form, I know the form id, I just need the names of the fields present in that form ?


texts: Remove the language prefix from the file URL

texts:
We have a multilingual site on Drupal 6. which seems to work fine, we created a rotor view on the default language (en). This views looks great on default language which loads without any language prefix on url.

But when we switch to any other language (example fr) the views images doesn't load because the file path it queries for is prefixed with language code. I have tried the same on drupal 7 it works outof the box. But not sure if we can do this in drupal 6. I have tried couple of module like pathologic, redirect module but doesn't seem to help in my case.

File path for default language: example.com/sites/all/files/test.jpg

File path for other language:  example.com/fr/sites/all/files/test.jpg  [which doesn't exists on server]


texts:
I would like to display on a single page several blocks generated by views and associate the same bulk operation to all of them so that the user only needs to click execute once.

Where would you start to achieve this ?

All ideas welcome.


texts: Is there a module that provides a field for referencing values of another field

texts:
Initially I thought I could use the same field on both entities, but I want the user to be able to select unlimited values from the reference field limited to the options that could exist in the original field.

In the field settings, I need to have the ability to select a field to reference.  When looking at the field instance I'd like to be able to tell which field the value should be compared against.  The user should be able to select from all of the possible values of field A and store that selection in field B.

Changed this, as it made it sound like I wanted something similar to node reference

  Entity 1: Field A

  Entity 2: Field B (Values from Entity 1: Field A stored in Field B)

The goal is to be able to use Field B to find entities having Field A that are the same value

Is there any way to achieve this kind of relationship between fields?


texts: How to override the user edit page using Panels?

texts:
I am trying to override the user edit page in Drupal7 using Panels. I checked the selection rule as user being edited are one of authenticated and administrator.
However, when I try to add a context to it and select the context User being edited, it asks me:

Enter the name or UID of a node
(A user edit form)

What do I write in here, any suggestions? Am I on the correct track or do I have to add any other context or relationship as well?
I also tried giving different path and ID but then I get some kind of ajax error.
Ps: Below is my screen shot, what do I enter in the first field?


texts: How to reset a site to its profile installation? D7

texts:
I installed the Commerce Kickstart distribution and I've made some modification. Now I'd like to reset the site to remove all my modification and get the site restored.

Do I need a module to do this? Maybe this one: http://drupal.org/project/drupal_reset


texts: Google/search engine links to Drupal site broken, why is domain missing a slash?

texts:
I noticed that links to my site from search engines don't work. Google links me to https://www.site.comcontent/page-title-1. I am using Pathauto and Clean URLs. The slash is missing at the end of the domain. Is there something obvious I have misconfigured? I can navigate around my site just fine once I am there.

Edit: originally mis-typed the problem - note https instead of http.


texts: Does performing $entity->save() on field collection programmatically clears the page cache of it's node host?

texts: I am using $entity->save() on a custom hook_cron that runs every minute. Does anyone knows if by doing $entity->save() , Drupal will clear the page cache of the nodes/views/panels housing it?


texts:
I need to create a button that will allow a user to update a field value on a node without accessing the edit page. I'm using access control to limit access to the node, and roles which could define which user sees the button. The field I need to update is a custom pick list.

Is there a module to do this? I can't find one. THANKS!

(More info on my specific implementation)

My site allows users to list resources for other users to book. When a user wishes to book an item, he creates a new node (Booking). The owner of the resource is also given access to this node. Here, they can comment and exchange files (attachments) to work out the details. This node has a field called "Stage", which starts as "Pending". Once the owner has confirmed the details of the booking, I want him to be able to click "Approve" on the booking node, changing the status to "Approved". When the resource has been returned, the owner should hit a "Completed" button, changing the status to "Complete". I'd also like both users to see a "Cancel" button at all times.


texts: How do I change priority of two different implementations of hook_node_access()?

texts:
I am using the Node View Permissions module, which implements hook_node_access(). I am also using a custom module (mymodule.module) which is implementing the same hook. node_view_permissions_node_access() is always invoked after mymodule_node_access().

How can I change the hook invocation order? mymodule_node_access() should be executed after node_view_permissions_node_access().


texts: Create block programmatically based on node content

texts:
In Views we can create a block that the content depends on the content of a node using contextual filters. So we can pass variables and check the visibility of the Views-Block.

Let’s say in our content type we have a field that has a text-field. In Views->Contextual->Our field->Provide default value-> content ID from URL can grab this.

But creating a block programmatically

hook_block_view($delta = '') {
…
$block['content'] = theme('item_list', array(
         'items' => ???,
          'type' => 'ul',
        ));
…
}

How we can grab these values form the node-field?

And if there are no values how we will hide the block?


texts:
I have a multilingual site on Drupal 8 migrated from Drupal 7. It has URL language detection method. Default language is English, it has path prefix /en.

With this configuration front page is displayed by the url: site.com/en

Can I somehow remove this prefix only on the Frontpage (English) with the 301 redirect from site.com/en → site.com?

It was possible to do this in Drupal 7. But how it can be done in Drupal 8?

I understand that I can remove the prefix from the default language, but I'm interested in keeping it as it was and change only the front page.

Thanks in advance.


texts: Use 2 different font sizes on combobox form elements

texts:
In a form combobox, is it possible to have each combo box element have 2 different font sizes?

Blue (like the sky)
Yellow (like the sun)
Green (like the mix of the above)

The color names would display using a 16px font.
The text in parentheses would display using a 11px font.


texts: How to check whether one's current User Points are negative with the Rules module?

texts:
My question is pretty straightforward: how can I check whether a user's current amount of User Points is negative with the Rules module? I'd like to create an action that should be activated when the user is granted User Points. The event is set, but I don't know how I can set the condition.

Edit: I enabled the PHP filter module in order to get the 'Execute custom PHP code' option in my Rule's conditions. (I didn't know that I had to do this before...) I used this code to check whether the user's User Points are negative:

global $user;
$num_pts = userpoints_get_current_points($user->uid, 'all');
$neg_pts = $num_pts < 0;

Unfortunately, it's always evaluated as 'false', even when the amount of User Points is negative. I've also tried this:

$num_pts = userpoints_get_current_points([userpoints-transaction:user]->uid, 'all');
$neg_pts = $num_pts < 0;

But that didn't work either (same reason). I don't get any error messages in both cases.

Are these code snippets wrong? How does the correct one look like?


texts: Web service APIs returns HTML content instead of JSON response

texts:
I have used Drupal 7 before and the web services were working perfectly fine. I recently started working on Drupal 8 (8.8 to be precise), and the login service is not working properly. When I do not give the username or the password it should ideally give a message that username/password must be entered. But I am not getting any response here.

It's just returning HTML content. I have been searching lot of posts on this and nothing seems to work for me. I am testing the same in Postman. Below is the screenshot of the same.

I have gone through the below links before posting here..

https://stackoverflow.com/questions/31230351/drupal-8-restful-webservices-only-delivering-html

User login REST POST returns HTML format

User login REST format

Nothing seems to work for me. Kindly suggest. Need your help. Thanks in advance!!


texts: Would changing the permissions implemented by a module require a new version of the module?

texts:
I have created a module, and I have to change the permissions implemented (and used) from the module. Should I create a new major version (e.g. passing from 7.x-1 to 7.x-2), or is it fine to create a minor version (e.g. passing from 7.x-1.3 to 7.x-1.4)?

I am talking of a module for which there is already an official release, not of a module that has only a development snapshot.


texts: How to store images on a separate server with Drupal 7

texts:
How to store (upload and move) images to a separate server (possibly with a mounted drive) with Drupal 7 and still be able to select images from the Media browser?

Also, how to serve the images from that separate server instead of the one that Drupal resides?


texts: Session expires for user logged in by moblie app

texts:
I am using drupal 7 services module version 3.x. I do not want my session to be expired.
I have set ini_set('session.gc_maxlifetime', 946080000); and ini_set('session.cookie_lifetime', 0);

This is working fine for me when I am using POSTMAN in my browser, it does not expire till I close all my browser tab and clear the cache.

When I login through mobile app my session expires after 24 hours and I receive 403 error.
How can I stop my session to expire.


texts: Contextual links for custom blocks: Add "Edit block content"

texts:
has somebody an idea, how to customize the contextual links in D8?

I have created a custom block type and it would be wonderful to have a link in the contextual links menu: "Edit block content".


texts: How do I migrate to a existing taxonomy reference field?

texts:
Given a source that has a field with the corresponding ID which outputs the id in the field special like the field nid gives back a node id.

I want to map it to a taxonomy term that is already existing on the new site and not migrated.

This is the process part of my custom yml file:

process:
  nid: nid
  vid: vid
  # there were some more fields here that I left out.
  # hardcode destination node type as publication
  type:
    plugin: default_value
    default_value: publication
  # custom fields
  field_special:
    plugin: static_map
    source: special
    map:
      1: 1
      2: 2
      3: 3

I have a field_special as taxonomy term reference field in the node I want to migrate to.

How can I map the source field to be used in the destination field which is a taxonomy term reference field?

I'm using Drupal 8.1.2 with migrate_plus migrate_tools migrate_drupal enabled.


texts: How to hide Fivestar field when editing a comment from another user?

texts:
My comments on articles have a required Fivestar rating field called 'Stars' and I hid it with the following custom module (see: How to hide rating field when adding comment to own node?):
function hiderating_form_alter(&$form, &$form_state, $form_id) {
  global $user;
  if ($form_id == "comment_node_article_form") {
   if ($form['#node']->uid == $user->uid) {
      unset($form['field_stars']);
    }
  }
}

As an administrator, I've permission to edit comments from other users. Suppose that a user commented on his own article. That means he didn't have to set the 'Stars' field, due to the code above. But when I try to edit that comment, I do have to select a value for the 'Stars'.
How can I prevent this? It's sufficient to check that the uid from the user who wrote the comment differs from the uid from the user who edits the comment. Finally, mark that the obligation to select stars when I leave a new comment myself must be preserved!

Edit: I tried the following code:
function hiderating_form_alter(&$form, &$form_state, $form_id) {
  global $user;
  $comment->uid = $form_state['values']['uid'];
  if ($form_id == "comment_node_article_form") {
   if ($comment->uid != $user->uid) {
    unset($form['field_stars']);
    }
  }
}

Apparently, $form_state['values'] isn't well defined, because I get the following error:

"Notice: Undefined index: values in hiderating_form_alter()".

What's the correct code?


texts:
I've been using inline images with the Inline module to display the attached image like [inline:dreamspark.jpg=DreamSpark], but this module doesn't have a Drupal 7 version, yet.

Is there any alternative to this module? I have many nodes using this module.


texts:
I need an array of all enabled blocks' deltas.

For example, if I display the array, it should output the block deltas e.g. search_form, user_new, user_login, and not the block titles e.g Search, User etc

I've found a few candidates:
http://api.drupal.org/api/drupal/modules!block!block.module/function/block_list/7

http://drupalcontrib.org/api/drupal/drupal%21modules%21block%21block.module/function/block_get_blocks_by_region/7

But they all crash my site. Really can't get it to work, please give some examples that works for you.


texts:
Is there a way to get the language from a routeMatch in Drupal 8?

E.g. if I do:

$route_match = \Drupal::routeMatch();

Currently I can't find any language information in the returned object.  It looks like as if all language information has been stripped out, and the route object know's nothing about the language it is in.

I've looked into using the language manager, but can't find a way to combine this with the routeMatch class.

Scenario:
I'm writing my own AccessInterface class, and want to hide entities from certain languages.  I need the information of the language for the route (and not the site's current language).


texts: How to convert Rules 'text' data type to 'text_formatted' type?

texts:
I am working with Rules to set a node's body. Based on the data selector, the node body requires a text_formatted type as input.

Currently, my custom event only provides a plain 'text' Rules data type. Is there a way I can programmatically convert the plain text to text_formatted? And when and where should it happen?


texts:
I've recently imported my articles from another database (custom format) and I'd like to apply modules (like Colorbox and other such output-related modules) to those previous posts. Is the standard behaviour to allow this sort of thing, or am I supposed to manually adjust all previous posts?

I've only ever worked with WordPress before, and their plugins work on all articles (past and new).


texts:
I have a URI 'entity:node/27' and I want to load this entity, but I cannot find the correct helper function or class to use.

I do not want to explode the string or regex the string, I am fairly sure there is a function for this.


texts:
When a user creates an account, sometimes all the mails are sent, sometimes not all, and sometimes no mails are sent but they are returned on the site-owner mail address. All the mails are considered as spam and i don't know why. On the returned mail i get this (I have no error in Drupal report and logs) :

This is the mail system at host "my host".

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

For further assistance, please send mail to postmaster.

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

               The mail system

<"site mail">: host
    gmail-smtp-in.l.google.com[2a00:1450:4013:c01::1a] said: 550-5.7.1
    [2001:41d0:d:363d::] Our system has detected that this message does
    550-5.7.1 not meet IPv6 sending guidelines regarding PTR records and
    550-5.7.1 authentication. Please review 550-5.7.1
    https://support.google.com/mail/?p=IPv6AuthError for more information 550
    5.7.1 . w82si7064886wma.125 - gsmtp (in reply to end of DATA command)

Final-Recipient: rfc822; "targeted email"
Action: failed
Status: 5.7.1
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.1 [2001:41d0:d:363d::] Our system has detected
    that this message does 550-5.7.1 not meet IPv6 sending guidelines regarding
    PTR records and 550-5.7.1 authentication. Please review 550-5.7.1
    https://support.google.com/mail/?p=IPv6AuthError for more information 550
    5.7.1 . w82si7064886wma.125 - gsmtp

----- * MAIL RESUME * -----
...

What can i do to fix that ?


texts:
I am looking for a way to implement a "show me activities based on weather-condition" feature.

A page-user will see a weather forecast for today and the three following days with two appropriate activities underneath each.

The activities custom-post-types still exist and offer the season, weather-condition and temperature they fit best.
The actual weather conditions will come from openweathermap.
The main problem I have atm is how to filter the specific activities depending on the weather-condition. How can I tell views the specific logic I need?

Any hint how to practically achieve this?

Emanuel


texts: I've implemented an events calendar to my drupal 7 site. How would I offer the option for users to subscribe for event calendar updates?


texts: Where can I find "Enable access log" option in ststistics module?

texts:
In drupal 7 statistics configuration page, there is all option are available for module, like as shown in following image.

D7,

While in case of drupal 8 statistics configuration page there is only one option,

D8,

Where can I find that configuration setting? I did check, statistics module page on drupal.org, but it is to be updated and not mentioning about drupal 8. Thanks


texts:
I have one site with 2 domains one example.de and one example.com its a multilanguage site, so i have urls like this example.de/de/content and example.de/en/content etc, and same on com domain.

Default language is de for this two domains, but for example.com i need english to be default language.

i thought i can change it in settings.php with $conf['language_default'] like this:

$conf['language_default'] = (object) array(
  'language' => 'en', 'name' => 'English', 'native' => 'English',
  'direction' => 0, 'enabled' => 1, 'plurals' => 0, 'formula' => '',
  'domain' => 'www.example.com', 'prefix' => '', 'weight' => 0, 'javascript' => ''
);

its working but for both domains... . also i managed to redirect users to en on example.com (my home page is a node with nid 89)

function MYMODULE_node_view($node) {

        if ($node->nid == 89) {
            if ($_SERVER['SERVER_NAME'] == 'www.example.com') {
             header('Location: http://www.example.com/en');
            }
        }

    }

but its not an option

Is there any solution to change default language for my example.com domain?


texts:
I am trying to translate an existing site.

I've used i18n before successfully so I'm not totally new to it. Now to my problem…

I can create content fine in different languages the problem occurs when I try to access languages (other than the default, without path-prefix) with a path-prefix. I keep getting a 404.

Example:

English
Swedish

Their system-path counterparts:

English
Swedish

Any ideas about what might cause this?

Please note that this is a Drupal 6 install.


texts: Problem with Views accordion if using multiple accordions on same page

texts:
I'm using the views accordion module and it's working really well on this D7 site.

However, a client has now requested that two different lists are displayed on one page. I've set them both to be blocks and they appear ok - but the first of the two lists doesn't seem to get the appropriate Javascript treatment and the headings are not clickable/body does not expand.

I have raised a support request to the developers - but in the meantime anyone here have any suggestions?


texts: Main page colorbox and facebook like box

texts:
In my CakePHP site when user is first entered to my site, I check for a cookie. And if I can't find the cookie, after document load from my js file, I show Facebook like box to my visitors. I show a "div" that in invisible in my page.

I can't imagine how can I implement this in my Drupal 7 site.
Should i put the invisible div into one of my node. If so, how can I load it from main node that includes only links to inner nodes?

I would be very happy if you can write the steps or show an example of this issue.


texts: How can I list Drupal 8 Content Moderation draft

texts:
I'm able to write a "draft" as an admin so it's visible as unpublished content on the content list.

The problem is that I can not make list visible to other "editors" (Who even can access the node as "draft" and even edit it and store again).

In short words admin only is able to view all contents including drafts, other user see only published contents.

How can I make people able to browse full content list, including the drafted nodes?


texts: How to prepend a text of string to a content_type's field?

texts:
For my assignment I have to write a module that when enabled will prepend a text of string "Hello World" to the body of a text field of hello_world_article content type.

I first tried to use Drupal 8 config export to try to set a default value (hello World) by using a yml file. However I get an error enabling the module that " field.field.node.hello_world_article.body already exists in active configuration."

My yml file is:

uuid: 42c51471-d897-4cb1-ac37-b2b6cddc6f0e58
langcode: en
status: true
dependencies:
  config:
    - field.storage.node.body
    - node.type.hello_world_article
  module:
    - text
_core:
  default_config_hash: e_0gHBXrh9sHHe-XksjIYpOmFEiugHbtoJdYPxbftAI
id: node.hello_world_article.body
field_name: body
entity_type: node
bundle: hello_world_article
label: Body
description: ''
required: false
translatable: true
default_value:
  -
    summary: ''
    value: "
Hello World!
\r\n\r\n
&nbsp;
\r\n"
    format: basic_html
default_value_callback: ''
settings:
  display_summary: true
field_type: text_with_summary

How else would I get about approaching this problem. Help would be much appreciated.


texts:
I want offer a solution that a registered user can upload Images through File entity but like Copyright, Privacy and laws i want to check the image before the Image will be public.

The best solution would be if the not checked image would be temporary in a folder. If the Image is ok then i want to select it and change it to other other folder which has public access. (i can play here with CHMOD permissions on Linux). If the image isn't ok it should be deleted and not reachable via public access.

The background is, if a image including copyright infringement or other criminal materials then it should't be public reachable. It means if i hidden or don't make it with Views public in Frontend available a visitor can with right URL open the image.

I use the modules:

File Entity (last dev)
Views 3
Panels 3
VBO Views Bulk operations

Has anyone an idea? Maybe with Rules module?


texts:
What is the hack that can cause my Drual website to be blank, without showing any message error.. Not be able even I enter .../users, -> blank. It was absolutely brilliantly showing fine.

If you want to see this Drupal website URL, go ahead:

http://fightforhongkongdemocracy.net

Thanks.


texts: Finding nodes that have not been indexed

texts:
On a Drupal 8 website I'm administering the ratio of paged indexed by search_cron stays at a value far below 100%.

New pages are indexed, but it looks as if updated pages are not indexed again. I suspect that there is some problem that keeps nodes from being (re-)indexed. However, I see no error in the log. Search_cron takes very long - several minutes even when indexing only 20 pages per cron run.

There is a page Troubleshooting cron which contains an SQL query (under "Check for problems with modules") to find nodes that haven't been indexed so one can inspect them for bad content. Unfortunately, this works only with Drupal 7, and I couldn't find a similar page for Drupal 8.

How can I find non-indexed nodes on Drupal 8?

Any other idea on how to track down the problem?

Update: I now found a way to log the nodes being indexed by adding a call to the logger to NodeSearch.php. Which admittedly is a hack.

I can now see that Drupal tries to index the same nodes again and again, without success and without error messages. However, I haven't found out the reason yet.


texts:
I seem to be getting slow speeds with
DrupalDatabaseCache::set and DrupalDatabaseCache::getMultiple

i am using drupal 7 and am on a Virtual Private Server on Dreamhost which is running Fast CGI and xchache

Any tips on how to get these requests (40+ milliseconds) down under 5mills?

there are some other querries that are above 5 milliseconds
user_roles, menu_get_item, menu_item_visibility_load etc..

any tips for overall improvement in the time querries take to load?


texts:
I have 2 block (column) with 2 different content type. I need to do a unique pagination.
How can I do?

Thx


texts: How do I get the price of a line item for the transactions which are already completed?

texts:
There are some transactions which are made using drupal commerce module along with commerce ccavenue module. I have the order ids, transaction ids and list of line items purchased in each of the orders. But the problem is I if a product price is updated in past then I am not able to find the cost of the product in the past order when the product was purchased.

Is there any place where drupal stores product price for a particular order anywhere.


texts: How to use node title or path alias instead of node id in node reference contextual filter in views?

texts:
I have node A with a node reference to node B.

In a view I show all nodes A that have particular node B referenced (nid: 123, title: node-B-title).

Instead of using the nid in the contextual filter I would like to use the node title. For example, instead of:

view-name/123

I would like to use

view-name/node-B-title

How could I do that?


texts: How can I insert many field values under one term?

texts:
I'm working on a module, of which one function is grab list names and stock codes from a custom table and create corresponding terms. Now, my current code creates a new term and corresponding stock code, however this is not very efficient. How can I create one term for each unique list name and create corresponding many field values? Below is my current code:

function liste() {
    $src = ['Ý', 'Þ', 'ý', 'þ', 'ð'];
    $tar = ['İ', 'Ş', 'ı', 'ş', 'ğ'];
    $query = \Drupal::database()->select("excel","m")->fields("m",["stokkodu","grupadi"])->condition("grupadi", "","!=")->execute()->fetchAll();
    foreach ($query as $q) {
        $term = Term::create([
            'vid' => 'liste_adi',
            'name' => str_replace($src, $tar, $q->grupadi),
            'field_stok_kodu' => $q->stokkodu,
        ]);
        $term->enforceIsNew();
        $term->save();
    }
}

I thought about selecting only grupadi and grouping by it and inserting to a temporary table and then inserting corresponding stock codes in another column delimited with comma or something; but if there is another more efficient way, please let me know. EDIT: I'm looking to do something like the following:

Current:

| Manyetik Matkaplar?n Yedek Par�alar?                                                | YMD2299001      |
| Manyetik Matkaplar?n Yedek Par�alar?                                                | YMD2299002      |
| Manyetik Matkaplar?n Yedek Par�alar?                                                | YMD2299003      |
| Manyetik Matkaplar?n Yedek Par�alar?                                                | YMD2299004      |
| Manyetik Matkaplar?n Yedek Par�alar?                                                | YMD2299005      |
| Manyetik Matkaplar?n Yedek Par�alar?                                                | YMD2303001      |
| Manyetik Matkaplar?n Yedek Par�alar?                                                | YMD2303002      |
| Manyetik Matkaplar?n Yedek Par�alar?                                                | YMD2303003      |
| Manyetik Matkaplar?n Yedek Par�alar?                                                | YMD2303004      |
| Manyetik Matkaplar?n Yedek Par�alar?                                                | YMD2303017      |
| Manyetik Matkaplar?n Yedek Par�alar?                                                | YMD2303022      |
| Manyetik Matkaplar?n Yedek Par�alar?                                                | YMD2303046      |
| Manyetik Matkaplar?n Yedek Par�alar?                                                | YMD2601044      |
| Manyetik Matkaplar?n Yedek Par�alar?                                                | YMD2608020      |
+-------------------------------------------------------------------------------------+-----------------+

Desired:

| Manyetik Matkaplar?n Yedek Par�alar?                                                | YMD2299001,YMD2299002,YMD2299003

I hope you get the idea.


texts: How to display time with different field in calendar?

texts: How to display time on calendar if time is different field created usin CCK Time Module.


texts: Count the number of results of a free text field if they are similar

texts:
I'm using Drupal 8.

I want to count the number of results of a text field if they are similar.

I added a simple text field to my "Article" content type.

Users can enter the text (short) they want: textA, textB, textC ... I do not know this text and can not make a selection list.

I wish I could count the number of times a user entered textA, textB etc.

I tried with Views and Aggragation function, but it does not work. Indeed it works only for the results corresponding to selection lists where a reference to a term etc.

Any idea ?


texts: How to redirect all URLs to a new domain

texts: I'm shutting down an old site and want to redirect all URLs to the homepage of a new domain. Is there a module or quick php snippet that can do just that?


texts: Display links in my site (from an RSS feed) using the article's title as link

texts:
I need to display an RSS feed from a different site into my site, showing the title of each article.

Do you have any idea on how I can accomplish this task?
What modules do I need to install?
How can I use the Views module to create views block to display rss link?


texts: Content in block iteration Drupal 8 twig

texts:
Im new to drupal and Im having a hard time figuring things out on how to add different class within my code using for statement in twig which is a view and displayed in a block. Heres my sample code

SUPPORT

        {% for row in content['#view'].result %}

{{ content['#view'].field['title'].value(row) }}

         {% endfor %}

this code returns the node id instead of the image file, and Im really confused right. Would somemone please help.


texts: How do I hide the authoring information?

texts:
I installed Drupal 8.2.4 and the IceMagic-8.x-1.0 theme.
How do I hide the authoring information on articles?


texts: How drupal.org found a website installed module

texts:
I want to know how drupal.org counts the websites which use a specified module, as example in views module page reports:

Reported installs: 717,794 sites currently report using this module. View usage statistics.
Downloads: 4,815,869.

It is not hard to find the number of downloads but I want to know how drupal.org gets Reported installs?

Is there any way to find out the number of websites that use my custom modules that are not published in the drupal.org website?


texts: How to add "#main-content" to the link of pager element?

texts:
I would like to add #main-content to the link of pager element. So, I would get an url like this: http://domain.com/my-views-list?page=2#main-content

Any idea, are there any preprocesses or something like that?


texts: Adding a clearfix class to hook_node_view

texts:
Ok, so what I want to do is to add a class of clearfix whenever Drupal outputs a node view with inline links.

I've been looking around and I figured hook_node_view() is what I need to alter.

Looking in node.module I find the following code:

$node->content['links'] = array(
    '#theme' => 'links__node',
    '#pre_render' => array('drupal_pre_render_links'),
    '#attributes' => array('class' => array('links', 'inline')),
);

$node->content['links']['node'] = array(
    '#theme' => 'links__node__node',
    '#links' => $links,
    '#attributes' => array('class' => array('links', 'inline')),
);

So I guessed I somehow have to add a third value to this array trough my template.php file, but none of the gazillion ways I tried worked.


texts: How do I associate a field value with another value of a multi-value field?

texts:
I've run into a situation with a project in regards to field organization. I've got 3 data types, a price, a date range and a quantity. I've currently got 4 prices and a date grouped with it using field groups. Quantities are a multivalue check list with values between 1-12. I have since learned that there is to be a different price for every quantity, so I would end up with up to four price and dates for each value of quantity I have.

So what I would like to know is the best way to go about this. Is there a way to set fields so that I when I can set an association between a group of dates & prices with a value of quantity or do I need to go for some kind of table-based approach?

Currently it is set up like this:

Node {
    price1
    date1
    price2
    date2
    price3
    date3
    price4
    date4
    quantity: 4, 7, 9, etc.
}

and I need to re-organize it like this:

Quantity: 4 { price1, date1, price2, date2…}
Quantity: 7 { price1, date1, price2, date2, price3, date3…}


texts: `drush uli` generates correct link but results in 'Access Denied'

texts:
I have set up a Drush alias for my website (hosted on a shared hosting), the alias works correctly, because commands like drush status, drush cc all, etc. work. The problem comes with drush uli. It generates the one-time login link, the domain is correct, everything looks all right, but when entered into a browser, it results in standard Drupal

  Access Denied

page.

Part of setting up the alias and some interesting issues around path-alias-es, relations to database settings, it's usage and relevancy the aliases is originally discussed in Drush issues page on GitHub.

Technical information:

This is a clean Drupal 7 installation, without contrib modules.
I can log in using password (even using password set via drush upwd using the same alias).
I have checked all possible sources (like truncating sessions table, etc.) discussed in similar but yet different issue on StackExchange.
I have tried different browsers and cleared browser caches and cookies as suggested in various similar discussions on Drupal.org, all without luck.

Drush alias:

$aliases['myalias'] = array(
  'uri' => 'mysite.com',
  'root' => '/home/mysite.com/web',
  'path-aliases' => array(
    '%drush' => '/home/.composer/vendor/drush/drush',
   ),
  '%files' => '/home/mysite.com/web/sites/mysite.com/files',
);

The alias works correctly for other commands like clearing caches and drush status confirms that Drupal is bootstrapped correctly.


texts: Table prefixes with db_select() in SimpleTest tests

texts:
How can I do database queries using functions like db_select() and db_query() in my DrupalWebTestCase sub-class? When I try to run them, I get an error:

  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'simpletest421143 WHERE (nid = '1')' at line 2`

I think it's because the tables aren't properly prefixed, yet I see the prefix in the error string. So it seems that it's trying to prefix, but not doing it properly.

How can I use these functions in my testing class?


texts: How to display number of comments of a node as part of a "content" view with fields

texts:
I created a content view in D8, which shows me fields of a content type.  Basically it works.

Now I would like to have the total number of comments per listed node displayed as a view field additionally.

There is a field "Count of comments" in the category "Comment Statistics".

When I include this field into the view, all results are hidden, which don't have a comment yet, instead of just display a text like "0 comments" or "No comment yet".  The option for the "Behavior if no results" for that field is simply ignored.

I would like to avoid using teaser display mode for my view due to theming reasons, and use fields in the view only, if that is possible.

Does anyone have an idea how to get that solved?

Thanks in advance, Phil

Edit:

Using an author relationship and an user id as contextual filter. But the nodes without comments disappear when comments count field is enabled.

I tried ot also with a new view with no relationships and context filter. Unfortunately the problem still exists.

Here is another issue I found:

https://stackoverflow.com/questions/51416208/node-disapper-with-adding-comment-statistics-comment-count-in-view-drupal8


texts: Add a block in page content that use viewreference

texts:
I have a content type that use viewreference module to display views on page content.

So every field added with the type "View reference" in manage field section will display the corresponding view.

I want to insert a new created custom block, between those views(witch are fields in reality).

to be more clear:

  Field 1 => displays view 1
  Field 2 => displays view 2
  I want my block here
  Field 3 => displays view 3

Thanks in advance.


texts: How to show the tabs according to the logged in user role? (Omega subtheme)

texts:
I´m using an Omega subtheme in a Drupal 7 installation.
I´ve set at the theme configuration, that Drupal should show the tabs ($tabs).

What I want is to show the tabs only to a specific role.
I try this snippet out, wich didn´t worked. My guess is that it didn´t worked because I´ve told Drupal through the omega subtheme, to show the tabs. And the theme show them to everybody.

If I uncheck "show tabs" variable, they won´t show up, no matter what I do at my template file.

If I uncheck the tabs but add them inside my page template file, whey won´t show up either.

I want to be able to show the tabs or not according to the logged in user role.
Here´s my snippet that doesn´t worked (at my page.tpl.php file):

<?php
global $user;
if (!in_array('admin', array_values($user->roles))) {
print render($tabs);
  }
  else {}
?>

What should I do? Thanks for your help!!


texts: When and where is calling menu_link_save safe and appropriate?

texts:
From what hooks (or "types" of hooks) is it appropriate to call menu_link_save?

I have a situation where I would like to add a bunch of entries to {menu_links} where an entry already exists in {menu_router}.  To state this another way, I would like to add direct links to a menu for which another module has defined a wildcard entry via hook_menu.

A concrete example would be that I would like to add a menu item to a menu for "taxonomy/term/123".  In this case, there is already a router entry for "taxonomy/term/%" which the taxonomy module created.

I know how to use this function.  I am just not sure where I can (or should) call this from.  This isn't a situation where a user is saving a node, or something else that would be considered an event.  Essentially, I just want my module to create a bunch of links so the end user doesn't have to.

Would this be best done by a hook_enable?  Are there any popular modules that I can take a look at for examples / use cases?


texts: Does Commerce Kickstart distribution include "advanced search" capabilities?

texts:
By default the Commerce Kickstart distribution include a Search block. Just wondering if this distribution include a feature to add advanced search capabilities.

The advanced search would allow the user to filter by taxonomies terms.


texts:
Is it possible to start next batch_set() after finishing first one?
I've some import functionality which includes 4 steps. The next step takes data processed from first batch process so this is consecutive process which needs to be run one after one.


texts:
I am trying to save data programmatically to an address field from the Address module.

I am not successful.

First, when I dsm() a node with the address field filled out, it looks like this:

        [field_addr] => Array
            (
                [x-default] => Array
                    (
                        [0] => Array
                            (
                                [langcode] =>
                                [country_code] => US
                                [administrative_area] => CA
                                [locality] => San Diego
                                [dependent_locality] =>
                                [postal_code] => 91945
                                [sorting_code] =>
                                [address_line1] => 123 main st
                                [address_line2] => apt 2
                                [organization] =>
                                [given_name] =>
                                [additional_name] =>
                                [family_name] =>
                            )

                    )

            )

However, no matter how I try to save it to my node, it doesn't work.

I create an array that looks like this:

Array
(
    [x-default] => Array
        (
            [0] => Array
                (
                    [address_line1] => Australian Club
                    [address_line2] => Royal Lane
                    [locality] => Sydney
                    [administrative_area] => NSW
                    [country] => Australia
                )

        )

)

Let's say with the name, $address_save

And then do the following:

$node->set('field_addr', $address_save);

No luck. My node saves with other fields, but this one doesn't. I've also tried it without the x-default key around it as well as without a delta, but neither of those work either.

How can I save values to an Address field inside of a node?


texts:
I have a normal view on multi language site and add a field Called website the field is displayed on en language but does not show in the another language

How i can fix this problem


texts: Drupal Commerce Export Orders in CSV format

texts: How can I export Order details along with custom line item fields data in CSV format?


texts:
I have 2 exposed filters in a search page "drop down lists", I want to populate the second exposed filer "taxonomy" from the first one:

example
vehicle {car, plane, ship}
and the second should be {BMW, Honda, etc}
only if vehicle car is selected in the first drop down list.
thanks


texts: Token Value to insert URL of page into field

texts:
I am trying to create a webform to appear at the end of all my site pages that asks if there is anything about the page that should be improved.  This is dumped straight into the page.  In order for this to make sense I need to be able to record the url the form was shown on.

I tried to dump these tokens into the default value for a field

%nid
%title

but they output the nid of the webform not the page it is dispayed as a block on.

If the user is logged in I can use

%server[SCRIPTNAME]

which works but almost all my users won't be logged in.

Is there a way I can get this information into a field on my form?   Otherwise my feedback for is useless.


texts: Hiding nodes based on geographical location

texts:
I am setting up a ecommerce site for a client using drupal and ubercart. They have a number of products on the site that are not available in certain countries. We have discussed solutions using subdomains, but ideally they want to be able to control whether or not a product visible in any giving country.

So my question. Is there a module that allows a person to block the visibility of a node based on the user's geographical location? Ideally, this would block everything including any views the node might appear in. Any ideas?


texts: What does Drupal use for caching? Is this something like APC or memcache? Where does it store cache files?


texts: How can I add a CSS class to a View Field programmatically?

texts:
Using template_preprocess_field doesn't work, I assume, because this is a field from a View, not a node.

I've looked at this answer however that only seems to apply to the field value not the markup and styles surrounding it.

For example: The output of the field in markup is currently:

        Active

I'd like to conditionally add classes:

        Active


texts:
Why isn't the Twig debug working on my Drupal 8.2.6 site?

This is the folder structure.

These are the folder permissions.

This is the content of the settings.php file.

$settings['hash_salt'] = 'DEVELOPMENT_SALT';
$settings['update_free_access'] = FALSE;
$settings['file_public_base_url'] = 'http://localhost/files';
$settings['file_public_path'] = 'sites/default/files';
$settings['file_private_path'] = 'sites/default/private';
$settings['file_scan_ignore_directories'] = [
  'node_modules',
  'bower_components',
];
if (file_exists(__DIR__ . '/../development/settings.development.php'))     {
  include __DIR__ . '/../development/settings.development.php';
}

Here I include /../development/settings.development.php.

assert_options(ASSERT_ACTIVE, TRUE);
\Drupal\Component\Assertion\Handle::register();

/**
 * Enable local development services.
 */
$settings['container_yamls'][] = __DIR__ . '/development.services.yml';

$databases['default']['default'] = array(
  'database' => 'dbname',
  'username' => 'dbusername',
  'password' => 'pw',
  'prefix' => '',
  'host' => '127.0.0.1',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);

$settings['hash_salt'] = 'DEVELOPMENT';

$config['system.logging']['error_level'] = 'verbose';
$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;
$settings['cache']['bins']['render'] = 'cache.backend.null';
$settings['cache']['bins']['dynamic_page_cache'] =     'cache.backend.null';
$settings['extension_discovery_scan_tests'] = TRUE;
$settings['rebuild_access'] = TRUE;
$settings['skip_permissions_hardening'] = TRUE;

Here I also add development.services.yml.

parameters:
  http.response.debug_cacheability_headers: true
  twig.config:
    debug: true
    auto_reload: true
    cache: false
services:
  cache.backend.null:
    class: Drupal\Core\Cache\NullBackendFactory

Things I have checked/done:

Checked if all these files are loaded -> They are
Checked the indentation of the development.services.yml -> Checks out
Cleared all the different caches, rebuild them, etc -> If I change a template, it changes, but no Twig debugging

sites/default/files AND sites/default/private are not used by Drupal.


texts: Feeds import should delete non-existent nodes and not insert new nodes

texts:
Use case:
Drupal 7
Importing nodes from an XML source.
Every Wednesday 18 PM: run import and add new nodes.
Every hour: run import and delete non-existent nodes AND do NOT add new nodes.

I'd appreciate some help since after a lot of testing and searching I'm still not getting this to work properly.

I'm using two importers: one to import (no problems) but I can't get the second one to delete any nodes.

EDIT: Sometimes trying to formulate the question for someone else, pops up new ideas!
Could the problem be that you simply can not use two feeds for one content type?


texts:
Okay, it's about a person height.
I have a height field in my profile2 for user who select their height from a list text. Values look like this:

5'9"
5'10"

I would like to search users based on a height range. In the exposed filter block I have some pre-defined ranges such as:
5'6" - 6-0"
6'1" - 6'6" etc

And once selected it should display all users that fall into that height range

I had a similar requirements with age and I've managed to use the date field type for dob field and then use a field called age (with computed field type) to calculate the age and then use the "in between" operator in the "grouped filter" to filter different age group.

Here is a screen shot:
http://grab.by/J73y

Issue with the height field is that it's not a date type, it's a mere string and hence I can't see "in between" operator.

So, how can I implement for the height field? any idea?


texts:
I've written a javascript that for some reason whenever I run it, it removes any hover events.  Since I am running my site with nice menus I would like to run my script as high up in the $script array as possible.

I added this line to the template.php:

drupal_add_js('sites/itascacg.com/themes/custom/icg/js/fixtitles.js',array('type' => 'file', 'weight' => -19));

since according to the documentation I've read jQuery itself is at weight -20, but no matter what weight I give my script i won't float any higher on the list.

does anybody have anybody have any ideas how to push my script up, or at worst push all the other scripts down?

P.S. I'm using drupal 7


texts:
I'm having a problem with the plupload module.
The normal upload works perfect, the files are stored in sites\default\files\tmp.
I'd like to "walk" through the uploaded files using the hook_submit.
It seems, this hook is not called, when pressing start upload on the plupload form.
I'm using almost the same hook_submit as the test form in the plupload.module.

What am I doing wrong?

Here is my form definition:

 $form['my_element'] = array(
'#type' => 'plupload',
'#title' => t('Upload files'),
'#description' => t('This multi-upload widget uses Plupload library.'),
'#upload_validators' => array(
  'file_validate_extensions' => array('jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp'),
  'my_custom_file_validator' => array('some validation criteria'),
),
'#plupload_settings' => array(
  'runtimes' => 'flash,html4',
  'url' => url('plupload-handle-uploads', array('query' => array('plupload_token' => drupal_get_token('plupload-handle-uploads')))),
  'max_file_size' => file_upload_max_size() . 'b',
  'chunk_size' => '1mb',
  'unique_names' => TRUE,
  'flash_swf_url' => file_create_url('sites/all/libraries/plupload/js/plupload.flash.swf'),
  'silverlight_xap_url' => file_create_url('sites/all/libraries/plupload/js/plupload.silverlight.xap')
),
);

Here is the submit function:

function get_upload_form_submit($form_id, &$form_state) {
//handle file uploading
global $user;

$saved_files = array(); //Array to capture file objects
$scheme = variable_get('file_default_scheme', 'public') . '://';
$directoryname = 'imagebank'; // Directory where images are collected
$imagebankpath = $scheme . $directoryname;
dpm($imagebankpath);
file_prepare_directory($imagebankpath, FILE_CREATE_DIRECTORY); // Create the folder if   it doesn't exist
// We can't use file_save_upload() because of
// http://www.jacobsingh.name/content/tight-coupling-no-not
// file_uri_to_object();
foreach ($form_state['values']['uploadfiles'] as $uploaded_file) {
if ($uploaded_file['status'] == 'done') {
  $source = $uploaded_file['tmppath'];
  $destination = file_stream_wrapper_uri_normalize($imagebankpath .'/'. $uploaded_file['name']);
  // Rename it to its original name, and put it in its final home.
  // Note - not using file_move here because if we call file_get_mime
  // (in file_uri_to_object) while it has a .tmp extension, it horks.
  $destination = file_unmanaged_move($source, $destination, FILE_EXISTS_RENAME);
  $file = plupload_file_uri_to_object($destination);
  file_save($file);
  $saved_files[] = $file;
}
else {
  form_set_error('uploadfiles', "Upload of {$uploaded_file['name']} failed");
}
}
}

Did I forgot anything?
Thx.


texts:
Currently I am hooking into the add to cart form on my website. I added ajax to the edit quantity buttons like :

    $form_quantity[$key]['#ajax'] = [
      'callback' => 'update_cart_order',
      'disable-refocus' => FALSE,
      'wrapper' => $form_div_id,
      'event' => 'change',
      'progress' => [
        'type' => 'throbber',
        'message' => t('Updating Cart...'),
      ],
    ];

Which works lovely. I will note that $form_div_id is an id I'm wrapping the entire form in just above this.
Now I don't think I fully understand what I am supposed to return from my ajax. The view I am hooking into lists the products on one side and the order total on the other.

In my callback I (seem to) successfully update my cart quantities. But returning gets rid of the order total from this form.
I do nothing to edit the form and just return $form. All I do is update the order item.

I've looked around and think I may not understand what the ajax return really does but cannot seem to make sense of it. I just want to update my total price without refreshing the whole page.

In 'update_cart_order' I am changing the quantities and ending with this :

  $order->save();
  $order->recalculateTotalPrice();

  return $form;

This causes the total price display to disappear. After refreshing the page to get it back the quantities are properly adjusted.

Please let me know if any more information is needed. :)


texts: Custom default value for Webform's select options component

texts:
I use Drupal 7 with Webform 7.x-3.9.

I have created a new component from type "select options". I also have chosen to display it as a listbox and I've populated it with a few strings from the type "safe_key|Some readable option" as expected. Here's an example :

1|Mr.

2|Ms.

3|Miss

Everything works perfectly well and the behavior is the following :

If I select this component to be mandatory, the display will be "-Select-"
If I don't select this component to be mandatory, the display will reflect the first string from the "Options" text area. In my example, it will be "Mr."

Now, imagine I want to have "Ms." but don't want to change the order. Nowhere I see this possible. Unfortunately, the "Default value" textfield is only used for tokens...

Any idea ?


texts: "fwrite(): supplied argument is not a valid stream resource"

texts:
drush throws an error

  "Notice:  Use of undefined constant STDERR - assumed 'STDERR'
  in /kunden/192766_10587/bin/drush/includes/drush.inc on line
  1668  Warning:  fwrite(): supplied argument
  is not a valid stream resource in
  /kunden/192766_10587/bin/drush/includes/output.inc on line
  34

What I did is the following. (I followed the instruction from the README.)

Cloned drush

git clone --branch 7.x-5.x http://git.drupal.org/project/drush.git

Wrote into the ~/.bashrc

export PATH="$PATH:~/bin/drush:/usr/local/bin"
alias drush=~/bin/drush/drush.php

Refreshed the bashrc

source ~/.bashrc

Set the 'drush' command executable:

 chmod u+x /path/to/drush/drush

Drush is working but it shows errors every time.

What did I do wrong?


texts: Can I set a theme's logo_path programmatically?

texts:
When adding a logo file to a custom theme, I can either

save my logo in the theme folder as logo.png (replacing the default logo.png from the theme starterkit I'm using), or
save my logo in the theme's images folder, using the filename I choose, and use the theme settings page at admin/appearance/settings/themename to set the logo path.

I'm looking for a way to save the logo file in the images folder, while setting the logo path programmatically. This would make sure that the logo is automatically set when enabling the theme. Wouldn't it make sense if that could be done in themename.info, using something like settings[logo_path] = path/to/my/logo-image.png?


texts: How could i configure drush to be always affirmative and verbose in a drush.ini-file?

texts: Could I configure drush for non-interacive usage from bash-scripts to be always affirmative as I would pass the --yes and -v-option in /etc/drush/drush.ini? I'm aware that I could set a bash-alias and that I could set it in /etc/drush/drushrc.php. But for reasons of clarity I'd like to use the ini-style-configuration.


texts:
I am trying to implement Quiz module in Drupal 6

The quiz scores will be tied to their accounts, with the ability to retake a quiz if permission is granted by Admin. How can I do this?

Also someone should not be able to advance to the next video unless they have scored a high enough score on the quiz or they have a password to open the next video.

Does anyone have any ideas?


texts: Integrity constraint violation: 1048 > Column 'entity_id' cannot be null

texts:
Whenever I try and create a new node (of type article, page, blog, etc), for some reason I get thrown the following error upon hitting the save button.

  PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048
  Column 'entity_id' cannot be null: INSERT INTO {pathauto_state}
  (entity_type, entity_id, pathauto) VALUES (:db_insert_placeholder_0,
  :db_insert_placeholder_1, :db_insert_placeholder_2); Array (
  [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] =>
  [:db_insert_placeholder_2] => 1 ) in pathauto_entity_state_save()
  (line 492 of /sites/all/modules/pathauto/pathauto.module).

I've tried going into the database and setting these columns to allow NULL, but this doesn't seem to fix the issue. I've also tried uninstalling and reinstalling the pathauto module, but no luck.

This error was occurring previously with a couple of other modules, and I seem to have fixed them. I'm just not sure why this error is occurring at all (e.g. I can edit and save existing nodes, but creating new ones all of a sudden is a problem?)

UPDATE: Another issue I seem to get:

  PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048
  Column 'id' cannot be null: INSERT INTO {file_usage} (fid, module,
  type, id, count) VALUES (:db_insert_placeholder_0,
  :db_insert_placeholder_1, :db_insert_placeholder_2,
  :db_insert_placeholder_3, :db_insert_placeholder_4); Array (
  [:db_insert_placeholder_0] => 126 [:db_insert_placeholder_1] => file
  [:db_insert_placeholder_2] => node [:db_insert_placeholder_3] =>
  [:db_insert_placeholder_4] => 1 ) in file_usage_add() (line 698 of
  /includes/file.inc).


texts: Drupal commerce order notification to field in a line item type

texts:
I have a Drupal 7 install using Drupal Commerce to handle donations. I created a line item type called donations, with fields such as donation amount, anonymous donation, etc.

One field of the donation line item type is called honoree email, which is an optional email field that when filled out is suppose to sends the donation order to the user who created it and the honoree.

In order to send the email to the honoree, I wanted to add a new action to the "Send an order notification e-mail" rule and use data selection to highlight the honoree email field in the "To" value. However, I am unable to find the honoree field. My data selector looks like this:

commerce-order:commerce-line-items:...

and I'm presented with an array 0-3;
commerce-order:commerce-line-items:0:
commerce-order:commerce-line-items:1:
commerce-order:commerce-line-items:2:
commerce-order:commerce-line-items:3:

I'm not sure what the differences are, and the values under each of those keys do not include the custom fields the I added to the donation line item.

How do I access the honoree email field?


texts: How to place two Fivestar widgets on the node for voting?

texts:
I would like to place the fivestar voting widget both to the beginning and to the end of my node. I do not talk about two different ratings, I'd like to let my readers vote in both positions. I read the code of Fivestar, but I did not find the solution in the module source. I think the JS code would get wrong if two voting widgets were present on the page.
Do you have any idea how to solve this problem, how to duplicate the voting widget somehow..?

I'm using Drupal 6 btw and Fivestar 1.19.


texts: Restrict access to edit page for specific user

texts:
I have 2 accounts where I need to prohibit them from editing the profile. I managed to hide the edit button but when I type edit into the URL it still allows them to edit the user profile.

if ($user->uid == 267 OR $user->uid == 268){
} // demo profiles, prohibit editing profile
else{
print l(t('Edit My Profile'), "user/{$GLOBALS['user']->uid}/edit");
}

I can't do this based on their role. Thanks


texts: What are the security trade-offs between Organic Groups and other methods?

texts:
I'm in the early stages of implementing a community site that will be made up of many sub-communities/groups. Most content will be shared between all groups (e.g. community-wide announcements and news), but there will be several sections of the site private to each group. For the sake of discussion, let's say that every group has its own private wiki, blog, and address book.

Very generally, there appear to be two options:

One site with some content split up (Organic Groups)
Multiple sites with some content shared between them (Drupal core multisite install, Domain Access module).

The site will be exactly the same (theme, menus, layout, etc.) for every group except that each group's private sections (blog, wiki, and address book) contain content accessible only within their group.

Content in the private sections will make up an extremely small portion of the overall content, which feels like one site to me. However, as security of a group's private content is my primary concern, I'm leaning towards multiple sites.

What are the main security trade-offs between the available methods and modules?

Edit: I am not necessarily using separate domains to accomplish this, but it is an option I'm considering.


texts: Divide a webfrom textfield component into a specific input format

texts:
I have a need to divide a webform component into a specific formatting that is to match a coupon format. The user input needs to look something like this.

Then within the webfrom exported data the coupon needs to be displayed as one field.

Can anyone please suggest how this can be done or what the best practice is to achieve this within Drupal 7?

Thank you  - your help is much appreciated.


texts: How can I split up a massive feature module into multiple smaller modules?

texts: I have one massive unmaintainable features module that I want to split up into smaller, manageable features. Can I disable the massive module without it removing or disabling content types and dependencies, as well as strongarm variables?


texts: All "administration pages" in English and admin menu always LTR?

texts:
I added a RTL language translation file (e.g. Arabic, Persian, Farsi) to my Drupal 8 site. I want all the administration menus to always be in English and LTR. On the other hand, I want the front-end pages of my site to be in another language (e.g. Persian, Farsi).

I did the following.

I enabled the Language module, and set up one additional language. Installation was done in English; I added Persian.

I configured the administration language using the following settings.

/admin/config/regional/language/detection
Account administration pages: enabled

Admin >> Edit Profile >> Edit

This works properly for all the administration pages. Those are in English and LTR except the front page, user/1/, and admin/structure/block/demo/[theme name] where the administration menu is in Persian and RTL.


texts: How to make a menu link on a subdomain use the main domain as base_url

texts:
I have a site example.com with a subdomain sub.example.com.
In my apache config both domain and subdomain point to the same directory, containing the Drupal installation. That is as far as i went to set up a the subdomain.

The issue is, the main menu on sub.example.com uses the same menu and template as the main site. The links link to sub.example.com/node/1 instead of example.com/node/1, effectively creating a clone of the whole site on the subdomain.

How do i show the same menu, but have the links all link back to example.com/node/1


texts: How to copy data from one node reference to another node reference in same content type

texts:
I have already saved a lot of data in a content type 'Events' in the node reference field field_organization. However, I need the data to be moved to the field field_affiliation also within the same content type.

Is there a way to do this with VBO and PHP command or another simpler way without code?


texts: Download file field dependent on user role vs role field values

texts:
I have a type downloadable_item which has a field field_roles_allowed that is based on the Role Field Module.

My goal is to have a field_download of file type that will show the file for download if the user in a role selected in the field_roles_allowed and a message that they need to request access otherwise.

I am attempting to add a formatter for the file field type using the Custom Formatters Module. I found this tutorial on how to use the Custom Formatters module, however, they use the "HTML + Tokens" option. I will need to use the PHP option to be able to output either the download button or a message depending on whether the user is in a role in the field_roles_allowed.

I cannot figure out how to get the roles that are allowed, download file information, and current user's roles for comparison.

My question is really "How do I do these things that I cannot figure out?", but if someone believes I am going about this totally in the wrong way... I am open to another way.

EDIT: I solved my own problem below, but not really in a preferable way. How could this be done without writing PHP logic in field?