texts: How do I profile a site that is on shared hosting?

texts:
I run a commerce website in a shared hosting, from time to time it's being too slow, I tryied many ways to find the cause (css/js agreggation,enable caching, views caching, disabling some big modules :update manager,database logging,l10n,i18n, disabling no used modules, setting cron job to never) without result.
I'm not an experienced php developer, and I want to profile my website, I know that I have to install some tools in the server, so I want to ask if there is a way to do that in my shared hosting.
fortunately I'm allowed to enable many extentions and change some settings in my cpanel, below a screenshot of what I'm allowed to do.


texts: Can't log in to Drupal instance after duplicating database

texts:
I wrote a quick script to pull down a live drupal database on to a machine on a local network, and that works fine.

I also made a copy of the actual Drupal instance on my own machine.

I edited settings.php to use the db on the network, and everything appears to be working correctly when I run the site from localhost, except I can't log in.

At first I thought I should just change the password directly using MySQL, but that didn't work. Then I tried running update.php, which also didn't work.

I'm stuck, why won't it accept the username/password? I have double checked that I'm using the correct login credentials on the live site, and it works fine.

Edit: The site was duplicated from a Linux server onto a Windows 7 machine, if that makes any difference.


texts:
i have created a custom view. its just showing nodes of a particular type. Now i want to do something with it. I am writing a SQL query:

global $user;
$query = db_select('challenges','c');
$query->join('node','n','n.nid = c.cid');
$query->join('field_data_body','f','n.nid = f.entity_id');
$query->join('field_data_field_challenge_pic', 'fp','n.nid = fp.entity_id');
$query->join('file_managed','fm','fp.field_challenge_pic_fid = fm.fid');
$query->fields('n',array('nid','title','created'))
      ->field('f',array('f','body_value'))
      ->field('fp',array('fm','uri'))
      ->condition('c.cid','$user->uid','=');
$result = $query->execute();

Where should i place this query in my custom module and how can i get my view to display this? I tried writing this code in a tpl file for the view and then did print_r and render() but no effect. I think it should be done through views.


texts: Postpaid license billing type does not work with Commerce Stripe

texts:
This has been placed on https://www.drupal.org/node/2634778, but since there is no any reaction there yet I thought I'd have better chances here on Drupal Questions.

This has been tested well on a clean Drupal Commerce setup:

If a product configured with prepaid license billing type (see different billing types on https://www.drupal.org/node/2127603) is checked out, then everything works well - Drupal Commerce creates two orders: one already processed and one for the next billing period with the "Recurring: Open" status.

However, if a product with postpaid license billing type is checked out, then Drupal Commerce creates only one initial order that never recurs. What is interesting, if a postpaid product is checked out together with a prepaid product in a single order (just to get an order with "Recurring: Open" status created) and then if prepaid product gets cancelled, then the postpaid one keeps recurring successfully.

At the same time, if "Example payment" is used instead of "Commerce Stripe" as the payment method, then both pre and postpaid products recur without problems. Which makes me to believe that something in Commerce Stripe is not triggered when postpaid product is ordered.


texts: How do I only render the main content without wrapping it with the theme or side blocks and menus?

texts:
I want to output a google map div with a side panel in my drupal 8 moodule. So no need for blocks surrounding my main content.

The question is how do I tell Drupal to only render main content using a Twig template of my module without outputting the entire Drupal theme stuff a long with the menus and the blocks?

All online materials I found so far talks about concepts behind Drupal rendering mechanism and render arrays but none really tell something about their implementation.

Take for instance, the concept of page variants in the following link. HTMLRenderer fires an event to determine which type of page will be used to wrap the main content around:
RenderEvents::SELECT_PAGE_DISPLAY_VARIANT. Its also says the SimplePageVariant, which will only output the main content, is suppose to be used by default but in case the Block module is enabled like my case, the BlockPageVariant kicks in to allow the placement of blocks in the regions around the main content. It continues, if you want, you can subscribe to this event in your own module and provide your own variant. However, I couldn't figure out how to do this subscribing.

I feel what I want is simpler than creating my own Page variant. I just want to output simple html with two divs in the Twig template of my own module.

Anyone has an idea what to do?

Edit

So there are two ways to do this as mentioned in the answer below, I will just summarize them and add a little more clarification of naming convention in drupal 8:

Return a basic Symfony response  with out any drupal specific rendering:

$element['#title'] = 'Title';
$html = \Drupal::service('renderer')->renderRoot($element);
$response = new Response();
$response->setContent($html);
return $response;

Doing so, you will not be able to attach css or js libraries with render arrays. However, if you want to do that you can override the page.html.twig by following dupral 8 template naming conventions link with out returning "pure symfony" response and hindering drupal from finishing its theming.


texts:
I am new to Drupal. I have created a menu on user page to edit the account settings as user/uid/edit.

I just want to know how to replace uid with the user id of current user.


texts: Change Search API Facet title for boolean values

texts:
I have my shop set up in Drupal Commerce. I have added search API and configured facets for things like taxonomy terms, which are perfect.

However on my product display nodes, there are a set of values that are boolean on/off checkbox fields for different attributes. These are...

Vegan friendly
Vegetarian
Contains sugar
Won a taste award
Contains gluten
Contains Alcohol

But they are showing their 1 or 0 key values for the boolean. Is there anyway to name these facet values?

I want to hide the 0, hide the block titles, rename the "1" to the block title, and then group them all together with CSS. The only thing im stuck on is renaming the 1 value.

I appreciate any help!


texts:
My question is how do we get the menu in drop down structure.
i.e

I used following:

<?php print theme('links', array('links' => $main_menu)); ?>

but this only produces top level menu even if we have sub menus in menu management.


texts: How would I use entity wrapper to insert new values into an entity property list? bundle?

texts:
I would like to save a list of values into a entity property.

foreach ($results as $result)
{
   $wrapper->title->set(value);
}

Can an entity property hold an array of values or would I use an entity reference defined as a field for each of my values?

Thanks


texts:
I am using Drupal 7.x and would like to start using Pathologic to make sure that all of my relative links work properly.

As stated in their instructions, I need to configure my text formats to use Pathologic. When I try to save the configuration for a Text Format (or even create a new Text Format), it complains that I don't have permissions.

I have checked the permissions for my user and I have permission to "Administer text formats and filters". Anything else I should check?

Thanks,
Alan


texts: Change node edit form template for Drupal 6

texts:
I have tried this in different ways but nothing seem to work!
I would like to be able to apply a different theme for different node types edit form.
thanks


texts: Will empty hook definitions slow down a site?

texts: I'm working on porting over some Drupal 6 custom modules that another developer wrote, and I'm coming across some hooks that are, with the exception of comments, completely empty. I'm likely going to clean these out, for the sake of readable code, but I was curious if I would get any form of performance increase out of it.


texts:
I have two fields,

Select list - field_country

Entity Reference (Paragraph) - field_data (multi value)

Form Display Settings -
Title: Paragraph
Plural title: Paragraphs
Edit mode: Open
Add mode: Dropdown button
Form display mode: default

I want to show/display field_data only if particular country is selected in the list.
$form['field_data']['#states'] = [
      'visible' => [
        ['select[name="field_country"]' => ['value' => 6]]
      ],
    ];

This works, but when it renders the field, it is not showing paragraph button text.


texts: How do I provide multiple menu tabs for a view?

texts:
I have a view to select many articles with a specific taxonomy term with a path of
     Example.com/materials/%
where the % uses a contextual filter to pick the correct material. The filter works.

Each article can be further subcategorized to discuss various subjects regarding the material and is given a path such as
     Example.com/materials/%/general or Example.com/materials/%/standards

I thought I would be able to display a default view for  materials/%   and have menu tabs defined by variations of the view to display /general or /scope parts.

I cannot get any menu tabs to display with the view.

Please respond with any questions, suggestions or alternative approaches that have worked for you.

Thanks


texts: Is there a module that simply adds an 'add more' AJAX CCK field to a node form?

texts:
Drupal 7:

So I want to have this type of functionality:

The user needs to be able to add an unlimited, or up to a certain value of cck fields to the node edit form.

Basically, we want to create tutorials, and then add dynamic 'steps' via ajax. (because the amount of steps will always constantly change)

An example would be the poll module.


texts: unknown column in field list - after site reverted to the older version

texts:
I recently upgraded a site to Drupal 7 but decided to revert to Drupal 6.
Before I upgraded to Drupal 7 I did a database dump and back-up all files.
I've re-imported the database dump, deleted the Drupal 7 site and copied the Drupal 6 files back across.

Now I get the following errors

  Warning:  Unknown column 'headers' in 'field list'

  query: SELECT data, created, headers, expire, serialized FROM cache
  WHERE cid = 'variables'

( and many more like this) and the column does actually exist in the database.

It eventually dies with:

  Fatal error: Call to undefined function node_load() in
  /var/www/html/includes/menu.inc on line


texts: A module to watch active users and possible send them messages directly

texts:
As I develop an online store, I have debugging logs tracking site activity. the Ubercart based store has one department open, and 5 more under construction, so we have customers showing up and browsing. Every once in a while, like right now as a matter of fact, there is someone from an IP address (current one is internal to Bandai corporation in Japan) hitting every single product page on the site, and adding every product to their cart. I don't know what they are up to, but I'd like to show them a CAPTCHA.

Examining logs, about once a week some IP address from Japan, Korea, Russia, or China seems to comb the entire site. And I don't think these are search engines, because our products don't appear when I search for them in the various search engines. (We've not submitted the site yet, nor are any site maps for the search engines made yet.)

Does anyone know if there is a module that would allow me to watch the active users, and check their activity before presenting a CAPTCHA?


texts: How to redirect on node save to fill out extra fields attached to terms

texts:
I've added a mandatory email field to terms in a vocabulary I have called Instructor.  This field is displayed on my content type as an autocomplete term reference.  Because it is an autocomplete field, it will save new non-existing tags.  I am curious how I can redirect to a page on node  save (and subsequently term save) so that users can fill out the email fields?

Better yet, is it possible to limit autocomplete tags to existing terms, and then add a local action for "add a new instructor" where users have to fill out all fields?


texts: How do you theme an autocomplete dropdown

texts:
I'm trying to theme an autocomplete dropdown from a textfield. In this case the autocomplete is provided from the finder module.

I need to theme it beyond just simply adding css. Ideally I'd like a theme function to override or a template file but I can't find one.

I have tried using the theme function which is provided by the finder module, however all that does is theme the resulting page, not the autocomplete drop down.

Can anyone advise?


texts: Create a Ubercart Drupal site to sell memberships?

texts:
I want to create a website to sell licenses (not software licenses).
Basically, these licenses are sold in the form of packages for, say, package of 1 license or package of 2 licenses.
If a user comes to the site and buys a package with n number of licenses then n number of Drupal users will be created.

The created users can have different role types to allow different content to be accessible for different users.

Is it possible to achieve that with some Drupal 7 modules?

I did some research and found that it is possible to sell roles/subscriptions using the Ubercart module but I don't know how to create users that way -- with different roles after buying license package(s).


texts: How to set or change path to Drupal 8 contact form?

texts:
Drupal 8 provides two default contact forms: "Personal contact form" and "Website feedback."

While "Personal contact form" is added to each user's profile by default, to "Website feedback" Drupal automatically provides a link to this form from the footer. The path of this link is "contact" by default.
How can I change the path to this contact form, where are those paths generally set and configured?

And by the way, is it possible to change the labels?


texts: After installation of Drupal commons-7.x-3.13 in windows. I got this type of error?

texts:
I am using Drupal Commons-7.x-3.13 module to install in windows. After installation I can't logged my site.

Please help anybody. I am in critical situation.


texts: How to order Alpha Pager by custom field?

texts:
I'm working on a D6 installation and I am trying to correct an alpha pager.

If you visit vets-hall.org/stories/alphabetical you'll see I have a list of stories that have three custom fields: first_name, middle_name, last_name.

The default ordering for the view and the pager below the list goes off the last_name, that works fine.

However, if you click on one of the letters in the alpha pager above, say you click on 'M'... it orders it by the first_name field instead of the last.

I'm sure I'm missing some type of argument or something, any suggestions?


texts:
D7 has ImageAPI and that ImageMagick Module is also installed. However I want to use GraphicsMagick with D7 but haven't been successful till now. I have both ImageMagick and GraphicsMagick installed in my Ubuntu Box, I also have pecl imagick and pecl gmagick installed. I know both pecls doesn't work at the same time, but I have been changing configs whenever necessary.

I have tested both ImageMagick and GraphicsMagick from command line, both works perfectly, but I couldn't make it work with Drupal. According to ImageMagick Module I just need to change in Image Toolkit from convert to gm, Drupal reads the executable binary perfectly. I try to upload photo which doesn't show after processing and is also not uploaded in the file. But when I change it back to convert and pecl imagick everything works smoothly.

Any suggestions how to use GraphicsMagick with Drupal 7 ?

I even tried that this http://drupal.org/sandbox/W32/1077458 sandbox project, but no luck...


texts: How do I uninstall and remove Drupal Console from my project?

texts:
1 year ago, I installed the Drupal Console module on my site.
This module seems to be completely abandoned, so I'm asking my question here.
https://www.drupal.org/project/console
I had installed this module with Composer and in my composer.json file I have this line :
"drupal/console": "~1.0"

In drupal /admin/modules I don't see any module with the name Console. How to remove this module ? Is it normal that there is nothing in Drupal ?


texts: Render Twig Template instead of standard node fields

texts:
Right now my custom module creates a new content type. When an admin creates a node of that content type and save it they see the standard form elements displayed. However the custom module creates a controller/route: path: '/directory/{name}' and if the admin sets a URL alias on the node here is what happens:

if directory is prepended in the URL path before the URL alias
the controller is called, it finds the node via the alias
and makes a couple API calls based on the values in the node
And renders out a twig template with all the data is got from the API calls

What I want to happen is have the controller be called whenever a node of that content type is requested and my twig template to be rendered. So if a admin user created this content type and didn't set and alias, when they save and the browser directs them to /node/123 it will still call my controller and render my twig template. Or if an admin does set a URL alias, it will still call my controller and render my twig template.
Is there a way to complete this is Drupal?

Edit:
in my hook_theme I added:
      'node__campus_directory' => array(
        'base hook' => 'node',
      ),

And then I created a node--directory.html.twig file which is rendering. I now need some PHP function or to implement some hook where I can add some variables to be rendered in the twig template.


texts: How to use Rules to send an eMail containing a list of nodes with a selected value in a field?

texts:
I try to send a list of nodes with certain value in a specific field via the Rules module.

This is what I have so far:

Event: "After updating existing content of type MyContentType"
Conditions: "Parameter: Data to compare: [node:field-status], Data value: sendmail"
Actions:

"Parameter: Entity type: Node, Property: Status, Value: [node:field-status], Limit result count: 100
Provides variables: Fetched entity (entity_fetched)"
"Send HTML e-mail"

Here is an export of this rule:

{ "rules_send_node_list" : {
    "LABEL" : "Send node list",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "mimemail" ],
    "ON" : { "node_update--mycontenttype" : { "bundle" : "mycontenttype" } },
    "IF" : [ { "data_is" : { "data" : [ "node:field-status" ], "value" : "0" } } ],
    "DO" : [
      { "entity_query" : {
          "USING" : {
            "type" : "node",
            "property" : "field_status",
            "value" : [ "node:field-status" ],
            "limit" : "100"
          },
          "PROVIDE" : { "entity_fetched" : { "entity_fetched" : "Fetched entity" } }
        }
      },
      { "mimemail" : {
          "key" : "[node:title]",
          "to" : "to@example.com",
          "from_name" : "QX",
          "from_mail" : "from@example.com",
          "subject" : "Node flagged",
          "body" : "[entity-fetched:0]\r\n[entity-fetched:1]\r\n[entity-fetched:2]\r\n[entity-fetched:3]",
          "language" : [ "" ]
        }
      }
    ]
  }
}

The list with nodes with the field-status set to "sendmail" is indeed send out. The problem I'm facing here is that I have to put in the email body tokens like [entity-fetched:0], [entity-fetched:1],  etc.

In the section Replacement patterns for Fetched entity I only have [entity-fetched:0] till [entity-fetched:3] available. But I have more nodes than that. I would like to have the complete list with these flagged nodes.

Any suggestions about this?


texts: twig template suggestion for comment reply form

texts:
there is no template suggestion for a comment reply form in Drupal 8, how can i create one?
i am not talking about the reply form displayed in the node for which Drupal suggest a template :

field--node--comment--article.html.twig

I'am talking about the form in the redirection page after we click "reply" in a comment. there is no  template suggestion, only this template is suggested

form.html.twig

Can you please tell me how can i create a specific template in my .theme file of my theme.


texts:
I am trying to write a relationship handler for Views 3 in Drupal 7, but am failing even to begin.

Basically, I have a bunch of nodes of various types all with the same field attached to them. This field is a reference field linking off to a Civicrm contact - but that's not important, as essentially these fields just contain integers.

Now, let's say I have a node of content type 'story', and its reference field contains the integer, oh, let's say 55. In addition, there are nodes of content type 'news' which also contain the reference ID 55.

I want to build a block view, that sits on the story page, that reads in the node's nid as its argument, and then through a relationship it discovers all other nodes that contain the same reference integer as itself.

(In my head, the sql looks something like: SELECT n.nid FROM node n INNER JOIN node n2 ON n.reference = n2.reference [Assuming, for the sake of simplicity, the field data is kept in the node table]).

How do I create a Views handler that caters for this relationship? The only documentation I can find is the views api, which is for version 2 and not 3, and besides is utterly unhelpful. Reading various module's views handlers is not helping either, and views tutorials on the web are almost non-existent.


texts: Can a multi-site installation be set up with CPanel?

texts:
I know this is a weird question, but I'm in a weird situation - kind of a soap opera. I'm not using Drupal yet; I've been upgrading my website for months and am hoping to upgrade again to Drupal this summer.

Anyway, I've been wrestling with PHP, Apache ModRewrite and on and on. Today, I asked my webhost to enable PDO. As soon as they did, my websites crashed. No one could figure out the problem, so I asked them to disable PDO. That restored my websites - but my inter-site includes no longer work. My sites are essentially one big CMS, with satellite sites including files from the main site.

Anyway, a support tech stunned me when he told me you can't include files between CPanel accounts. (I have an account that allows me to host multiple domains on one account, each with its own CPanel.)

So, to finally get to the point: Does that mean that if I upgrade to Drupal this summer, I'm going to have to get a new webhost? I know Drupal allows multi-site installations, and I'm assuming there's some sort of communication between sites (e.g. including files between sites).

If I'm going to have to get a new host to use Drupal, maybe I should start looking now...


texts: Media/Images being deleted without warning?

texts:
Over the weekend at some point, my dev site lost 75% of the uploaded images. A lot are marked 0 in the database, and don't appear to exist on the physical file system anymore. I don't see anything in the log pertaining as to what or why, and nothing major was deployed on the previous Friday that could have caused this.

Since that point, I have set "Delete Orphaned files after" setting in Drupal core to "Never", because I could not think of anything else that may have caused this. All of the fields are media fields hooked up to Media Entity and Media Entity Image.

Has anyone experienced this behavior or know what may have happeend?


texts: How to show the values on the bars of a stacked bar graph in 3D?

texts:
I have created a Stacked Bar Graph (in 3D) using the Forena reports module, which looks like so:

I was able to successfully create this graph. But I am having problems in showing the corresponding values on the bars. The values I want to show on the graph are:

colombia_blue:0.75
colombia_red:0.25
LATAM_blue:0.57
LATAM_red:0.43

I searched for the frx attributes. I found attributes to change the color of these 2 graphs, but not the label.

Here is the relevant part of my report specification (frx file):


texts: Migrate fields with content from drupal 6 from different DB

texts:
Can't understand how migrate node fields from different DB (I mean migration to clear drupal 7 site). At first, I migrate fields by content migrate module but in this case db contain too much garbage. Tried to it by migrate module but didn't find how to do this.
Then I used migrate_d2d module, but it doesn't help at all.

Is there way to migrate fields and content without writing by hand each field migration?


texts:
I've created a custom module called renameprofile to alter the title on my user page, but it doesn't seem to be working. Any idea what is causing this issue? Btw this is on the ?q=user page.

renameprofile.module

<?php
function renameprofile_page_alter() {

  global $user;

  if(drupal_get_title() === isset($user->name)) {
    drupal_set_title('My Sharecab');
  }
}
?>

renameprofile.info

name = Rename user profile page title
description = This module renames the profile page title
core = 7.x


texts: How to display results tagged with just one term ID when there are multiple filters

texts:
I have a blog in Drupal 7 and used Views to display the fields.  I have 2 sets of tags displayed on the sidebar:

1) SHAPES

Triangle

Square

Rectangle

2) COLOR

Red

Blue

Green

I created the 2 groups of tags via Structure > Taxonomy > Vocabulary > Add Term

For the View, I created one View with two exposed filters (similar to what was done in this tutorial)

VIEW:

Path: '/blog/tag'

Filter Criteria:
    1) 'Content: Shape (exposed)'

        Exposed form in Block: 'Yes'

        Filter identifier: 'shape_id'

    2) 'Content: Color (exposed)'

        Exposed form in Block: 'Yes'

        Filter identifier: 'color_id'

Exposed form style: BEF

The exposed filters are set to the appropriate block region in Structure > Blocks.

If I click 'triangle', only blog posts tagged with 'triangle' should be displayed.  Then if I click 'red', only posts tagged with 'red' should be displayed.

It looks like the correct blog posts are being displayed when I click on the terms.  The URL gets appended with IDs from both vocabularies, but I can't seem to get the right combos to display.

Desired URL when 'triangle' is clicked: '/blog/tag/?shape_id=1&color_id=All'

Desired URL when 'red' is clicked: '/blog/tag/?shape_id=All&color_id=1'

So, essentially the results should display items tagged with just one term ID.

However, how it is currently working is that if I click 'triangle', and then 'red', both 'triangle' and 'red' have the 'selected' class (are both bolded) and the url is: '/blog/tag/?shape_id=1&color_id=1'

The only way I was able to get the desired URLs is if I have the '-Any-' option displayed.  However, the use case I have is to NOT have '-Any-' listed in the list of tags.

Is this even possible without '-Any-' listed in the list of terms?  I have never used multiple exposed filters before, so any guidance would be great as I've researched this for almost a week now. I read in another post that contextual filters would allow me to create separate path aliases that are clean urls, but I have not been successfully able to do this.

Any help would be greatly appreciated.  Thank you for your time.


texts: List taxonomy terms in node where the vocabulary is referenced

texts:
I have a taxonomy vocabulary called "Type of appendix". When adding a new node to the page, users can choose a type of appendix. When showing the node, it should list the all appendixes in a table with the category in the first column, the name in the second column and a link to the item in the last column. As shown in the image below

At the moment, my page displays the following:

I want to replace ICT manual with the table in the example.


texts: addClass in Twig with if statement in item-list.html.twig

texts:
I try conditionally add a CSS class to a
 element in item-list.html.twig.

{%- for item in items -%}

    {# check if is facet li #}
    {% if item.attributes.hasClass('facet-item') %}

{{ item.value }}

    {% endif %}

{%- endfor -%

When I add the if statement like above, I don't get any output at all. If I remove the if statement I get correct output like:

            <input type="checkbox" class="facets-checkbox" id="contactvoorkeur-email" data-facetsredir="/search-person/cards?f[0]=contactvoorkeur%3Aemail">
            E-mail (2)
            E-mail (2)

        <input type="checkbox" class="facets-checkbox" id="contactvoorkeur-post" data-facetsredir="/search-person/cards?f[0]=contactvoorkeur%3Apost">
        Post (1)
        Post (1)


texts: Why my hook_filter not work in Drupal 6?

texts:
I'm having a hard time trying to make my hook_filter work on Drupal 6.

Here's my filter function.

function arb_question_filter($op, $delta = 0, $format = -1, $text = '') {

  drupal_set_message($op);

  switch($op){

  case 'list':
    return array(t('My filter name here'));

  case 'description':
    return t('Description my filter here');

  case 'settings':
    break;

  case 'no cache':
    return false;

  case 'prepare':
    return $text;

  case 'process':
    return preg_replace("|\[support!\]|i", 'hello world', $text);

  default:
    return $text;
  }
}

I can see my filter name on the filter option below the content textarea, but when I add my testing for example " this is a test [support!]"

When I view the content, it just show [support!], which is suppose to show "hello world" according to my filter.

I did put a drupal_set_message($op) on my hook filter, but it seems to only show "list" not process or prepare or the rest of the $op.

What I'm doing wrong?

Welcome your advice


texts:
According to this description of hook_preprocess_views_view_field(), $variables contains, among other things, $variables['field'].

However, if I do print_r($variables['field']) just to inspect the object it prints the entire object (to include my username and password!) and even causes the browser to crash.

I am trying to figure out how to check the field name but it is proving to be strangely non-straightforward.

How can I properly index $variables?


texts:
Is it possible to auto calculate shipping for Drupal 7? Is there a way to automate with coupons integrated as well? e.g. Free Shipping coupon.

Currently, if someone were to input a free shipping coupon, these are the necessary steps.

Enter FREESHIPPING code
Apply to order
Update order
Calculate shipping
Select "Free Shipping" instead of "Paid Shipping"

I would like to exclude the last three steps as it's a pretty long process, and some customers might not know to click on Calculate Shipping after clicking Update order. They may think the coupon is broken. Anyway, applying a free shipping code is self explanatory. What I'm looking for is a way to automate the calculate shipping when users enter or change the delivery country  when Apply to Order is clicked on the coupon pane.

Do you have any thought?


texts:
I'm displaying jobs in my site but after expiry of last date of application of job, I want to archive it for a month or so and then delete it.

So after last date of application I don't want to be listed in me Menu block and Taxonomy blocks: http://bit.ly/WB59KX . As if the (optional/required) term reference field value has been removed.

In short if Accountant term has been selected in a field( named profession) then after last date of application, clicking Accountant term should not display this node.

I don't want to unpublish expired jobs though.

How can I achieve this?


texts: I want to create a new command for the nodes like the standard edit and delete

texts:
In drupal you have the standard commands edit and delete which you access typing :

node/99/edit
node/99/delete

I want to create some other commands like :

node/99/approve
node/99/test
...

Where do I hook to access the command and execute some code ?


texts: Availability Calendars - change amount of months shown to visitor

texts:
I need to make some changes to a website that is using the 'Availability Calendars' module(available on https://drupal.org/project/availability_calendars ).

On the website a calender is shown to the visiting person that highlights any available date for 2014. I now need to have the months for 2015 to show up in the calender too.

But I can't find the option to make 2015 visible for the visitors. Using google I found this: http://drupalcode.org/project/availability_calendars.git/blob/273d12c0ad811341615197a8601797f3003f52e9:/README.txt

It says "Choose the global settings for the availability calendars under Administer -> Site configuration -> Availability calendars. You can choose how many months will be shown for each node and whether or not to display the calendars on the node page itself".

But when I go to "nl/admin/config/content/availability-calendar" I only can set the 'labels' and add a css-class to those labels. There is a link to "nl/admin/config/content/availability-calendar/styling" but that only has options to set the font-weight,color, font-size, etc...

I then went to look in the content types ( under 'Structure --> content types') but the option isn't showing up there either.

So the problem is I need to change the amount of months shown to the user (who is not logged it) on the front-end of the site for 2014 and 2015. But I can't find any option to change the amount of months shown. Can anyone point me in the correct direction? Or do I need a different module to do this? If so what module would I need for this?


texts: How to include a views page (or an URLs rendered HTML) into Search API index?

texts:
How can I include a views page into my Solr Search API index? When configuring the index, I can select all kinds of content entities, but views pages are config entities.
In my project, I've got one "global" views page based on an index accross all node types and several views pages dedicated to one single node bundle, e.g. an "Events list" views page showing all upcoming events, and a "Restaurant list" views page showing restaurant node types. This works fine for specific/granular keywords showing exact node results.
The problem/task is, when somebody searches for an unspecific/generic keyword like "restaurant" in the global index, the "Restaurant list" views page should show up as search result too (based upon the rendered HMTL output of the views page, which has a lot of "restaurant" in it).
Even though that "restaurant list" doesn't offer additional content, it does offer a different UI (different facets), which makes the restaurant views page a meaningful result for the global search.
I also don't need any views gimmicks or field specific boosts, it would be good enough (or even better) if I could just add an internal URLs rendered HTML output to the existing global index.


texts: Reference Live Files with Built-In Server

texts:
I use the built in php server most often when developing locally.

drupal server

Is there any tweak I could make locally to have all my assets referenced on the live site? When I ran apache locally I use to put this in the vhost file.

<IfModule mod_rewrite.c>
  RewriteEngine on
  rewriteCond %{DOCUMENT_ROOT}/sites/%1/files/%2 -f
  rewriteRule ^(.*)$ $1 [QSA,L]
  # Otherwise, send anything else that's in the files directory to the
  # production server.
  rewriteCond %{REQUEST_URI} ^/sites/[^\/]*/files/.*$
  rewriteCond %{REQUEST_URI} !^/sites/[^\/]*/files/css/.*$
  rewriteCond %{REQUEST_URI} !^/sites/[^\/]*/files/js/.*$
  rewriteCond %{REQUEST_FILENAME} !-f
  rewriteCond %{REQUEST_FILENAME} !-d
  rewriteRule ^(.*)$ http://www.livesite.com$1 [QSA,L]
</IfModule>

But now that I'm using the built in server, I can't do that. I was wondering if there may be another way? Preferably without a module that would affect my Drupal site. I just want this as a local modification.


texts:
I currently have a test Drupal site where I am testing the different modules and Views, display settings, etc that I would like to eventually use on my live site. But I am adding data to the test site as well, data that will also end up on the live site.

Because I am installing and uninstalling modules, would it be better to start the live site from scratch or can I safely move the test site to the live site without worrying about orphan code/settings slowing down or otherwise adversely affecting the live site?


texts: add link programmatically to views field Drupal 7

texts:
I am generating views result using ldap query and eliminating some result by checking it against Drupal node title using hook_views_pre_render() and looping through views result.

I want to add link to this ldap views using Drupal node id.

Tried adding in the same pre_render function using drupal l() function. But it displays full html i.e

    title

instead of html.

Can anyone help resolving this issue?

Thanks...


texts:
I am using Views 3 on Drupal 7.

I have a node with multiple terms, and I want to get nodes with all own tids at once.

I configure the contextual filter using the following values:

Specify validation criteria:

taxonomy term
my vocabulary
Term IDs separated by , or +

Checkbox "Allow multiple values" is on.

I try to pass '1,2' as argument to the view, and I get:

  node 1 (tid 1)
  node 1 (tid 1, 2)
  node 2 (tid 2)
  node 3 (tid 2)

By the way, the '1+2' argument gives me the same thing, and it's all right.

Why can't I get a result like the following?

  node 1 (tid 1, 2)

Do you have any suggestions?


texts: How do I use Font Awesome on a form submission button?

texts:
So I've got Font Awesome working on my Drupal 7 site. I'm not using the Font Awesome Drupal module. I'm just declaring the style sheet in the template.php.

function genchstyle_preprocess_html(&$variables) {
  drupal_add_css(
    'http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css',
    array('type' => 'external')
  );
}

Now, if I use <i class="icon-search"></i>, I get a nice little magnifying glass icon.

I've recently learned how to replace a form's Submit button with an image like this.

function genchstyle_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'search_block_form') {
    $form['actions']['submit']['#type'] = 'image_button';
    $form['actions']['submit']['#src'] = drupal_get_path('theme', 'genchstyle') . 'images/search.png';
    $form['actions']['submit']['#attributes']['class'][] = 'icon-search';
  }
}

I can't figure out how to replace the submit button with the Font Awesome icon. I tried adapting the above script to use $form['actions']['submit']['#markup'] and I can get it to replace the button with the icon, but then the icon is no longer a functioning submission trigger (or even a link).

I've reviewed all the Font Awesome examples and googled the heck out of this but I can't find a solution.

Any suggestions?


texts:
The subject says it all. I am attempting to install H5P SCORM libraries in an install of Drupal 7.59 and running into a roadblock: None of what I am reading—or understanding—is clear about how to install the libraries. I am attempting this on macOS High Sierra under MAMP 4.5 (PHP 7.1.12) and MAMP 3.5.2 (PHP 5.6.10). Apache permissions are fine as far as I can see, FWIW and other temp files and uploads work fine on this setup.

I have installed the following two modules in Drupal:

H5P: The core H5P module.
H5P SCORM/xAPI: The H5P SCORM API.

And on the module’s install page I have activated all three modules connected to them:

H5P (7.x-1.35)
H5P Editor (7.x-1.35)
H5P SCORM (7.x-2.4)

But when I go to install the libraries… I just can’t seem to get them to upload without some error happening such as a problem expanding the archive into the temp/ directory and such. The weird thing is temp direcroures are clearly created, but there is no content in them.

I have even followed the “Better Install Instructions” that appear here as a contributed “issue” but with no luck.

The libraries in question are as follows:

H5PEditor SCORM
H5P SCORM/xAPI

Do the decompressed files need to have a directory name such as H5PEditor.ScormFile.h5p or H5P.Scorm.h5p? Because if I simply rename the files, the created directory is still h5p-editor-scorm-master and h5p-scorm-master.

The tangential question is… Is there simply a way I can just physically place files in the correct directory structure user libraries/? Or must it be installed via the administration interface? It seems to me if I could just drop those files in, Drupal—and the H5P modules—should be able to see them, right?


texts: I get this error with my custom module, Any advice on tracking down the problem?

texts:
I get this error when i select an option form a select list.

http://i.stack.imgur.com/ACmDg.png

Drupal Watchdog log Error Details

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'examplesite.field_data_field_for_date' doesn't exist: SELECT r.entity_id AS entity_id FROM {field_data_field_for_date} r WHERE (field_for_date_target_id = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 0 ) in stopsale_getcurrentsale() (line 249 of /nfs/c05/h02/mnt/examplesite.com/html/sites/all/modules/custom_apps/stopsale/stopsale.module).

http://i.stack.imgur.com/ACmDg.png


texts: What is the fastest way to get node title from nid?

texts: Say I have an nid (or a lot of them). Would it be faster to load the node to access get the title, or do the very simple db_query required to get the node title?


texts:
hook_nodeapi() only has four arguments, but the function taxonomy_nodeapi($node, $op, $arg = 0) can have an additional parameter, $arg=0. Why?
$node is not passed by reference. Why?


texts: I'd like to alter Views arguments which is currently Term name. Is there any way to use term name slug instead of complete Term name and use this slug as views argument? If not what hook should I use to convert these parameters from URL (as taxonomy term slug) to full name Taxonomy term which can be used as views argument. I tried to use hook_views_query_alter and hook_views_pre_view, but it's too late for any changes.


texts: Drupal 7: Customizing the display of a view

texts:
I'm using the latest version of Drupal (7.8). I am using Views to list out all articles with a certain tag in a block. I'm showing the latest 5 articles. No problems so far.

Now I want to customize the display so that the latest article displays with the title as well as the featured image whereas the other 4 articles show up with the title only.

I'm trying to use the suggested templates feature but am not sure how to use it since the HTML comes pre-created in the $rows variable.

Sort of like this:


texts:
In a content node, I wanted to wrap a div around some results.
For example:
I have this inputs:

Image
Title
Body
Address
Email
Name

And I wanted to have divs like this:
DIV
Image
Title
/DIV
DIV
body
Adress
Email
/DIV
DIV
Name
/DIV

Is this in any way possible?


texts: Display result counts on Views exposed filters with Ajax

texts:
I don't ask a lot of questions here. Actually this is my first one here, so if anything is wrong I apologise.

I'm working with Drupal 7, Views and Better exposed filters.

I created a view with multiple exposed filters based on taxonomy terms.
I also have a hook: form_views_exposed_form_alter that that adds the number of results to the taxonomy labels.

foreach ($form['#info'] as $filters => $filter) {
$filter_val = $filter['value'];
$db_table = "field_data_" . str_replace("_tid", "", $filter_val);
foreach ($form[$filter_val]['#options'] as $tid => &$value) {
    if ($tid != "All") {
        $query = db_select($db_table, 'f')
          ->condition('f.'.$filter_val, $tid)
          ->condition('f.bundle', $type);
    } else {
        $query = db_select("node", "f")
            ->condition('f.type', $type);
    }

    $query->addExpression('COUNT(*)');
    $count = $query->execute()->fetchField();
    $value .= ' (' . $count . ')';
}

}

Now When I select an option Ajax is used to update the view. But I want to update the result counts aswel.

I tried to add an #ajax callback to the form['apply'] in my form_views_exposed_form_alter function but that doesn't seem to do anything. I tried to echo/print in the callback function but nothing happens, not even an error.

$form['apply']["#ajax"] = array(
    'callback' => '_exposed_form_callback',
    'wrapper' => $form["#build_id"]
);

function _exposed_form_callback(&$form, &$form_state)
{
 ...
}

How can I do this?


texts: Installling fails with no error messages

texts:
I installed Drupal 7 on linuxMint 17.1 localhost using the install wizard. Submitting the database configuration page leads to a white screen and nothing else happens.

Looking at the database I could see some data though.

Can anyone help me to fix it?


texts: How can I get the tid (term id) using the id of my node in .theme

texts:
I need to get the id of the node category.

I try this:

$variables['tid'] = $node->field_category->target_id;


texts: Taxonomy terms language depending - why all languages are visible?

texts:
What I want to acheive:
I have multilingual site (i18n module).

I have vocabulary named "brands" - terms of vocabulary don't need to be translated because they are the same in all languages.

I've also nodes that I can assign to languages and "brands".

In taxonomy - in multilingual options - I set this vocabulary to: Localize. Terms are common for all languages, but their name and description may be localized.

Now - the problem is - that when I enter from menu to "brands" and e.g. "volvo" in any language - all nodes (all translations in different languages) are shown.

I'd like to see only the nodes in language that is set.

I have other vocabulary - where terms should be translated also. I have set it to Translate. Different terms will be allowed for each language and they can be translated. and there everything works fine - depending on language.

How to acheive that with my first vocabulary?

Thank you for any suggestions.


texts: Import data with feeds that is not in the source file

texts:
I need support to set a field on a feeds mapping that is not in the source.

I already have some code that for some reason is not working.

If I use hook_feeds_after_parse, I can set the value but I need to use the method below (new mapping).

function  MYMODULE_cronapi($op, $job = NULL) {
    $items['TEST IMPORT'] = array(
        'description' => 'TEST IMPORT',
        'rule' => '1 * 1 * *',
        'callback' => ' MYMODULE_testImport',
    );

    return $items;
}

function MYMODULE_testImport() {
    $test_field_value = 'this is a test';
    $feeds_importer = 'test_feeds';
    $feeds_source = feeds_source($feeds_importer);
    $field_mappings = $feeds_source->importer->processor->getMappings();

    $path_to_xml = 'http://.../sites/default/files/test_content.xml';

    foreach ($field_mappings as &$mapping) {
        if ($mapping['target'] == 'field_test_field') {
            $mapping['test_field'] = $test_field_value;
        }
    }

    $feeds_source->importer->processor->addConfig(array('mappings' => $field_mappings));

    drupal_static_reset('FeedsProcessor::getMappings');

    $feeds_config = $feeds_source->getConfigFor($feeds_source->importer->fetcher);

    $feeds_config['source'] = $path_to_xml;

    $config = array(
        'process_in_background' => TRUE,
    );

    $feeds_source->setConfigFor($feeds_source->importer->fetcher, $feeds_config);
    $feeds_source->importer->addConfig($config);
    $feeds_source->save();
    $feeds_source->startImport();

    while (FEEDS_BATCH_COMPLETE != $feeds_source->import());
}

function MYMODULE_feeds_processor_targets_alter(array &$targets, $entity_type, $bundle) {
  if ($entity_type == 'node' && $bundle == 'test_content') {
    if (isset($targets['field_test_field'])) {
      $targets['field_test_field']['callback'] = 'MYMODULE_set_test_field';
    }
  }
}

function MYMODULE_set_test_field(FeedsSource $source, $entity, $target, array $values, array $mapping) {
    if ($source->importer->id == 'test_feeds') {
        if (!empty($mapping['test_field'])) {
            $entity->{$target}[$entity->language][0]['value'] = $mapping['test_field'];
        }
    }
}


texts: How to override custom block methods in drupal 8

texts: i have created a block with all its methods like blockAccess()... i would like to override one of those in other module, in my project i have used page manager, then i cant call hook_block_access()..because blocks added with page manager doesnt get into this hook.


texts: Can composer-dependent PHP libraries be used with the Libraries API?

texts:
I'm trying to include a PHP library called Geocod.io in my custom module. I am also trying to use the Libraries API. So far I have:

Downloaded geocod.io to sites/all/libraries
composer install'ed in sites/all/libraries/geocodio
Started creating a hook_libraries_info() function with the following contents:

return array(
  'geocodio' => array(
    'name' => 'Geocod.io',
    'vendor url' => 'http://geocod.io',
    'download url' => 'https://github.com/davidstanley01/geocodio-php',
    'version arguments' => array(),
    'files' => array(
      'php' => array('geocodio/vendor/autoload.php'),
    ),
  ),
);

I have no idea what to put for 'files', is the path the the autoloader the right thing to do? Are these two ways of including things even compatible? I'm a bit stumped as to what to do next, I want to use the geocod.io library and I want to do it the most correct way. Other questions that mention these issues don't seem to include anything about how to list the files/versions.


texts: how to include main navigation twice with different display

texts:
i started working with drupal 8 few days ago.
I am working on theming with Twig.
I included the main Navigation on the header, after the activation of twig debug mode , i followed the suggestion of twig and i created menu-main.html.twig contains the html respresentation of the links and i had this display:

My Problem is :
I included the Main navigation on the footer too but it appears the same way as the header but i want to change the display to be like this:

What should i do ?


texts: How to convert image URLs in Drupal node's fields while rendering?

texts:
I have developed a new CCK module using Plupload where users can drag and upload images using native HTML5 apis. Since, I do not know how to drag images directly inside CKEditor, what I am doing is that after images are uploaded using plupload's jQuery widget, I show an image instead of a filename from where users can drag that image inside a CKEditor. Its a 2-step drag-n-drop process.

Now, when I drag & drop images into a CKEditor using Chrome, CKEditor generates following code

When I do similar action using Firefox/Safari, CKEditor generates following code

Problem is depending on from where I am viewing the node (views, panel etc), images sometimes shows up and sometime not, because they point to location starting with ../../ and not with http://myportal/.

So, how do I make sure that when Drupal is generating node's view, "../../sites/myportal/files/plupload/p15sjle1js11r5289aibk0m1n7q3.jpg" is expanded or converted to "http://myportal/sites/myportal/files/plupload/p15sjkcj2c1o3koe3hsp19761ep14.jpg"

One way I  can do this is using jQuery to find all  tags with a word 'plupload' in their src attribute , and then changing that attribute with full URL. But, it will slow down display a lot. Any other ideas using Drupal module or custom coding?


texts: Field value not coming in template.php for published node

texts:
I am trying below code to get node field value into template.php.

$field_items = field_get_items('node', $node, 'field_read_more_title');
$variables['readmoretitle'] = $field_items[0]['value'];

But $variables['readmoretitle'] is empty for published node, for unpublished node I am getting correct value.

How can I get the published node field value in template.php?


texts: How to add custom css file to subtheme of omega kickstart theme?

texts:
I have created a subtheme of "omega kickstart theme" and I want to add some custom css files to it. I searched and got some solution(which didn't worked for me), the solution is as follows:

create your custom css file and place it in css folder of your subtheme.
edit your subtheme.info file(edit under optional css code of info file) as follows:

css[yourthemename.css][name] = 'Your custom products styles'
css[yourthemename.css][description] = 'This file holds all the product page CSS of your theme.'
css[yourthemename.css][options][weight] = '12'

The other Solutions were as follows:

Specify your custom css path file in info file as

stylesheets[all][] = mycustomcss.css

Make use of "drupal_add_css" function in template.php as follows

function MYTHEMENAME_preprocess_node(&$variables) {
  if ($variables['view_mode'] == 'full') {
    $path = drupal_get_path('theme', 'MYTHEMENAME');
    drupal_add_css($path . 'MY-THEME-PATH');//PUT UR CSS FILE PATH
  }
}

I tried this function twice with two different paths. First I gave path as '/css/mycustomcss.css' and second time I gave path as '/MYTHEMENAME/css/mycustom.css'.

UNFORTUNATELY NONE of these solutions worked for me. Am I missing something or is it something else?...please help.


texts: paragraph template suggestion based on parent content type

texts:
I have two content type using same paragraph as field , though template code will be according to content type. How can i can have different template names for paragraph template depending on content type.

Current naming convention: paragraph--paragraph-type.html.twig

Desired naming convention: paragraph--parent-content-type--paragraph-type.html.twig

Another solution will be get the url and pass it as variable in template and use template code according to url passed.


texts: Ubercart attribute changes price without page reload on Drupal 7

texts:
Running Drupal 7, and the latest stable UB. Currently, each product's price is set to $0. We have attributes that get selected and that is what determines a product final price. When a user selects the attribute. We want it to automatically change the product price without a page reload or needing to add it to the cart. How can I accomplish this?

Update: This is the latest patch that was mentioned here. I have patched my code as follows. I attached a pastebin of the patched code for review in case I missed something. Also if anyone wants post-patch code prior to it getting released to dev.

http://pastebin.com/FnKCrYGk - uc_attribute.module
http://pastebin.com/f2GN5Ms9 - uc_order.order_pane.inc
http://pastebin.com/1AURsfML - uc_product.admin.inc
http://pastebin.com/i5JF3dif - uc_product.module
http://pastebin.com/7VnGKQap - uc_product_kit.module

Some people report that the patch works. I unfortunately haven't been able to get it to work. The blue spinning ajax icon shows like its doing something but my display price doesn't change.

UPDATE FIX!: This thread details the answer to this question.


texts: Add content to a render array in a content type from my custom module

texts:
I created a content type that is used to display a list of videos hosted on brightcove. I have a module that is setting a cookie for the anonymous user when they watch one. My end goal is to display a viewed/unviewed icon for the user on the list.

I have all the data I need in the cookie. I just need to create a module that reads the cookie data and edits the render array for the content type. The issue is I am not sure how to add new values to that content type's render array. Is there a hook I can use to get access to the specific content type to add a key/value for viewed/unviewed? This is for drupal 7.

Thanks for the help.


texts: Where are the primary and secondary tab blocks?

texts: I installed drupal 8 using the minimal install profile. For the admin pages I enabled the seven admin theme, but in the blocks admin screen I cannot find the Primary tabs and Secondary tabs blocks.


texts: How to detect if form-building function is called for the first time?

texts:
In my form building function I need to render some things basing on user's actions. But if the form building function is called for the very first time I want to put a form deliberately in slightly inconsistent state (I have my reasons, long story).

How can I reliably detect if the form building function was called for the first time, or if the form was already presented to the user and now it's built due to AJAX call or to allow user to fix input errors?

Currently I'm using empty($form_state['input']) but I have this feeling there is a better, more reliable way and I forgot it.


texts:
Someone created a module for this called uc_clear roles so you can stop what's happening to me now which is when a new role is purchased it is just added to the old one.
But this module is only for Drupal 6 and I am using 7.

Logintoboggan preauthorize role if the user neglects to verify it and then buys a role, the new role will replace it but if verified and user makes purchase for upgrade they end up with both free membership status as well as paid. I don't yet know how to write php or create a module but, could the RULES module do the job?


texts: Filter a view by a field on a referenced entity

texts:
Sorry to be yet another question about entry reference relationships in views, but I can't find the answer in pre-existing questions.

Given:

the content type "page" has an entity reference field "artref" that references multiple nodes of the content type "article"
the content type "article" has a boolean field "fishy"

How do I create a view that shows all pages which reference at least one article where fishy is checked.

I understand that here are 4 relevant settings:

the basic entity bundle (pages or articles) selected for the view
the relationship type ("content referenced from" or "content using")
"require this relationship" setting
Aggregation, especially if "distinct" is a possibility

All advice much appreciated


texts: How to move drupal 7 site in a different path from Home directory

texts: what is the way to move drupal 7 site in a different path from Home directory. Currently my website is based on d7, so how i should move drupal 7 site to www.example.com/a/ instead of www.example.com


texts: How to create a single image style for both landscape and portrait images?

texts:
In a Drupal 7 environment, I want to apply a style to all images within a view. I want every image to be 180px wide & 128px high -OR- 128px wide and 180px high depending on the orientation of the original image.

Can this be done with an image style or do you know any module that would help in achieving this?


texts: Can one feature module make additions to another feature module?

texts: I would like to have two feature modules for users to enable. One basic and one advanced. For example, the basic feature creates a blog content type, with only title and body fields. The advanced module, once enabled adds additional fields to that original content type, such as tagging or imagefield. Is this possible or will one override the other? Or will my site blow up? or?


texts: Display related content in view by entity reference in views drupal 7

texts:
I want to show related content title in block view by entity reference. I have created two content type 1)Hotel Type  2)Room Type. Room Type have field_hotel which references to Hotel Type.
How cant I show content title of Room Type in block except current node.

for eg. RoomA, RoomB, RoomC are belongs to HotelX. I want show link of RoomB and RoomC on page RoomA


texts:
I have install Form Builder module and Webform module.

Webform module: Create form feature

Form Builder: Integrate into webform for more friendly user by click and drag

Recently I realize form builder is a annoying module.
Here are the problem cause by form builder:

  1) Problem: Unable to multiple select list.

  Solution: Webform module has a checkbox for multiple select. Just
  check will do. Unfortunately, does not appear in form builder.

  2) Install Webform Hints module(Placeholder feature): Does not appear
  in form builder.

As you can see without form builder, I realize all this features can be done by webform itself.

Now I uninstall form builder and face another stupid problem cause by form builder. Form component link is not working. Cant edit form unless I install back form builder module.
See the picture below. I super regret to install such a useless module.

What should I do?


texts: Migrate Drupal7 to local, user login link redirect to live, how to redirect it to local?

texts:
I have changed cookies name and base URL for my local environment, I have also emptied all cache tables, but still it redirects to the live site.

Like http://server1/mysitename/user to https://www.mysitename/user


texts:
I'm adding Drupal's built in Autocomplete functionality using hook_form_alter to set the #autocomplete_path like so:

function mymodule_form_alter(&$form, &$form_state, $form_id) {
  ...
  $form['field_company']['und'][0]['value']['#autocomplete_path'] = 'autocomplete/company';
  ...
}

This works perfectly for a text field where the number of values is 1, but doesn't work when the number of values is unlimited. I'm assuming this has something to do with the field be added via Javascript. Is there another hook I can tap in to in order to add the #autocomplete_path?

EDIT : Drupal 6.


texts: How to limit access to certain nodes to certain users only?

texts:
I am considering Drupal for a project with following features:

I need two content types: Supplier and Client.
I want my clients to be able to follow the progress of their orders (each order will be a node).
My suppliers will have access to their invoices, documents, etc. (which are nodes as well)

Any ideas on how to achieve this?

Example:

Client Alpha will have access to node/34 and node/46 only.
Supplier Beta will have access to node/38 and node/50 and their attached files only.
And so on ...

Is this possible with Drupal (6, 7) ? If so how can I do this, do I need custom coding or are there any other solutions for it?


texts: What is the basic use of the breakpoints.yml file?

texts:
What's the purpose of breakpoints defined in `breakpoints.yml?

Why are the media queries defined in breakpoints.yml, and not in CSS files?


texts:
I have a template for my field: field--field-category.html.twig. Is there a way to override this for a specific Display Mode? A have a mode called teaser block. I tried field--teaser-block--field-category.html.twig as well as a couple of other formats.

I know I can modify how the field is output in node--teaser-block.html.twig but I'd like to do it at the field template level.


texts: How to create a page showing only articles in a certain language?

texts:
I have several articles on my website in different languages. I would like to create a page on which only the articles in a certain language are displayed based on the url.

Only show articles in english when user is on www.website.com/en/blog
Only show articles in french when user is on www.website.com/fr/blog

How can I do that? I have Internationalization, Entity and Views.

My language detection/selection settings are, in the order:

URL (path prefix)
Default
User

I have two languages: english (default) and french.

All my articles have the vocabulary "Blog (taxonomy) > story (term)"

The only thing is, I'm not very good at using Views so I would need a really "step by step" explanation, because it is not really intuitive to me.

Many thanks for your help!


texts: How to make a taxonomy vocabulary overview page with Drupal 7

texts:
I have a simple vocabulary named knowlegde with several terms. This vocabulary is localized and can be used in many languages. My question now is how can i make a simple page where i can display all content tagged with that vocabulary. The important thing is that the (localized ) vocabulary is part of the url.

For example in german the url should look like

http://example.org/wissen

and in english it should look like

http://example.org/knowledge


texts:
The form has two radio buttons like follows.The "design" radio field should be visible only when user selects 'Ten' or 'hundred' from the "price" field.

If user choose 'other' it should not be visible.

I tried like follows, it's working but by default the 'design' field is come with visible state.

//$options array is dynamic.
$options =  array(10 => 'Ten', 100 => 'hundred', 'other' => 'Other');

  $form['price'] = array(
    '#type' => 'radios',
    '#title' => t('Price?'),
    '#options' => $options,
    );
  $form['design'] = array(
   '#type' => 'radios',
   '#title' => t('Designs'),
    '#options' => $designs,
   );
  $form['design']['#states'] = array(
    'visible' => array(
        array(':input[name="price"]' => array('!value' => 'other')),
    ),
  );

I've tried several ways like follows with no luck.

array(':input[name="price"]' => array('!value' => '')),
array(':input[name="price"]' => array('checked' => TRUE)),

Is there any option like to check the selected value is numeric or not? like

array(':input[name="price"]' => array('value' => isNumeric)),

or the other option would loop through the dynamic option values?

      array(':input[name="category"]' => array('value' => 10)),
      'or',
      array(':input[name="category"]' => array('value' => 100)),
      'or',
        .
        .
        etc

Any suggestions or input would be much appreciated.


texts: How do I prevent anonymous users from modifying and deleting their submissions after a webform closes?

texts:
I'm using Drupal 8.9.6 and Webform 5.20
Background
I have an event that lasts 7 days and I've created a registration webform (using Webform Nodes) for each day.  Each webform gives anonymous users the permission to create, view, edit and delete their own submissions.  These permissions are set on a per-webform basis and not globally.  They are scheduled to open and close at given dates/times (the dates/times are set on the webform node edit form).
Problem
Anonymous users are able to edit and delete their submissions after the webform has closed.
Is this the expected behavior?  If so, how can I prevent this?


texts: Create a footer menu from primary links and should be able to control what should appear

texts: I have a menu at the top on hover it expands. I want a menu at bottom of page with same links, but i may choose what should appear here. Is there any module available for it.


texts: Programmatically accessing block content

texts:
Could anyone tell me how to programmatically access the field content of a custom block?

Thus far I've managed:

use Drupal\block\Entity\Block;
$block = Block::load($block_name);

if ($block) {
  $render = \Drupal::entityTypeManager()
    ->getViewBuilder('block')
    ->view($block);
}

However this doesn't give me access to the fields and their data.


texts: How to Skip the Workflow Launch by admin/user in Drupal-Commons using Maestro Module?

texts:
I have installed and configure the "Maestro" Module in Drupal Commons.

In Maestro Module every time we should Load the Workflow and it will go through step by step:

Admin: Publishing Workflow Load
User1: Assigend to add new Content
User2: Review Content
User3: Publish Content

How can I remove first step? When user creates new content, it should automatically go for review.

My Workflow

Using the rules module Can I define any rule when New Content is created means click on "Add Content" Workflow automatic Load....


texts: User registration form validate and submit hooks not called

texts:
I try to add custom validation or submit function to the user registration form, but nothing works.

Here is the code in /sites/all/themes/mytheme/template.php:

function mytheme_user_register_form_validate (&$form, &$form_state) {}
function mytheme_form_user_register_form_validate (&$form, &$form_state) {}
function mytheme_user_register_validate (&$form, &$form_state) {}
function mytheme_user_register_form_submit (&$form, &$form_state) {}
function mytheme_profile_user_form_validate (&$form, &$form_state) {}

I also put similar code to /sites/all/modules/custom/mymodule/mymodule.module:

function mymodule_user_register_form_validate (&$form, &$form_state) {}
function mymodule_form_user_register_form_validate (&$form, &$form_state) {}
function mymodule_user_register_validate (&$form, &$form_state) {}
function mymodule_user_register_form_submit (&$form, &$form_state) {}
function mymodule_profile_user_form_validate (&$form, &$form_state) {}

None of the above functions are called and I have ran out of ideas.
As a proof that something works on this form, here is something that does work:

function mytheme_form_user_register_form_alter(&$form, &$form_state, $form_id) {}

This gets called!! But I need to validate...

By the way, the debugger shows (among other) this when debugging the hook_form_alter:

$form['#validate'][0] = 'user_account_form_validate'
$form['#validate'][1] = 'user_validate_picture'
$form['#validate'][2] = 'user_register_validate'
$form['#validate'][3] = 'profile_user_form_validate'


texts:
I created a webform component and set the display to be "Disabled". the problem is that this option only add the "readonly" attribute to that textfield. If I remove that with firebug, the field becomes editable and the value can be changed. I don't want that. Any ideas on how I can achieve this?

In a hook_form_alter I tried

$form["submitted"]["field_name"]["#type"] = "value";

and

$form["#node"]->webform["components"][20]["type"] = "value";

but none of this works. Neither does $form["#after_build"][] = "afterbuild_function";

Thanks


texts: Add new field to content type programmatically

texts:
I created a content type in Drupal programmatically with the following code:

function reservation_system_node_info() {
  $items['add_item'] = array(
    'name' => t('Add a new item'),
    'type' => 'add_item',
    'base' => 'node_content',
    'has_title' => '1',
    'title_label' => t('Name'),
    'help' => t('Please fill in all fields.'),
  );
}

Now I want to add some fields into this content type, but with no luck. I hope someone can help me with this. I tried to use the system_create_instance() function from Drupal. The code I used:

function reservation_system_create_instance() {
  $instance = array(
    'field_name' => 'price_item',
    'label' => 'Price',
    'entity_type' => 'node',
    'bundle' => 'add_item',
  );

field_create_instance($instance);
}

Should I use an another function to create fields in a content type or do I mis something?


texts:
i want to match in a route a 'random' URL with a random sub path, fox example:

/example/1/a/b/c
/example/c3/s
...

i implement this route in my .routing.yml file

modulo.validator:
  path: '/example/{path}'
  defaults:
    _controller: '\Drupal\modulo\Controller\Controller::check'
  requirements:
    _permission: 'TRUE'
    path: '.+'

I write it following Symfony2 standard but it doesn't works, seems Drupal override requirements in path.

Take look to system.routing.yml

system.private_file_download:
  path: '/system/files/{filepath}'
  defaults:
    _controller: 'Drupal\system\FileDownloadController::download'
  requirements:
    # Permissive regex to allow slashes in filepath see
    # http://symfony.com/doc/current/cookbook/routing/slash_in_parameter.html
    filepath: .+
    _access: 'TRUE'

why this doesn't work for me?

Any suggestion?


texts:
I have created a custom widget that I would like to add some validation to. Specifically, if the widget is marked as required, to check that it actually has a value entered. I figure this should be pretty straight forward but Googling isn't returning any results that I am looking for. Probably using the wrong search terms. If someone can provide a link on how to do this or provide some hints that would be great!

Thanks.


texts: How can I display more than 5 nodes on a taxonomy view for one vocabulary?

texts:
I have a web site where videos are posted and each video is a part of a series. The series name is a taxonomy term in a vocabulary. Many of the series have more than 5 parts and I cannot figure out how to have the taxonomy view page for these to either add a "more" link, use a pager, or display all nodes referenced by the particular taxonomy term within that vocabulary.

You can see an example of this at http://www.clctc.org/discussion-series/desperation

There are 6 nodes tagged with the "Desperation" term from the "Discussion Series" vocabulary. The page only shows 5 and there is no pager or more link.

Thanks for any help you can provide.


texts:
I've seen that it was possible to store custom meta data in Drupal 7 but I didn't find the equivalent for Drupal 8 ?

https://martsie.github.io/2015/03/04/drupal-how-to-use-user-data/

The data that I need to store is temporary user data that might differ from each users and it's not needed to put it as field (no sql query needed).


texts: How to create and view a clickable list of information on a user profile?

texts: I am basically trying to replicate the attachment in Drupal. Ideally the user will click a user and have a Financial tab which they can add invoices/notes to. This would need to be a collection of fields (field collection?).


texts: Creating a directory for a vocabulary term?

texts:
Background:

I've opened a new vocabulary named "bc" (an acronym for "Blog categories).

The problem:

Anytime I go to the webpage of each term of this vocabulary, the url is sitename.com/term. INSTEAD OF sitename.com/bc/term

This is because when I first built the site, I disabled the option (somehow, it was a long time ago) to create folders for vocabularies.

What I need is to add a folder only to that vocabulary, i.e a way to make terms of this vocabulary to appear under sitename.com/bc/term.

How can this be achieved?

Note: I've already tried to give a pattern, like bc, [bc], [bc]/. None of these helped.


texts:
I'm making a custom form (fields are added by using drupal_render), but since I have Honeypot enabled for all my web forms, when I submit a form, I get the following message:

  There was a problem with your form submission. Please wait X seconds and try again.

That's because Honeypot markup isn't being included in my custom form.

I have two options:

Disable Honeypot for this form (not possible through module settings from Drupal administration menu). How can I add an exception?
Enable Honeypot manually (with drupal_renders I guess).

Honeypot docs is so poor, so I also have tried to add Honeypot markup manually in this way:

  <?php print drupal_render($form['honeypot_time']); ?>
  <?php print drupal_render($form['url']); ?>

It adds the markup actually, but it isn't fixing yet.


texts:
I use a tableselect to output a list of terms and per row I want a drop down (select):

$header = array(
      'name' => array('data' => t('Name')),
      'weight' => array('data' => t('Weight')),
    );

    $options = array();

    foreach ($terms as $term) {
      $options[$term->tid] = array(
        'name' => array(
          'data' => array(
            '#title' => $term->name,
            '#type' => 'link',
            '#href' => sprintf('/taxonomy/term/%d', $term->tid),
          ),
        ),
        'weight' => array(
          'data' => array(
            '#type' => 'select',
            '#options' => range(1,25),
          ),
        ),
      );
    }

    $form['term_list']['list'] = array(
      '#type' => 'tableselect',
      '#header' => $header,
      '#options' => $options,
    );

My problem is that I do not see the value of the drop down (select) when I debug.

function example_block_save($delta = '', $edit = array()) {
  debug($edit, null, true);
}

Here is what I get:

[term_list] => Array
        (
            [list] => Array
                (
                    [5] => 5
                    [4] => 0
                    [6] => 0
                )

        )

When I check the code I can see that the select has no name, I'm guessing that's why I don't see it in the debug.


texts: "Locking" a node after a certain period of time

texts:
I'd like to be able to have nodes of a certain type "lock" after fifteen minutes, so that for the first fifteen minutes after a node of that type has been created its creator can edit that node, but after that fifteen minutes has passed only users with a specific permission can edit that node.

What's the best way to achieve this result?


texts: Views Data Export, exports entire HTML of page

texts:
I have added the Data Export module.

I have a View creating a Page of fields into a table. Filtered by Content Type, Published, and an 'exposed' (User set) item relevant to the content type, and a Flag (with Flag module) setting (exposed as well).

I have set the Data export with the same fields to export a CSV, attached to the page.
When I click the CSV icon I get a CSV download that contains all the HTML of my page, NOT the table.

Any ideas?


texts: How to alter a form base on the users' request info?

texts:
I would like to customize a form base on the users' request info in a page callback. I use drupal_get_form (or node_add for node create form) to get the renderable array, but most changes to the array here have no effect.

I know that we usually use hook_form_alter, but it seems not suit here.

I would like to hide/set a field, change a field's title/options etc. based on the query parameters or page arguments.

Do we have any methods to get the "raw describing form" and then modify and render it?


texts: How to create 10 extra nodes when a node of a specific content type is created?

texts:
I have some business logic in my application where i need to create 10 extra nodes of a content type, when a node of a specific content type is created from Drupal Content Creation page. I know how to programmatically create a node, and I can achieve it via menu hooks, but cant get them done via hook_node_insert() which takes my application into some sort of a loop(maybe because of node_save()). My menu code is an under but I want it to be run from node insert hook.

function nodecreator_menu() {
    $items['admin/create/nodes'] = array(
      'page callback' => 'nc',
     'access arguments' => array('access content'),

    );
    return $items;
  }
function nc(){
      $node2 = new stdClass(); // We create a new node object
  $node2->language = LANGUAGE_NONE;
  $node2->field_vote_year[$node2->language][0]['value']="2009-01-01 00:00:00";
  //$node2->field_select_base_vote[$node2->language][0]['target_id']=$node->nid;
  $node2->field_select_base_vote[$node2->language][0]['target_id']=8;
  $node2->type = "vote"; // Or any other content type you want
  $node->title="Test";
   $node2->title = $node->title.$node2->field_vote_year[$node2->language][0]['value'];

  node_object_prepare($node2); // Set some default values.
  $node2->uid = 1; // Or any id you wish
  $node2 = node_submit($node2); // Prepare node for a submit
  node_save($node2);

}


texts: Excluding other parent taxonomy terms when one is selected in "Filter criteria"

texts:
I have a table in a content views with a list of four content fields: City 1, City 2, City 3, and Tourist.
Because the cities were all taxonomy references in this particular content type, I created a relationship for the Cities vocabulary, a 'Term Parents' contextual filter, and a relationship between the term parents relationship and my Cities vocabulary relationship.
Now, in 'Filter criteria,' I selected Taxonomy term and set a relationship to Parent. I created an exposed filter and I can also select the specific parent terms I want (excluding the child terms, because I just need them to show up underneath my parent terms in the view).
What I want to do is exclude City 1 or 2 and its child terms from showing up when I select City 3 (but keep 'Tourist' on all occasions). How would I go about doing that?


texts: How can I have a employee ID read-only in Drupal Profile, set by Admin?

texts:
I need to have a field in user profile named Employee ID, this field should only be set by admin (Read and write), read-only to user, and hidden from all other users.
Thank you.


texts: Views: Can I create views based on taxonomies that link to other, context-specific taxonomy-based views?

texts:
I need to keep things in taxonomies so that I can retain the faceting behaviour in search, but I would also like to set up a more conventional way of drilling down through pages (and I'm hoping Views will let me do this).  I'm wondering if I can have a Views page that lists all the items in one taxonomy package, but when a user clicks on one of those items, they are taken to another set of taxonomies.  When they select something from that page, they are given only the list of nodes that have both taxonomies applied to them.

It will probably be too confusing to explain exactly what I'm working with, so let's say I was creating a page that collects government documents.  Every node corresponds to one document, but every document will have a taxonomy for region (i.e., California, Texas, etc.) and department (i.e., Transportation, Education, etc.).  So the first View would show all the states, and when they click on a state, they're taken to a list of departments.  When they click on a department, they're shown a View that lists all the documents for that state.

I realize this is just faceting behaviour, but I've been requested to build something like this anyway.


texts:
Our Goal

We're creating a book product. It comes in a variety of sizes (ex. 5x5, 8x8, 10x10) with 20 pages included. We're using the size as an attribute field. Customers can order a standard book, or add additional pages up to 100 total pages. Additional pages are priced /page and /size; for example 5x5 = $1.00/page, 8x8 = $1.50/page etc. The "Add to Cart" section should look something like this:

===========================

BOOK

Size [5x5]
Pages [ enter amount ]

Total: $75.00
[Add to Cart]

===========================

The simplest solution would be to add a pricing option with its own quantity field, except that functionality doesn't seem to be available.

I've considered the following:

Commerce Option I: Creating a pricing attributes option (select list or radio button styles as a slider). The only caveat is the admin on adjusting pricing for 4000 options (50 books with 80 page options each) is a usability nightmare.
Commerce Option II: Creating a pricing attributes integer field (acting as a quantity field) and using Rules to do the math and adjust the pricing. Unfortunately the variables and math did not seem to be available to Rules.
Commerce Product Bundle: Creating a pages product variation and using page size as an attribute field. That would allow us to leverage the quantity field in the bundle's add to cart display. The problem in this case is two fold:

Having to create 3 product variations, then having to create at least 2 products (book and book/pages bundle; 3 if you have different papers or page pricing needs to vary) each time you add a new book to your collection. This very quickly creates something close to an administrative hell for the shop owner.
Commerce Product Bundle is still in Alpha, and has been for 2 years. No commits have been made in over a year. The module, even though it often works well, is buggy and doesn't play well with Commerce Option; which we leverage quite substantially.

Custom Line Item: Using Randy Fay's "custom line item custom discount technique" leveraging an integer field and rules. I added an integer field to the product variation for cost per page. Then created an integer field which needed to be exposed to the customer. Using the combination of both I attempted to create a rule which calculated the additional price based on the product of the those fields. It does not appear that this is possible using Rules.

Conclusion, and request for additional brain power

I've gone around multiple circles trying to figure this one out and am about to go completely bonkers. Perhaps I'm missing something completely simple, or I'm approaching this problem from the wrong angle. Has anyone been able to do something similar? How did you achieve it?


texts: How to get a remote file and set it as a value for a file field using entity metadata wrappers?

texts:
I am trying to get a remote pdf file from a web service and save it as a field's value using entity_metadata_wrapper, but somehow I couldn't get it working.
I can successfully retrieve the file using system_retrieve_file and save it locally. However, I couldn't set the file field's value to this newly retrieved file.
Here is my code (simplified):
// Retrieve the file from the web service.
// This works, I can see and open the retrieved file.
$file = system_retrieve_file($file_url, 'public://path/', TRUE);
$file = (array) $file;
var_dump($file);

$ewrapper = entity_metadata_wrapper('node', $nid)

// Set this file as a value for the node's file field.
// I've tried following lines individually and they both failed.
$ewrapper->field_pdffile->set($file);
$ewrapper->field_pdffile->set(array($file));

Both methods I've tried raised the following error:

EntityMetadataWrapperException: Invalid data value given. Be sure it matches the required data type and format. in EntityMetadataWrapper->set() (line 122 of /drupal/sites/all/modules/entity/includes/entity.wrapper.inc).

I'm setting in the same code block other fields as well and they are set and saved without any error if I skip the file field.
For example, the following lines are working in the same code block for other fields:
// I'm getting the text from the web service
$ewrapper->field_text->set($some_text);
// I'm getting a term from web service
// Creating it if it doesn't already exist, and saving the 'term id' like:
$ewrapper->field_term->set($tid);
// A few more various fields are successfully set like that...
// Except that file field, which returns the above exception:
$ewrapper->field_pdffile->set($file);

What could it be, that I'm doing wrong?
UPDATE:
I've added a var_dump($file) and I'm getting the following output, which seems alright to me:
array(17) {
  'fid' => string(5) "13037"
  'uid' => string(1) "1"
  'filename' => string(31) "sample.pdf"
  'uri' => string(54) "public://path/sample.pdf"
  'filemime' => string(15) "application/pdf"
  'filesize' => string(6) "129804"
  'status' => string(1) "1"
  'timestamp' => string(10) "1409924961"
  'type' => string(8) "document"
  'uuid' => string(36) "a06f6bf7-61e1-48fd-bfc7-8bff6e72705f"
  'metadata' => array(0) {}
  'alt' => string(0) ""
  'title' => string(0) ""
}


texts:
I have a d7 site with static files under the docroot. (www.example.com/top-directory/sub-directory/file.php)

I want all of the pages to follow the '/top-directory/sub-directory' URL pattern, including a top level page at www.example.com/top-directory/sub-directory. However, that top level page has been created in the cms and has /top-directory/sub-directory as an alias. When I point my browser to www.example.com/top-directory/sub-directory, I am served a blank page because the site goes to the folder, when I actually want it to go to the node.

I believe this could be resolved using .htaccess, but the site is hosted on Pantheon, so I don't think .htaccess rules are going to help. I don't think that making the static pages into Drupal pages is an option either.

Is there a way to solve this problem?


texts: weird features behavior - constantly adding and removing entries from taxonomy.inc

texts:
I'm using features and I commit the features module to my repository to track changes.

Every now and then (after drush fu foobar) I see the following change to the foobar.features.taxonomy.inc file:

@@ -16,8 +16,6 @@
       'hierarchy' => '0',
       'module' => 'taxonomy',
       'weight' => '0',
-      'language' => 'und',
-      'i18n_mode' => '1',
       'metatags' => array(),
       'rdf_mapping' => array(
         'rdftype' => array(
@@ -42,8 +40,6 @@
       'hierarchy' => '0',
       'module' => 'taxonomy',
       'weight' => '0',
-      'language' => 'und',
-      'i18n_mode' => '1',
       'metatags' => array(),
       'rdf_mapping' => array(
         'rdftype' => array(
...

Note the removals in the above diff starting with -. That takes place at the same time for all of my 15 taxonomy vocabularies.

After some development and in the next drush fu foobar those exact lines are added back.

In the meantime of that cycle:

I haven't touched anything on those taxonomies
I haven't updated features (I use the latest)

Any idea why this is happening?

Edit: More info
After the offending lines are added in the foobar.features.taxonomy.inc file if I do a drush cc all then I get the following output in the console:

Reset language for all terms.

Reset language for all terms.

[...]

Reset language for all terms.

That is 15 times if I have 15 taxonomy vocabularies.


texts:
I'm trying to add class to the content, however its not adding anything

    function themename_preprocess_page(&$vars) {
      $is_sidebar_first_or_second= (empty($vars['page']['sidebar_first'])) || (empty($vars['page']['sidebar_second']));
      $is_sidebar_first_and_second= (empty($vars['page']['sidebar_first'])) && (empty($vars['page']['sidebar_second']));
      if ($is_sidebar_first_or_second) {
        $vars['page']['content']['#theme_wrappers'][0] .= ' one-sidebar';
      }

      if ($is_sidebar_first_and_second) {
        $vars['page']['content']['#region'] .= ' two-sidebar';
      }

    }

can anyone help me on this?


texts: Add custom permission to specific module "group" on permissions page

texts:
Using a custom module, how can a permission be added to a core/contributed module "group" on the permissions page without hacking the core/contributed module?

Example:


texts:
I need to design a site which would let people write & share their articles, essays, poems, pretty much any written stuff. It should have complete Facebook integration - registration, likes & comments all from Facebook API.

I found that Drupal would be perfect designing such a site.

I've never used Drupal before. Any advise on how to go about making such a site using Drupal? Are there any contributed modules I could use?


texts:
It turned out there were two issues here: first checkout stopped working, then the server ran out of space. I now have space on the server, but the checkout still isn't working.

It's a commerce site, and checkout worked fine until launch and now the process appears to be broken. I get this message in the Drupal error log.

  Notice: Undefined index: field_extra_instructions in commerce_customer_profile_pane_checkout_form() (line 165 of /home/wholebox.org/www/profiles/commerce_kickstart/modules/contrib/commerce/modules/customer/includes/commerce_customer.checkout_pane.inc).

The site is wholebox.org and if anyone can help find out what's wrong, it would be very handy right now.

Could I have disabled an important module when trying to make it faster?


texts: Drupal 7 Rules - Set value of multiple value reference field (user reference)

texts:
I have a cck content type with a multi value reference field.
Using rules, I am trying to populate these reference fields when users create a different content type (for example an event and I want to keep adding user references for people that view the event -- this is an example.)

My issue right now is that I can fetch the entity to set the user reference (using a loop of users), but I can only set the first field.
How do I move to the next field of the fetched entity and set it to the next user in the loop list?

I imagined that as long as I was in the loop, for each item in the loop, a set data value on the reference field would move to the next field but it simply overwrites the first one.

I see that the particular reference field I'm trying to set values for is an array (fetched-entity:field-blah:0 etc). Since I cannot pick for example item [0], I thought  fetched-entity:field-blah without the delta would keep shifting to the next. It does not.

I'm thinking there is a way for me to loop through the deltas in the fetched entity as I loop through the list?

Any help appreciated.


texts: How can I design the standard user login form with twig?

texts: I want to change the labels "Username" and "Password" and delete "Create new account" link of the standard login form of Drupal 8. Is it possible to do this with twig?


texts:
I am using webform and with all the tons of modules available so far there was virtually nothing I had to compromise on.

One thing I am stuck with is re-using user text input. Is this possible without writing a custom webform module on a multi-page form:

user initially enters some text in 4 textfields
populate form checkboxes with those values?

There is the token module installed but I can't figure out a way to populate the checkboxes dynamically (coming from the user and not from a premade select list). The webform_ajax module tells me I can't use it on multi-page forms.

Any suggestions how to achieve something like this where the user enters something and this shows up later in the form?

UPDATE:

I am trying to use hook_webform_select_options_info. How can I target the specific webform, text and select field? Devel does not show any webform ID. The screenshot shows textfield and selectlist information

From the link

function hook_webform_select_options_info() {
  $items = array();
  $items['customusergroups'] = array(
 'title' => t('Your user groups'),
 'options callback' => 'webform_options_days',
 // 'file' => 'includes/webform.options.inc',
 );
 return $items;
}


texts: Ability to separate between levels in vocabulary hierarchy

texts:
In the frontend visualisation of vocabularies, is One in Drupal able to specify from which level in the vocabulary hierarchy one should display terms from?

If yes, how do you do this?

Thanks,

Espen


texts: How do you get the upper right hand configure gear icon to show up on certain Views?

texts: I'm currently on the users page and its being loaded via the admin_views module, but the configure gear icon doesnt show up on this view. Do I have to do something to have it show up? It works on other views, but some of them doesnt show up and im not sure why. I'm also using the Seven Theme.


texts: How do I select a page using views_embed_view?

texts:
I am writing a rather intensive ajax interface that requires me to manhandle views quite a bit. I am retrieving the results of the ajax triggers using

views_embed_view($view, $display, $arg1, $arg2);

Everything works great except the default pager ajax drops the custom info I'm dumping into views_embed_view

How can I use views_embed_view to select which pager page to return?

drupal 7, views 3


texts: D8 Views - Contextual Filter by Month & Year? (Content date field)

texts:
We have a dev site finally patched all the way up to 8.5.3. Our old site (8.4.0) was using a Views patch (just for reference) that allowed for a content date field to be contextually filtered by month and year:

https://domain.com/events/042018

returned all events with month 04 and year 2018.

Now on views 8.5.3 this patch is no longer applicable and seems to be integrated for Created Date and Updated Date. But I don't need these date fields. I am trying to access a content date field that I made.

Does anyone know how to do this?
or
Can you help me get started on creating a custom views contextual filter handler that can access this custom date field?

Thanks so much!

Example of View: Show all events. Contextually Filter by Date. But instead of an exact date, only grab month and year parts, i.e. show all events for July 2018 /events/201807


texts:
I have installed the Date Module and added a date field to one of my content types, the widget I'm using is Popup Calendar. The problem I'm facing is that when I choose a date it seems to get stored and displayed correctly in the administration, but at the frontend the date is shown with two hours added to it.

For example if I set the fields value to 2014-12-12 10:00:00 its displayed as 2014-12-12 12:00:00 when I'm visiting a frontend page.

Like some of the comments have pointed out this might be because the frontend is displaying a visitors local time, but still I don't get why the time differance is two hours, when the differance between Findland and Sweden is only one hour.

I guess this has do do with some Regional settings or similar.


texts:
I have a simple text that contains  tags but when I try to render the field, the img tags disappear!

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

Why?


texts: CKE editor not showing up until I upload an image?

texts:
If I add content as admin, it works fine right from the beginning(using admin overlay).

But if I login as another role then CKE editor wont be neabled until I upload the image.

In Both roles FULL HTML is the default text format.
What might be the reason for this?

When I upload an image, then CKE editor shows up