texts: .info file is not loading the JavaScript code

texts:
I added the references to some JavaScript files, in my .info file, hoping that they would be output by the $scripts variable in my header. I cleared the cache, and they are still not there.

$Id$
name = site
base theme = boron
core = 6.x
engine = phptemplate
; We do not have a Left sidebar.
;regions[left] = Left sidebar
; We do not have a right sidebar.
;regions[right] = Right sidebar
regions[content] = Content
regions[header] = Header
regions[footer] = Footer
scripts[] = sitename/sites/all/themes/custom/jivamukti/js/jquery.nivo.slider.pack.js
scripts[] = sitename/sites/all/themes/custom/jivamukti/js/scripts/jquery-1.6.1.min.js

I put the JavaScript in the root of the themes folder I am using, instead of /js, and now it is output in this function in my header:

jQuery.extend(Drupal.settings,…);

How do I just get it to display inside the <script></script> tags?


texts: how to trigger rules when a new item is added to a view?

texts: I would like to trigger a rules action when my proximity map returns new listed nodes. I can include a VBO for the proximity map, and set a rules action for 'VBO returns a list" with 1 or more items. But how can I specify it to be triggered by an event or condition that the view returns a new item? (Ie when a users location brings a new node in proximity?).


texts: I am making a form with autocomplete fields and I am not able to make it work (using an example code from a tutorial). The strange thing is that when I test it in my local drupal installation (bitnami drupal stack 7.38 on my PC) it works, but the same module on a server instance (it's 7.38, too) doesn't work (the json file with matches is created correctly but there are no matches displayed when I type something in the form field). Does anybody know what might be a cause?


texts: Drupal 7: Local site URLs all point to production site

texts:
I've been trying to figure this out for a while on this one particularly large site.

Every single URL on every page and menu, even the admin menu as the wrong url. I've tried this with WAMP, MAMP, Vagrant, Docker and Docksal with the same results.

A better explanation:
I'd expect all urls to be what I've setup on my local machine as the base. Like mysite.loc, or for docksal, mysite.docksal.

But when I pull the repo for this site and set it up, then load it...all urls are the production urls. Anything I click on goes to production. All submit buttons goto production. Almost like they are saved in the DB, but the definitely aren't.

I've tried setting the base URL. That doesn't work.

I've turned off all the modules, both contrib and core. That doesn't work.

I've changed themes. That doesn't work.

It's something within the filesystem of this site but I'm not sure where to look at this point. Probably a hack someone put in somewhere.

Any thoughts of where to look?


texts: How can I build a view that shows other nodes that reference the same node the current node references?

texts:
Let's say I have homes and neighborhoods (homes reference the neighborhood they're in via a node reference field). On the home detail page I want to show other homes in the same neighborhood.

Seems simple enough, and I've found this: Create a view on a node reference field but it is not quite what I need to do, since I need to find other homes that reference the same neighborhood as the current home does (not ones that reference the current home).

I also found this: Node references view: get other nodes that also reference the same node but I am only using 2 content types (homes and neighborhoods). Any ideas? My brain is tired after trying to think through the relationships and arguments of this thing :)


texts: Can I pass a variable from one twig to another twig deeper in render array?

texts:
does anybody know if/how I can pass a variable from a twig higher in the render array, to one of it's descendants? I'd like to have a pure twig solution.

Use case:

I inject a css class into views-view.html.twig in configuration. Depending on this, I would like to decide in a lower views-view-fields.html.twig, how to generate fields. I would create a bunch of macros - then import them dynamically depending on the css class.

Alternative solutions I'd like to avoid:

I do not want to rely on machine names and create lot of views-view-fields--.....html.twig files. Super ugly, not scalable, not maintainable.
I also don't want to create a solution which goes through all layers and maintain twigs, php hooks, configuration values and write documentation which pleads it not to fall apart.

Desired is:

I want this to be a configuration thing which docks 1:1 onto twig-filesystem. For that I need to make a string available to a twig deeper down in the render pipeline. How??


texts:
I have created a content type in Drupal 8 and I added a field named "body". But I'm unable to use PHP code in this field.

How can I enable PHP in my "body" field?


texts:
In my site, I'm getting a 404 error (http://www.site.com/&mch57a). I'm guessing it's a problem with a module. Is there a way to trace where this call is coming from, other than disabling modules one at a time? I do have the devel module.

Thanks for the help


texts: Saving and retrieving value in hook_node_form_alter()

texts:
This is in Drupal 7.

I have managed to add a section to the node vertical tab. But I have not found out how to save the value and retrieve the value. After saving the node if i go back to the node edit form it still shows the default value. What am I missing?

function myModule_form_node_form_alter(&$form, &$form_state, $form_id) {
  $form['test_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('test settings'),
    '#weight' => 0,
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#group' => 'additional_settings',
   );

   $form['test_settings']['node_uaid'] = array(
    '#type' => 'textfield',
    '#title' => t('uaid'),
    '#default_value' => variable_get('node_uaid', "default"),
    '#size' => 50,
    '#maxlength' => 50,
    '#description' => t('test UAID.'),
    '#required' => FALSE,
    '#group' => 'settingsform'
   );
}

The final objective is a field in the node add/edit vertical form that is directly associated with that node. This field should be accessible in relation to the node.


texts:
I am using CKEditor, and am having a problem with the scaling of the images during edit.  When I upload and insert them into my editor, if the image is very large, it displays that way in the editor, making it very hard on the user.

I have formats defined for these image styles, which set the class attribute to a CSS class.

Is there a way to get images in the editor to adhere to the CSS of their format, so the page layout during edit resembles what it will look like after being saved?


texts: Show clrcle overlay instead of marker in google map?

texts:
I'm using gmap module on Drupal 6. I create a view and select gmap as style for my display.
Everything works fine but the map shows a Marker and I need to show a circle overlay instead of the marker so that the map hide the exact address location.

I tried all setting within gmap module but...nope.

Where is the right place for this setting?

Thanks


texts: Change taxonomy list automatically generated paths

texts:
I made a dummy second hand car website, for which I made a taxonomy list "Popular brands". I've added this list to the front page, but each of the respective links (e.g. each brand) links to popular-brands/[brand] instead of brand/[brand], how I'd like it to be.

The first is generated automatically upon creating this block view. Can I alter this path to become the latter?

The case can be seen live at ikhoefgeen.be (site is in Dutch by default, I'm not sure wether or not it automatically displays in English).


texts: Not able to import images using feed image grabber module in content image field

texts:
I am using Feed and Feed Image grabber module for importing data form non Drupal site to my Drupal Site. All fields are successfully imported except image field, I have checked all the steps to FIG module configuration but with no success.

I have also tried for new content type but again no success.
My CSV file have following data
Title,Description,image
Test1, testdescription,https://s3.amazonaws.com/brewerydbapi/brewery/snQlvg/upload_qMSc0A-medium.png

When file imports, only first two columns data saved not image and also no error shows in logs also.

Please confirm whether we can use external links or not?

Any suggestions?


texts: Content encoding error after enabling cache, aggregation and compression

texts:
Yesterday I turned on caching, aggregation of css and js files and turned on compress cached pages. Then I logged out and closed my browser (FF). After a couple of minutes I openend my browser again, typed in the url of my website and got this error in FF: Content encoding error.

I tried opening my site in FF, Chrome and IE. None of them work.

I read some similar threads here and tried:
- setting display_errors=Off in php.ini
- disabling gzip of files in .htaccess
- Changing "Header append" to "Header set" in .htaccess

Nothing seems to work.

What I would like to do now is manually disable caching, aggregation and compression in the database, but I don't know which tables these settings reside in.


texts: How to create a views export in XLS format?

texts:
I have a view that extracts user informations. Now I need to export these results in XLS format. I have tried "views data export", but it is not supported in last Excel versions.

Is there some way that permits me to export data in XLS for the new Excel versions ? Or a good library to use via a custom module ? I'm a senior developer so I have no problem to use PHP and other features.


texts: How do I store node form data between form steps using ajax?

texts:
I want to turn a node form into a multi-step form using ajax. I've added ajax-enabled submit buttons and some logic in a hook_form_alter (see below) to handle inc- and decrementing steps, and showing and hiding form items based on the current step. The stepping back and forth works great, in terms of rendering the correct elements.

The problem is, if I enter some data in one step, go forward or backward, and then return to the original step, the data I entered is gone from the form. If I check the value of the item for which I entered data using FormStateInterface::getValue(), the data is there when my alter hook runs when leaving the original step, but gone on subsequent next/back transitions. This problem also does not apply to data that is already in the form (e.g. when editing an existing node).

Clearly, I need to store the incoming values somewhere, but where? And then, how do I restore them to the form elements on the appropriate step?

My code (minimal example):

<?php
/**
 * Implements hook_form_FORM_ID_alter().
 */
function my_module_form_node_ajax_test_form_alter(&$form, $form_state) {
  // Define steps. Each child array is a step, and each string in the
  // a child array is a field that should be present on that step.
  $steps = [
    ['title'],
    ['body'],
  ];
  // Add wrapper.
  $form['#prefix'] = '
';
  $form['#suffix'] = '
';
  // If the step is not set, this is step 0.
  if (!$form_state->has('step')) {
    $form_state->set('step', 0);
  }
  // Get the current step.
  $step = $form_state->get('step');
  // If we have a triggering element, increment or decrement step as
  // appropriate.
  if ($trigger = $form_state->getTriggeringElement()) {
    switch ($trigger['#name']) {
      case 'next':
        $form_state->set('step', ++$step);
        break;

      case 'back':
        $form_state->set('step', --$step);
        break;
    }
  }
  // Show elements in the current step, hide others. Always show the
  // `actions` element, and all `form_*` elements.
  foreach (Element::children($form) as $element) {
    $form[$element]['#access'] = (
      in_array($element, $steps[$step])
      || $element == 'actions'
      || strpos($element, 'form') === 0
    );
  }
  // Show the back button if this is not the first step.
  $form['actions']['back'] = $step > 0 ? ajax_button('back') : NULL;
  // Show the next button if this is not the last step.
  $is_last_step = $step == count($steps) - 1;
  $form['actions']['next'] = !$is_last_step ? ajax_button('next') : NULL;
  // Show the submit button if this is the last step.
  $form['actions']['submit']['#access'] = $is_last_step;
}

/**
 * Return a render array for an ajax step button.
 */
function ajax_button($name) {
  return [
    '#type' => 'button',
    '#value' => $name,
    '#name' => $name,
    '#ajax' => [
      'wrapper' => 'ajax-form-wrapper',
    ],
  ];
}


texts: How to filter GraphQL query by content language?

texts:
I am coding Drupal 8/Angular app and Angular is fetching data from Drupal using GraphQL. Everything works fine except now I need to query nodes in a particular language. This is my query:

{
  nodeQuery(filter:
    {conditions: [
      {field: "type", value: "akcia", operator: EQUAL, language: EN},
      {field: "field_datum", value: "2018-02-12T18:00:00", operator: GREATER_THAN_OR_EQUAL}
      {field: "langcode", value: "en", operator: EQUAL}
    ]}
    sort: {field: "field_datum", direction: DESC}
  )
  {
    entities {
      entityLanguage {
        id
      }
      ... on NodeAkcia {
        nid
        langcode {
          value
        }
        title
        fieldDatum {
          value
        }
        body {
          value
        }
        fieldObrazok {
          url
        }
        path {
          alias
          pid
          langcode
          pathauto
        }
      }
    }
  }
}```

Notice the `{field: "langcode", value: "en", operator: EQUAL}` line - that's the best thing I came up with, however, the query returns Slovak version of that node, not the English one.

Is there any better way ho to filter nodes based on their translation?


texts: How to get the entity that field belongs to in the case of an entity reference field

texts:
Here is my use case:

I have created a media bundle (FILM IMG) to store a media entity (image) field. I can manage it at admin/structure/media/manage/film_img/fields

In a content type named "FILM" , I have added a entity reference field which reference my "FILM IMG" media entity bundle.

I am also using file_field_path module to rename the uploaded images.
When I am adding a new image for a new Film, I would like to use hook_filefield_paths_process_file to rename my image file name.

This hook is providing me the media entity ($entity) as a parameter, but of course it is not providing the Film entity that I need (I need it to get some info to rename my file name)

Here is my question: How to get the "parent" entity from the referenced entity;

In other words, with my use case: How to get my film node from the image media entity provided by the hook.


texts: How can I hide the title in a custom page made with hook_menu?

texts:
I need to hide the title on a custom page created using hook_menu. I don't have a nid, so probably I can't use one of the existing modules to do that.

function mymodule_menu() {
  $items['mypath'] = array(
    'title' => 'My title',
    'page callback' => 'mymodule_page_callback',
    'access arguments' => array('access content')
  );
  return $items;
}

I know this could be done using this css

body#pid-mypath {
  h1.title {
    display: none
  }
}

but I want to know if there are other alternatives. I'm working with Drupal 6.


texts: Is it proper to perform a db_update on an entity table?

texts:
I have a custom entity. During a save operation, under certain circumstances, I need to change the value of a specific field (not field API) of some other entities (of the same type).

If I perform a db_update on the entity's table, is it safe for caches or for any other reason yet unknown to me?

Alternatively, I suppose I could use a rather complicated select query to retrieve the ID's under concern. Then update each entity separately in a loop or batch.

Which causes my second similar question, is it safe to perform a select query in the middle of this operation? Are there any circumstances where entities have different content in memory or DB cache comparing to the DB values?


texts: How do I turn off the add to cart message from Commerce site using Rules

texts:
I finally got a duplicate cart rule to work in my Drupal Commerce site.  My "After item is added to cart" rule determines if there are duplicate sku's, if so, resets the quantity of that item to one.

When that rule is run, it posts a system message to the user saying the duplicate has been removed from the cart, but the original "Item has been added" message still appears, so the green, "item added to cart" msg appears and just under it, my "duplicate item has been removed" msg appears.

I want to turn off/not display that first "item has been add" message, when a duplicate has been detected.  Obviously the message would appear as normal when no duplication is found.

What is the simplest means of accomplishing this? Nothing I've tried thus far has worked.

default add to cart message:

{ "commerce_cart_add_to_cart_message" : {
    "LABEL" : "Display an Add to Cart message",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "TAGS" : [ "Commerce Cart" ],
    "REQUIRES" : [ "commerce_cart" ],
    "ON" : { "commerce_cart_product_add" : [] },
    "DO" : [
      { "commerce_cart_add_to_cart_message" : { "commerce_product" : [ "commerce-product" ] } }
    ]
  }
}

my stop duplicate rule

{ "rules_restrict_quantity_1" : {
    "LABEL" : "Restrict quantity to 1",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "commerce_cart" ],
    "ON" : { "commerce_cart_product_add" : [] },
    "IF" : [
      { "data_is" : {
          "data" : [ "commerce-line-item:quantity" ],
          "op" : "\u003E",
          "value" : "1"
        }
      }
    ],
    "DO" : [
      { "data_set" : { "data" : [ "commerce-line-item:quantity" ], "value" : "1" } },
      { "entity_save" : { "data" : [ "commerce-line-item:order" ] } },
      { "drupal_message" : {
          "message" : "Duplicates items are not allow.  This item has been removed from \u003Ca href=\u0022\/cart\u0022\u003Eyour cart?\u003E",
          "type" : "warning"
        }
      }
    ]
  }
}


texts: Is it possible to use theme_table on each key of array?

texts:
I know theme_table only accepts rows when $row=array(); I have an array like:
Array(
[0] => 'one',
1 => 'two',
)
Is it possible to have table rows as 'one', 'two', etc...
I mean, first row will be 'one',
second row will be 'two'.

How can I achieve this?


texts: Configuring/using Drupal Pathauto module

texts:
I am new to Drupal. I just installed Drupal 8 and pathauto module.

Now I need to configure path patterns or whatever they are called.

On page https://www.drupal.org/documentation/modules/pathauto they give the path for configuring as:

For 7.x, 8.x: Administer > Configuration > Search and Metadata > URL aliases, in the "Patterns" tab.

But can't see "Patterns" tab. When I click http://localhost/admin/config/search/path/add I get to a page with a form and 2 fields:
1. Existing system path
2. Path alias

I also tried http://localhost/admin/config/search/path/pathauto and http://localhost/admin/config/search/pathauto but they both give me 'Page not found'.

How do I configure Pathauto?


texts: How do I add extra cost with cash on delivery?

texts: I have implemented and eshop with commerce module in drupal 8. How can I add extra cost in case the customer chooses the cash on delivery method? I use payment module. Is there any solution or some other alternative? I tried rules also, but there is not any event that is triggered on payment method selection.


texts:
I need to get the results of the web form as a block to display with the webform.

It seems views has no way.


texts: Why can webform downloads in Excel format no longer (Jan 2021) be opened in Excel?

texts:
As of approx 21st Jan 2021, webform downloads in Excel format can no longer be opened in Excel, on several sites. Excel says:
"Excel cannot open the file ’blah.xlsx’ because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file."
This is happening on multiple sites, where previously the downloads could be opened OK in Excel. The timing fits with the Drupal core 7.78 update, however I have replicated the issue on old development copies of two of the sites on earlier Drupal versions: 7.69 and 7.75 . That seems to rule out the core update as the cause. There were no other updates common to all the affected sites in the relevant time frame. I've replicated the problem on different hosting environments.
Another possibility might be if there's been a recent Excel update that leads to these files being reported as corrupt when previously they were accepted.
Has anyone else seen this issue?
Drupal core versions: 7.69, 7.75, 7.78
Webform versions: 7.x-4.21 and 7.x-4.23


texts: Sending mail to an adress specified in a node creation form with an CCK email field with Rules

texts:
I'm using a node creation form open to anonymous users to register volunteers for an event, and I want to redirect them to a thank you page, and send them an email when they register.

I'm using Rules to detect the submission of a volunteer node, and trigger a redirect to the thank you page, but I cannot figure out how to send a mail to the address specified in the form submitted.


texts: Display thumbnailPhoto from Active Directory - Open atrium and LDAP modelude

texts:
I am using Open Atrium for my intranet. I got LDAP module installed, the server is configured, same as User, Authentication, and Authorization.
The communication with my Active Directory is successful, I have all my fields and properties populated correctly, but THUMBNAILPHOTO

Do I need to configure something else?? What I am missing? My active Directory uses CodeTwo.

Thanks,

Sofia


texts: How to use entityform and ajax_form_entity in a modal window?

texts:
Just getting started with the entityforms module (and it looks sweet!).  I want to create a 'contact us' link that displays the form in a modal window, submits and then closes the window.

There is a related module, ajax_form_entity, that looks like it would help make a clean submission.  The demo site has a 'Views popup integration' section, but that doesn't look useful (or relevant, actually).

Anyone know how I can do an ajax submit of an entity form from a popup?


texts: How to Display Image after submitting webform in the confirmation message page

texts:
I have added field as file in webform so that we can add image in this file field. Now i want to display next page after submitting image file by using following code

[submission:values:image_file]

but I cant able to display the image in the confirmation page. how to display the image in the next page


texts: How to embed a custom content type in a Drupal 7 theme?

texts:
How can I make a custom content type automatically available when a specific template is used?
e.g.: "Standard Page" is the custom content type I made with Drupal, going to structures-->content type etc. Now, it will be seen among the default content types, i.e. basic page and article. I want to make that custom content type, Standard Page, available without any effort when the template is enabled, i.e. without editing it: it must be embedded in the theme. How could it be done?
p.s. I'm new to drupal theming. Any suggestion will be really appreciated.


texts:
I'm trying to do some fancy navigational work within a large XML sheet, and am generating links with querystrings in my transformation.

What I would like to do is parse the querystring within my .module file, and then pass it somehow to the XSL processor.

Essentially, right now I have (without any error handling at present):

/* generate hook */
function _xml_import_generate()
{
  $p = $_GET['p'];

  $path = drupal_get_path('module', 'xml_import');

  $xsl = new DOMDocument();
  $xsl->load("{$path}/xml_import.xsl");

  $xslt = new XSLTProcessor();
  $xslt->importStyleSheet($xsl);

  $xml = new DOMDocument();
  $xml->load("feed.xml");

  return (string) $xslt->transformToXML($xml);
}

I can't seem to find any documentation regarding this...but how do I pass $p into my XSL transformation?


texts: import from wordpress migrate with drush

texts:
UPDATE:

I managed to import my 64MB of content!!!!
I ket expecting to see something new appearing in the confirguration tab from migrate, but that's never been the case.
I also kept having the AJAX error.
After a while I simply tried the command "drush mi --all -d" and it imported all my content in the background. I didnt get any erros anymore and now all the data has been imported.

Hope this might help some windows users

It me again about Drush..

Drush is not enabling modules and showing me all my enabled modules and all (which wasnt the case yesyerday)

Drush also accepts the  drush vset migrate_drush_path C\FolderName\Dush\drush.bat
Youhou!!!

The next thing to do is to see if the PHP directory is in the path of my Drupal:

It's there so, if I follow the steps from here: https://www.drupal.org/node/1958170
It should be working and I should see further options, which I don't?!

Can someone help me and my wamp server on win 8.1. solve this?


texts: Are there any security concerns with getting the UID by simply querying the sessions table against the visitor's cookie?

texts:
In the High Performance JavaScript Callback Handler I'm attempting to use my own code to get the current user's ID.

To give a quick rundown, by returning data at a much lower bootstrap level (DRUPAL_BOOTSTRAP_DATABASE) I can return a page in ~90 milliseconds instead of the ~1500 milliseconds that a full bootstrap takes on this server. For simple content that any user can see, such as a published, publicly-viewable node, there aren't any security concerns. But if I need to perform any kind of access check, I need to know the current user's UID. I'm getting the UID by querying the sessions table for their sid/ssid. Consider this code:

  $session_name = session_name();
  if (!empty($session_name)) {
    if ($uid = db_query("SELECT uid FROM {sessions} WHERE sid = :sid", array(':sid' => $_COOKIE[$session_name]))->fetchColumn()) {
      $account = new stdClass();
      $account->uid = $uid;
      $account->roles = array();
      $account->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user';
      $account->roles += db_query("SELECT r.rid, r.name FROM {role} r INNER JOIN {users_roles} ur ON ur.rid = r.rid WHERE ur.uid = :uid", array(':uid' => $account->uid))->fetchAllKeyed(0, 1);
    }
  }

I am not yet including logic for their ssid (HTTPS), as I just wanted to get a proof of concept working quickly.

Are there any security concerns that I'm missing here? I've gone through session.inc and, while I'm completely ignoring the anonymous user handling, page caching, etc., none of those really matter to me within the context of what I'm doing. If I don't have an authenticated user, I don't need to create a new session for them or anything like that, they just get an access denied response from the server.

Edit: I should add that, with the above $account, permissions checks like user_access() and node_access() can be run.

Edit 2: Here's the original issue where I'm dialoging on this particular topic within the js module: http://drupal.org/node/1922406


texts: Category tags like drupal.org (Drupal 7)

texts:
I am wondering how to create tags like they have on the main drupal site:

I assume drupal.org is designed using Drupal :)

Can anyone tell me if this is somehow built in to drupal?  The only options I see for term reference fields are list, text fields (which only allow the user to input one tag) or hierarchical reference fields.  Is there some module that allows for the use of these more sophisticated tags?


texts: How can I hide a particular link in the main menu from anonymous users without making the whole menu invisible?


texts: What's the best way to add an element to a form AFTER submission?

texts:
I have a form that I'm trying to build that is semantically identical to billions of others on the net:

First GET request returns an empty form with no results displayed.
Submitting the form POSTs all data to the same page.
Server collects information from the database/other service based upon the submitted data.
Final response contains the same form with the fields still filled out, and a results table at the bottom.

But implementing this classic workflow seems to be impossible in Drupal 8.

I have been reading outdated documentation on the D7 Form API for what seems like forever, and have decided that it's probably best for me to implement a form that submits via AJAX and adds the results table to the page dynamically. But I'd like to know whether this would be the best approach, as well as other methods of doing what I want whether they're "better" or not.

I'd love to give you guys an idea of what I've tried, but the appropriate project files, as well as my brain, are so scrambled right now that I can't figure out what to show. So just some general pointers in the right direction would be very much appreciated.


texts:
I have a view that displays a list of items. How to make anonymous user see this list of items but when accessing the node, it has to be logged? Any idea?

I use the latest version of drupal


texts:
I'm trying to use the RPX module and I get as far as step 5.

I've installed and enabled the plug

checked permissions

and selected "visitors"

Then i get here.

  Visit admin/config/people/rpx and enter your Janrain Engage API key.* This API key must be entered for the module to function properly.

I find that the path admin/config/people/rpx doesn't exist.

I'm running Drupal 7.12 with RPX 7.x-2.2

Is this a common problem, does anyone know how to fix it?


texts: I have got  a status column for a web form event and so that it is editable by admin. Once the status is updated the end user is not able to see it, because it is a private field.


texts: How can I create a Feature and have it saved under 'features manage' tab?

texts: I see that I can create a Feature, but the only option is to download it. Is there a way I can just have Drupal import it to the manage tab of Features?


texts: How to grant edit access only to set of users defined in a cck field of a node?

texts: I am trying to restrict edit(node/%nid/edit) access only to users defined in one of the node fields. can I use hook menu alter for node/%nid/edit so i can write a custom access callback or use hook node access to achieve it. One thing to mention here is any user can comment on that node and when they save the comment, I am updating some fields on the node and saving it thru node_save. What will be the best way to achieve this access restriction.


texts: How to make payment to two different Bank Accounts at a time in drupal 7

texts: In Drupal 7, If any user purchases the product then the commission of that product should deposit into "website owner account" and the remaining amount should deposit into the "Product Company Account". Which module is best suitable for this flow. (i.e., Drupal E-commerce or Ubecart or any other suggesions...). Please suggest ASAP. Thanks in advance.


texts: Custom access callbacks for user entities not being called

texts:
I'm trying to implement some custom access control for user entities, in Drupal 7.

I've used hook_entity_info_alter to set

$entity_info['user']['access callback'] = 'MYMODULE_user_access_callback';

and when I call entity_get_info at a later point, I can see that this is still successfully set.

But MYMODULE_user_access_callback never ever seems to get called when I try to display users directly, or load Views of users.

It looks like the custom access callbacks are normally called from the entity_access function in entity.module. But the user_access function in user.module doesn't ever call them.

user_load in the user module calls entity_load, which calls entity_get_controller($entity_type)->load(...)

but this still doesn't seem to invoke entity_access.

So is setting 'access callback' for the user entity a wrong way to go about trying to implement custom user access control? Do I need to override UserController perhaps?


texts:
I followed this video tutorial in youtube for installing TinyMCE Editor in drupal. Below are the steps I did.

1. Downloaded and installed the updated WYSIWYG 7.x-2.2, IMCE 7.x-1.9 and IMCE Wysiwyg API bridge 7.x-1.0 succesfully.

2. Downloaded TinyMCE and placed it on `htdocs\drupal\sites\all\libraries` succesfully.

3. Installed TinyMCE unsuccesfully.

I refresh drupal's page and still gets the 'Not installed.' message.

I suspect the path may be wrong/different from the image above. The actual path in my computer is sites\all\libraries\tinymce\js\tinymce\tinymce.min.js

I downloaded TinyMCE here. Where did I go wrong?


texts: Support for special german characters in Search

texts:
We are creating search for a German language website. Search should support German special characters, e.g. "ß" is generally also written as "ss". A search for the name "Meißner" should also return results for "Meissner" and vice versa.

Is there any existing solution for this?


texts: I need help with an existing variable of drupal

texts: How I can use in my code the value where exists on configuration->Logging and errors->Database log messages to keep?? Could anyone help me to find out how I can use this number that the user will select? What is the name of these variable??


texts: Using .tpl.php templates instead of Twig templates

texts:
Is there a way to use .tpl.php templates instead of Twig templates in Drupal 8, or is there a way to write PHP in a Twig file instead of that Twig language?

I am a beginner for Drupal 8, but I have worked with Drupal 7.


texts: Currently when I use t() it shows me originaltext in english and i can translate into french and german. But I want to change the default language to french so when I write t('Salut') I will translate it into english, german, etc. later. But how/where can I do this?


texts: Is there a one-click solution that builds a private organic group (OG) and invites another specified user to that group?

texts:
I'm looking to let users initiate the creation a private organic group and invite another user to that group? I'd love to be able to craft a link (in a view of users perhaps) that adds a path like /request/new/og/{uid} to the routing table.

The idea is to match tutors to users needing help in a subject area.

I starting from a View based on User Accounts that presents a table as follows.

User       |  Tutoring Availability    | Request Tutor Group
-----------+---------------------------+---------------------
Abe        |  T/H Afternoons           | [ Request ]
Brian      |  M/W Mornings             | [ Booked ]
Courtney   |  Wknds Anytime            | [ Request ]
David      |  F All day                | [ Request ]
Mozzarella |  M All Day                | [ Request ]

In the request link above, I like to

Create new private OG (of content type 'group')
Make the Logged in user the group manager
Invite (not automatically subscribe) the other user (potential tutor)

I'd like to not have the user see any node creation from as these private groups will have non-creative names such as "Tutoring Session for Rob and Jim on Organic Chemistry." Users will communicate via another content type that helps to track tutoring benchmarks.

Update: I'd also be happy if someone can point me to a working code example of OG's API to create an organic group using functions from the og api.

Bounty reward may require some screen shots to create a good reference point for the community.


texts: Moving webform uploads to a non-public folderspace

texts:
On Drupal 6, I have a webform that needs to collect file uploads. I can do this of course through the File type. However, I'd like to not leave these files sitting in a folder visible to Apache.

Using the following

hook_webform_submission_presave($node, &$submission) {
        print_r($node);
        die();
    }

I can see the following data structure.

        [components] => Array
            (
                [1] => Array
                    (
                        [nid] => 156117
                        [cid] => 1
                        [form_key] => test
                        [name] => TEST
                        [type] => file
                        [value] =>
                        [extra] => Array
                            (
                                [savelocation] => creative/samples
                                [title_display] => before
                                [private] => 0
                                [filtering] => Array
                                    (
                                        [size] => 800
                                        [types] => Array
                                            (
                                                [0] => gif
                                                [1] => jpg
                                                [2] => png
                                            )

                                        [addextensions] =>
                                    )

In the [extra][savelocation], could I modify this to a folder that is not accessible via apache? How would I properly update the database entry?


texts: Display/Print both full content and teaser in node.tpl

texts:
I want to display both full content and teaser content at the same time in node.tpl.php Here is an example of what i want to display

Mini Table

Full Table

        TEASER DISPLAY

        FULL CONTENT DISPLAY

I search for it but didn't find the answers. Please Help


texts: Behat test fails, unable to find Username field using @javascript

texts:
My Behat test fails as soon as I add @javascript

Error:

Form field with id|name|label|value|placeholder "Username" not found.

When I remove @javascript, test is passed without any error.

Given I am logged in as a user with the Administrator role

To test the Drupal 8 image_field I need @javascript

Behat.yml:

default:
  autoload:
    '': '%paths.base%/tests/behat/bootstrap'
  suites:
    default:
      paths:
        - '%paths.base%/tests/behat/default'
      contexts:
        - Drupal\DrupalExtension\Context\DrupalContext
        - Drupal\DrupalExtension\Context\DrushContext
        - Drupal\DrupalExtension\Context\MessageContext
        - Drupal\DrupalExtension\Context\MinkContext
        - MyServices\EntityContext
        - FailureContext
        - MyServices\LinkContext
        - My\MenuContext
  extensions:
    Bex\Behat\ScreenshotExtension:
      image_drivers:
        local:
          screenshot_directory: /[SHARED_FOLDER]/screenshots
    Behat\MinkExtension:
      goutte: ~
      base_url: "http://dev.mysite.com"
      files_path: '%paths.base%/tests/behat/files/'
      javascript_session: selenium2
      browser_name: chrome
      selenium2:
        wd_host: "http://localhost:4444/wd/hub"
        capabilities:
          # required by mink-extension 2.3
          marionette: null
          browserName: chrome
          browser: chrome
          version: 63
    Drupal\DrupalExtension:
      blackbox: ~
      api_driver: 'drupal'
      drupal:
        drupal_root: '%paths.base%/public'
      text:
        username_field: "Username"
        password_field: "Password"
        log_in: "Log in"
        log_out: "Log out"
      selectors:
        message_selector: '.messages'
        error_message_selector: '.messages--error'
        success_message_selector: '.messages--status'
        warning_message_selector: '.messages--warning'
        logged_in_selector: '.user-logged-in'
        login_form_selector: '#user-login-form'
      region_map:
        comments: '.comments'
        "main navigation": '#block-my-theme-main-navigation'
        "local tasks": '.block--local-tasks-block'
        "main content": '.block--system-main-block'
        "highlights": '.c-highlights__list'

ci:
  extensions:
    Bex\Behat\ScreenshotExtension:
      image_drivers:
        local:
          screenshot_directory: /tmp/artifacts/screenshots
    Behat\MinkExtension:
      base_url: http://localhost


texts: Apply conditionally an image style on an User Profile page

texts: At the moment the module “Image Styles Rules” is only available for drupal 7, is there another  way to apply conditionally an image style depending on the aspect ratio of the image (portrait or landscape) in Drupal 8? Specifically to be applied to the image profile of an user, on his/hers respective profile page.


texts:
I would appreciate your help in my problem with html tagging or css class in blocks.

I've tried Field Formatter Class and Field Formatter CSS Class modules, but with those I only could add class to Article, Basic page and own types, which doesn't help me as I don't want to add Read more or RSS. When I definied my new content type, I didn't check the RSS box and I did check the full content box, but stil...

So, is there any module to add CSS class or HTML tag to a block. Different tags, of course for every block.

No PHP please.

Thanks,
cs.


texts: How can I show the Sales Report for particular user?

texts:
I use Drupal 7 and the Drupal Commerce module.

My site has 3 roles defined:

Admin, who can publish and unpublish product of affiliate.
Affiliate, who can add the product in the site.
Learner who can see the show the all product and but the product.

My question is related to a learner buying a product which was added by an affiliate:

When an affiliate checks the sales reports, then the report is null.
But when an admin checks the sales reports, then it displays all functionality in the reports.
And a learner can also check the sales reports.

So how can I solve these issues? Why are affiliate sales reports null?


texts: How to use pager_default_initialize with entity field query?

texts:
In order to apply pagination on nodes which get rendered into block, I am using pager_default_initialize method. Basically I have written a query, execute that query and after that write pager_default_initialize() function. But it is not applying limit to content per page. i.e. "paging" is not working.

    $query = new EntityFieldQuery();
    $query->entityCondition('entity_type', 'node')
          ->entityCondition('bundle', $content_type)
          ->propertyCondition('status',1);
  $results = $query->execute();
pager_default_initialize(count($results['node']), 2);

here, the count of nodes is 4 and I want to display only 2 nodes with pagination.

return theme('calender', array('calender' => $output)).theme('pager');

Here I'm using theme('pager') for pagination interface.

Pagination UI is displayed, but I'm not able to put limit "2" to the no. of count of nodes. Any suggestion where I went wrong?


texts:
I couldn't installed new modules/theme, when i try to install it asks for FTP request for server. Here I spell out what I did,

At first, Update manager module was not enabled. As I couldn't find "install new module" link in the module page, I enabled the update manager module. Now, I got "install new module". The problem starts here: In the module's page, it shows some warnings.

  fileowner()[function.fileowner]:stat failed for temporary

When I tried to install a new module (on click "install new module"), it shows warnings as follows.

I found Installing modules without FTP, but I couldn't resolve my issue.


texts:
I have a big problem with Views Bulk Operations and Ctools.

I defined a new button in VBO such as: Print and displays it on
Content View List.
Into the Content View List, I check any rows into View List and
click Print button.
When  click Print Button, show Modal (by Ctools) with the selected content.
Direct to the selected Content page.

My question is, how can I get the value of the selected rows. In this case, I'am not able to use #submit defined into the Print's action (by VBO) to show Modal.
Please, help me!


texts: Table with Add row option for external users

texts:
I am trying to build a training website. If the external user is booking a slot for a training class for 10 people he should be able to add 10 people details like the Name, address etc., at checkout. I am thinking to provide the ability to add each attendee details to the table with an "Add row" option dynamically by the external user.

Is this possible? Do we have any modules for this? I checked with datatable module I didn't find this option. Could anyone please suggest me on this.

Example View:

Thanks in advance!!!


texts: How can I render a block in the sidebar in php?

texts:
I'm using the Zen theme and I'm trying to keep as much in code as possible. I'm currently using context to render the block, but I like my php :)

I'm aware of

$block = module_invoke('views', 'block_view', 'name_of_view_display');
print render($block);

// and this
$block = block_load('views', 'name_of_view-name_of_view_display');
$output = _block_get_renderable_array(_block_render_blocks(array($block)));

which works perfectly in most cases. My page.tpl file says

<?php if ($sidebar_first || $sidebar_second): ?>
  <aside class="sidebars">
    <?php print $sidebar_first; ?>
    <?php print $sidebar_second; ?>
  </aside>
<?php endif; ?>

So, clearly, my $sidebar_second variable is empty. I tried to render the block in a theme_preprocess_page function, adding the block to the $vars['page']['sidebar_second'] array, but no luck so far.

Any ideas?

Thanks,
Brett


texts: HTML tags not supported when sending emails in Drupal 8

texts:
This is my code to sending email

   function hook_mail($key, &$message, $params) {
     $options = array(
    'langcode' => $message['langcode'],
  );

  switch ($key) {
    case 'create_article':
      $message['from'] = \Drupal::config('system.site')->get('mail');
      // $message['headers']['Cc'] = $params['cc'];

      $message['subject'] = 'SUBJECT';
      $message['body'][] = Markup::create($params['message']);
      break;
  }
}

Mails are getting without any issue.But some of the HTML tags are not supporting
Eg: HTML bold,italics....
I have also configured SMTP authentication.


texts:
I have a procedure structure like this in an Oracle database:

procedure overlapping_course (
  v_id  number,
  v_program varchar2,
  v_message_type  varchar2,
  v_user_type varchar2,
  v_language  varchar2,
  v_channel varchar2,
  v_country varchar2,
  v_start_date  date,
  v_end_date  date,
 v_return_val  out varchar2
 )

I am trying to call this procedure from Drupal 7 and I am following this link. My code looks like this:

 $conn = Database::getConnection();
 $saved_class = $conn->getAttribute(PDO::ATTR_STATEMENT_CLASS);
 $conn->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('PDOStatement'));
 $statement = $conn->prepare('call overlapping_course(?,?,?,?,?,?,?,?,?,?)');

$statement->bindParam(1, $id,PDO::PARAM_INT);

$id=1;

$statement->bindParam(1, $program,PDO::PARAM_STRING);

$program='c++';
 -------
 --------

but I am always getting the following error

Fatal error: Call to undefined method DatabaseStatementPrefetch::bindParam()   in C:\Apache24\htdocs\drupal\includes\database\oracle\database.inc on line 655.


texts: Preprocess execution is not where my view is

texts:
I'm trying to create a preprocess function to my custom view. Template is called as expected but my preprocess is called at beginning of html and left my entire page blank.

If I change to default template (views_view_unformatted.html.twig) the execution of theme_preprocess_views_view_unformatted() works as expected, right on my view is. But if change to views_view__custom.html.twig the execution of theme_preprocess_views_view__custom() occur at beginning of html!

This is the normal behavior? Or something is wrong? I just want to create my custom view template and create a preprocess function for it.


texts: How to implement less than / greater than in views contextual filters

texts:
I want to filter my view like

field_opening_hour_start_time > <?php date("g"); ?>

How can I make this happen? The filter criteria does not let me to use PHP and the contextual filter does not let me to use less than (or greater than), but only equal (=) comparison. Is there a way around this? Or a way to use PHP in filter criteria box?

edit. I am using Office hours module


texts: unable to generate images - permissions are ok

texts:
I tried everything and set all folders in files to 777. But I can't generate images.
I work with Drupal 7 and php 5.5.5 as fast-cgi.

Any idea?


texts: Disable jquery.ui.theme.css only for front end?

texts:
I'm using jquery tabs on my page but they loaded some default styles that I didn't want. Thus I removed them with the following code:

drupal_add_library('system', 'ui.tabs');

function mytheme_css_alter(&$css) {
   // List of disabled drupal default css files.
   $disabled_drupal_css = array(
      // Remove jquery.ui css files.
      'misc/ui/jquery.ui.core.css',
      'misc/ui/jquery.ui.theme.css',
      //  'misc/ui/jquery.ui.tabs.css',
   );

  // Remove drupal default css files.
     foreach ($css as $key => $item) {
         if (in_array($key, $disabled_drupal_css)) {
            // Remove css and its altered version that can be added by jquery_update.
            unset($css[$css[$key]['data']]);
            unset($css[$key]);
         }
     }
}

This seems to do the trick, but I also noticed that my backend is not loading it's styles properly. I guess some of it uses the jquery.ui styles.

How can I load these only for the logged in user but not for


texts: Migrate from WordPress (with buddypress plugin)

texts:
I have a Wordpress 3.2.1 site with many users, and BuddyPress plugin installed. I want to move all the users and profile fields, the BuddyPress comments, and the blog content into a fresh Drupal 7 website.

What is the easiest, or best way to do this?


texts: Enable admin theme in my install profile

texts:
Is it possible to enable an admin theme in my install profile?

Used this:

// Enable themes
  $enable = array(
    'theme_default' => 'geoslate',
    'admin_theme' => 'adminimal_theme',
  );
  theme_enable($enable);

  foreach ($enable as $var => $theme) {
    if (!is_numeric($var)) {
      variable_set($var, $theme);
    }
  }


texts:
taxonomy CSV import
  How do use taxonomy CSV import the Chinese characters in linux ,Now I import all is empty
Thank you for your help me to answer


texts: fonts not applied to high ASCII characters

texts: After installing the @fontyourface module and adding some Korean fonts locally, the fonts are not being applied to high ASCII characters (which makes no sense as the font is specifically for those characters). The fonts ARE applying to the regular ASCII characters, though.


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

texts:
Given:

A view with some field
A field with referenced entity on user entity, named: assigner
A filter on the field assigner

How i can filter by a list of user? if i apply the same filter on Authored by it works.

The only option view edit form shows me is a filter on text base input.


texts:
I am using Views-7.x-3. I have a master view and many content panes views under it. Recently I have a requirement in which I have to create attachment for one of the content pane view. When I clicked on adding an attachment it cloned the all the formats, fields, filter criteria etc from the master display, which I do not want as I want to have same copy of the my content pane view as an attachment which has many addition fields, context filter as well.

My query: Is there any way to clone desired view as attachment rather re-creating same fields again?


texts: How to run validation on hitting the submit button for exposed views filters. Currently it runs on first page load

texts:
I am trying to add validation errors to exposed views filters (drop down lists) in block region. However, my validation error runs on the first page load before I hit apply button.

Also the validation doesn't run on hitting the apply button as the validation function has already been run on first page upload. I have also tried 'views->advance->views exposed forms->input required, but no luck.

I think its a known bug in exposed views filters.I have been trying to sort this issue for last three days and went thorough several discussion forums. I will be grateful if anyone can share a patch or guideline through which I can have my validation function run only when apply/submit button is clicked. Here is my code:

/**
 * Implements hook_form_alter().
 */
function custom_forms_form_alter (&$form, &$form_state, $form_id) {
    switch ($form_id) {
        case 'views_exposed_form':{
        $form['#validate'][] = 'custom_forms_views_exposed_form_validate';
        break;
        }
    }
}

/**
 * Validate views exposed filters in the block region.
 */
function custom_forms_views_exposed_form_validate ($form, &$form_state){
    $value = $form_state['values']['field_number_of_bedrooms_value'];
    if ($value == "Select any"){
        form_set_error ('field_number_of_bedrooms_value', t('You must select valid numbers of bedrooms.'));
    }
}

Note:  The value 'Select any' is a node field value with no results. I created it to be used as a default value that displays no results on first page load. I even changed the default value to '-Any-' from views interface, but no success. All the fields are set to 'Required' and the exposed form also has 'Reset' button


texts: Location / distance based calculated field in views results?

texts:
Modules in use:

Drupal 7.12
Views 3.3
Location 3.x-dev
(and lots more of course)

I have a pretty standard view which has a user entered proximity filter for distance from a zip code, used to shows stores near a certain location (your standard dealer/store locater search). I would like to add a calculated field (or something) to show how far each store is from the entered zip code. This field would only be used in the view, and would not need to get saved to the node it represents, since this distance will change depending on the entered zip code.

Can anyone point me in the right direction?

Thanks!


texts:
How can I hide the 'configure block' mouseover from appearing? Im using the Omega theme.

Its breaking parts of my site but I cant stop it from appearing with permissions as certain users need the permission to edit blocks.


texts:
Is it possible to create a normal content page in a module? At the moment I only know the $form type. But I need to add a page with some statistics.

Or is there a way to add normal content to a hook_form?

At the moment I have:

.module file:

$items['admin/config/services/push_notifications/stats'] = array(
'type' => MENU_SUGGESTED_ITEM,
'title' => 'Push messages stats',
'access arguments' => array('Push messages stats'),
'page callback' => 'drupal_get_form',
'page arguments' => array('push_notifications_stats_form'),
'description' => 'Push messages stats',
'file' => 'push_notifications.admin.inc',
'file path' => drupal_get_path('module', 'push_notifications') . '/includes',
'weight' => 80,
);

And in the .admin file:

function push_notifications_stats_form($form, &$form_state) {
$form = array();
$id = $_GET['id'];

$form['id'] = array(
'#type' => 'item',
'#title' => 'Application ID',
'#description' => t('The application ID you are viewing: @appId', array('@appId' => $id)),
);

return $form;

}


texts:
Drupal7, Varnish 4.0, Ubuntu 12.4

Varnish is installed an working, but returning intermittent 503, I think whenever Varnish goes to the backend.  Even though the request returns 503, a page refresh may return 200, HIT from cache.  Another refresh may be 200 or 503.  I think a subsequent 503 is a HIT-FOR-PASS.

We've opened up the timeouts, as follows:

vcl 4.0;
backend default {
.host = "127.0.0.1";
.port = "8080";
.probe = {
.url = "/ping";
.timeout = 600s;
.interval = 600s;
.window = 5;
.threshold = 2;
}
.first_byte_timeout = 900s; # How long to wait before we receive a first byte from our backend?
.connect_timeout = 500s; # How long to wait for a backend connection?
.between_bytes_timeout = 200s; # How long to wait between bytes received from our backend?
}

So I suppose it's not that Varnish is timing out in a blink of the eye.

Probably the problem is in the vcl; this is what I'm using:
https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/blob/master/default.vcl

Here are fragments from the varnish log for 3 successive calls to the same page: 503, then 200, then 503 again:

First call - returns 503
-   VCL_call       BACKEND_FETCH
-   VCL_return     fetch
-   FetchError     no backend connection
-   Timestamp      Beresp: 1408509130.524000 0.000219 0.000219
-   Timestamp      Error: 1408509130.524013 0.000232 0.000013
-   BerespProtocol HTTP/1.1
-   BerespStatus   503
-   BerespReason   Service Unavailable
-   BerespReason   Backend fetch failed
-   BerespHeader   Date: Wed, 20 Aug 2014 04:32:10 GMT
-   BerespHeader   Server: Varnish
-   VCL_call       BACKEND_ERROR
-   BerespHeader   Content-Type: text/html; charset=utf-8
-   BerespHeader   Retry-After: 5

Page refresh - Returns 200 from the cache
   VCL_return     hash
-   VCL_call       HASH
-   VCL_return     lookup
-   Hit            2147745802
-   VCL_call       HIT
-   VCL_return     deliver
-   RespProtocol   HTTP/1.1
-   RespStatus     200
-   RespReason     OK

Another refresh - returns 503 again.

VCL_call       HASH
VCL_return     lookup
Debug          "XXXX HIT-FOR-PASS"
HitPass        2147811368
VCL_call       PASS
VCL_return     fetch
Link           bereq 196777 pass
Timestamp      Fetch: 1408509419.224633 0.000666 0.000666
RespProtocol   HTTP/1.1
RespStatus     503
RespReason     Backend fetch failed

Any clues on getting the vcl correct appreciated.


texts: View of Taxonomy with titles above the terms

texts:
Does anyone know if I have a view of a Taxonomy Vocabulary - How do I get titles above all the term results?  Here is my page:
http://64.34.70.141/~henryl/bloom-size
I'd like to have titles like this website:
http://demo.commerceguys.com/ck/collection/drink
But I can't figure out how they've added the titles - I've tried to look through the view selections of the site but I can't get mine to match.
Can anyone help?
Thanks!


texts: How do I store custom block content as configuration?

texts:
I'm creating custom pages using Pages + Layout Builder. These layouts need to be stored in GIT as config files (drush cex). Currently, the layouts themselves are stored fine.
The main problem is that custom block contents are stored in the database and if someone clones the repository and applies changes using drush cim, they are missing the block contents.


texts:
I'm trying to use Drupal.settings for the first time to pass variables from PHP to JavaScript. The documentation on the topic is sparse and I have a few issues.

Is it possible to use #attached to pass through the settings rather than drupal_add_js(array('myModule' => $settings), 'setting');? The reason I am asking is that I've been told that #attached is the "correct" way to add settings. ( I know it is also the correct way to add files also, but not sure if it works with settings variables.)

I'm using the following code, but I can't get it to load under the DOM objects and I am stuck.

(function ($) {
   Drupal.behaviors.myModule = {
     attach: function(context, settings) {}
   };
});(jQuery);

Any advice would be greatly appreciated. Please bear in mind that this is the first time I've set out to use Drupal.settings, so every detail is welcome and appreciated.


texts: Change position of Drupal ajax progress throbber

texts: When you are using views built in ajax pager. When you click on any element of the pager ajax throbber appears next to the clicked button. Can i change the location of the throbber, for example outside of pager div?


texts: Make website visible only to registered users - create invitation system to allow registration

texts:
So, my problem is two-fold:

I want to have a beta version of my website that I'll make available only to some friends, but I also want to give those friends the option of inviting other friends through some kind of invitation system (e.g. like Gmail did it back in 2004 when it first started).
I need to deny access to all content of my website if someone does not have an account.

So, ideally, I want to have a front page with a simple logo and a login form along with some text that allows the guest to enter an email address and be notified about the site going live (or get in some kind of queue). Of course, I also want to keep track of these requests/subscriptions.

So, is there a solution for this kind of functionality in Drupal? I guess I could write custom code and/or use extensive theming to achieve all these goals but I was wondering if there is a ready-made combination of modules that I can use and I'm obviously missing.


texts: How to trigger module install file ad hoc

texts:
I am developing an install script for a custom module, but I can't figure out how to trigger the script once it has already been run once. I know that install scripts are by design intended to only be run once, but what do you do when you need to debug an install script?

I'm running Xdebug so I would prefer if I could trigger the script from the browser UI somehow as opposed to Drush, which will not pause for the debugger.


texts: Perform action when new user verifies email link

texts:
I am looking to catch the event when new user updates password after clicking on link in the email, right after one time login.

I actually want to perform an action right after user sets password after validating/clicking on one time login link in welcome email.

I have gone through this: Is there a hook after user confirmation?

However, it does not solve my problem as explained below:

I used this condition to check if user is just created:

if ($account->uid // user is not new && $account->status === "0" && $edit['status']==1)

The issue with this is it holds usable for me in case if admin approves pending creation. In my case I don't want admin to approve, i want drupal to send email to user for confirmation. According to my workout, when admin approves, then above condition works, because status is changed from 0 to 1 so i can do some work at this change. But without admin, when user creates account, it is automatically activtaed, so I can't grab with this condition to perform my work at this event.


texts: How to use ctools modal to popup some fields of a node on node view?

texts:
I want when a user is viewing a node, some of the node fields will be shown as a popup (without any buttons). How can I do it?

Thank You!


texts:
I need to set some classes in page.html.twig based on page type (node, view, etc..) and if possible in more details (node type 'article', view 'blog') etc.

some ideas how to do this? I can't figure out how to get that done in page.html.twig?!

thank you!
Matthias


texts: List recent posts of a specific user in a Views block

texts:
I'm trying to output a list that shows the 12 latest 'Articles' of a specific user. This list needs to be in a sidebar that is located on the frontpage.

In this sidebar visitors can click a thumbnail at the top to view some info about the author (a registered Drupal user). There's the full name, with a short bio and a picture. But there also needs to be that list that shows the user's latest articles.

So far I'm not be able to get this list to work because I can't make the list for that specific user exclusively. I found some tutorials that kind of tries to achieve the same (like this one) using the contextual filter in Views. But so far, none of them works.

I've included a screenshot of the sidebar so you have an idea how I set it up. The block in the sidebar is a View and are all User fields.


texts: How to update entity value programatically after submitting the form?

texts:
I try to update automatically entity title after form is sent. I tried that in form_alter, but everybody guided me to use entity presave. I cannot manage to save the updated title however (please see comments below in the code).
function discount_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {
  if (!empty($entity->toArray()['product_id'][0]['target_id'])) {
    $title = $entity->toArray()['title'][0]['value'];
    $product_id = (int)$entity->toArray()['product_id'][0]['target_id'];
    $product = \Drupal::entityTypeManager()->getStorage('commerce_product')->load($product_id);
    $events_dates = $product->get('event_date')->getValue();
    $count = count($events_dates);
    if (empty($events_dates[$count-1])){
      $count = $count - 1;
    }
    if ($count > 0) {
      $start_date = date("j/n/y", strtotime($events_dates[0]['value']));
      $end_date = date("j/n/y", strtotime($events_dates[$count-1]['end_value']));
      if ($count == 1) {
        $count_suffix = "zjazd";
      } else if ($count == 2 || $count == 3) {
        $count_suffix = "zjazdy";
      } else {
        $count_suffix = "zjazdów";
      }
      $date = $start_date.' - '.$end_date.' ('.$count.' '.$count_suffix.')';
    }

    /* if I kint($title.$date) here it gives me a proper value, so only the code below doesn't work */

    /* this code below doesn't update the title regardless if there is $entity->save() later on or not */
    /* I tried these 3 options below, none of them updates the title */
    $entity->title->value = $title.$date;
    $entity->setTitle($title.$date);
    $entity->set('title', $title.$date);

    /* When I do kint($entity->toArray()); here I can see the updated title, however it doesn't save it later do database */

    /* this line below causes endless loop, when it is commented it also doesn't save the title */
    $entity->save();
  }
}


texts:
I am building a online purchasing system, and I use a Webform to gather clients' personal information.

A problem rises when I want to append some external data (which is not important enough to be included as a field in my registration form) to the webform before the submission.

What should I do? (I used hook_webform_submission_presave(), but it seems to me that it can only be used to change data, not adding additional data.)

Here's my presave hook; it works, but it's not serving my purpose.

function hook_webform_submission_presave($node, &$submission) {
  // Update some component's value before it is saved.
  if ($node->nid == 0) {
      $component_id = 1;
      $submission->data[$component_id]['value'][0] = 'foo';
  }
}


texts: Drush command to check if Drupal is installed?

texts:
Is there any way to use Drush to determine if Drupal is installed, and have it return true or false? The boolean output would be used elsewhere in a bash script's logic.

Bonus: it needs to work for both Drupal 7 and Drupal 8.


texts: Popup dialog window based on selection in radio select list?

texts:
Use case:

A radio select list with Option A and Option B.

When User selects Option A, a popup appears with specific "A" message to verify the selection before User saves the page.

When User selects Option B, a popup appears with specific "B" message to verify the selection before User saves the page.

Suggestion on how to develop this? Hoping there's a module.


texts: How to use summary field conditionally for display?

texts:
I have created a content type Band with a Description field (as Long Text and Summary). When I am viewing the Band page, I want to see the full description field. And when I am viewing a listing of bands, I want to see a summary description or the first hundred characters if the summary description is missing.

How do I show appropriate Description for the Band page and the listing pages?


texts: Database table cache_views_data is extreme large, what size is normal?

texts:
I have a Drupal 7 site with ~70,000 nodes and ~500,000 terms. During some investigations for the cause of substantial performance problems, I found out that the database table cache_views_data is about 18 GB big.
Is this normal?

UPDATE: I am using time based and contend based (Views content cache) caching.


texts: Letting a view know in which pane it's being displayed

texts:
I've got a very non-trivial question on integrating Panels and Views. Maybe there's no solution out of the box, but I would really appreciate any help.

Essentially, I've got a lot of tagged nodes. For simplicity, let's say image nodes that are tagged as "flowers", or "animals", or "mountains", etc.

Then I have a view block that displays the images depending on their tag. This view block is then used in panel panes across the website.

Here's the issue: I can't use the URL to pass the tag information. In fact, on the same web page, I need to show several blocks (within panel panes) with different sets of images. One block would show "animals", another one "flowers", etc. And that depends only on the panel pane in which the view block is being displayed.

Of course, I could just create several preset view blocks, one only for "animals", another one for "flowers" etc, but I've got tens of different tags and can't create a separate block for each tag. So I was thinking of a more elegant solution.

Here's what my idea is: when I add content to a panel pane, I've got an option to override the title. I was thinking of adding another text field there "Tags to display" where I would say "flowers", or "animals", etc. Then I would just add the view block to the pane and that view block would pull that tag from the panel pane.

So, bottom line: how can I let the view know in which panel pane it's being displayed? Just pane ID would be enough, the rest (the tag to use) I could simply pull directly from the database.

Thanks for your ideas.


texts: Using Highlight Module with Default Search Module

texts:
I'm trying to use this highlight module to highlight search terms on my site but can't seem to get it to work. I'm using Drupal 7, the basic search module that comes with Drupal, and Views to display the search interface (and results).

I think the main issue has to do with inputting a correct JavaScript syntax (regex) for local searches but the example given in the screenshot on the module page (linked above) only shows regex for apache solr and I'm wondering if anyone know what I should use for the default search, or if its even possible?

Note: I've already changed the 'Highlight area' option on the highlight module configuration page to .search (which is the body class for my search view).


texts: Testing Email locally? Could i reroute email to watchdog?

texts:
I'm trying to debug how an email invoice looks in ubercart locally. Mail is not configured on my local machine (ubuntu 11.10).

I really would prefer to debug this locally without sending nagging emails to the stakeholders.

Is there anyway to reroute email output to the watchdog log?


texts: How can I get Panelizer to link my panels to a specific URL instead of the Content option?

texts: This is the page that is shown when I configure a panel. How do I link the image to some other page than the content page? I am using Drupal 7. I think this question would benefit others who wish to link their images to other URLs when using Panelizer. I tried using the panels image link module, but I couldn't find any documentation and it didn't seem to do much.


texts:
This is an age-old debate in Drupal, and I am surprised this has not been asked before on Drupal Answers. Maybe I missed it.

By default, Drupal form labels are always displayed at the top of form elements.

How can I display form element labels to the left (or right) of the element, instead of at the top?

I am talking about entity edit forms, but also other forms.

I am sure I will find a solution with hook_form_alter() or on the theme layer. But the question is, what is a convenient and maintainable way to do this?

I am personally working with Bootstrap theme, but a generic answer is preferable, so others can benefit too.

EDIT: It also would be nice to have an elegant way to control which forms this should apply to, and where it should not. Since I added this later, it should be considered optional.

UX background

The main argument for labels at the top is that they are supposedly easier to read. E.g. here, http://www.wunderkraut.com/blog/why-top-aligned-labels-are-better-in-drupal-forms/2010-12-28

I personally think this is an answer to the wrong question. The form labels might be easier to read this way. But if you look at a pre-filled form, e.g. when editing an entity, then usually the field values are far more interesting than the labels. Often the labels are already evident from the field value. E.g. a street name looks like a street name. An email looks like an email.

And of course with labels on the side the form will look more compact and less cluttered, and more of it will fit "above the fold".

Another design option would be in-field labels. But with these, the label is completely gone when the field is filled out. You may still want the labels to make sure that every value is in the correct field.

So having labels on the side is a valid design goal..


texts: How to filter content "by year, by author, by paper type" in Publication kind of page?

texts:
I am beginner in Drupal.

I am creating page named as "Publication Papers".

On this page, content is coming from different database other than main one.

So I created different template for this page and then fetched data directly from specific database.

But now in that page I would like to add filters such as,

"By Author
By Year/Month
By Type of paper"

These are actual fields in that database.

So publication is just a basic page of drupal in which content is coming directly from specific database.

Ask me if you need more information regarding this.

Thank you in advance.


texts: How can I override the container.html.twig template for one submit button only?

texts:
How can I override  container.html.twig for one submit button only?

It showing no template suggestions.


texts: Drupal fancybox views gallery - display only first item of attached images

texts:
I have multiple images attached to a node that act as a gallery using fancybox.
In views I am attempting to only display the first attached image.

The idea is to only display the first image then when clicked, fancybox will go into gallery mode displaying all subsequent attached images.

I have tried the 'Group multiple values' showing '1value' starting from 0.

This works for only displaying the first item, but unfortunately when clicked fancy box does open but not in gallery mode. It just displays the first item.

What i need to do its open all attached images as a fancybox gallery but from only the first item.

Any help or ideas would be much appreciated.


texts: Change the way "add content" and "node's" are displayed

texts:
I was wondering how one would go about changing the layout of the nodes when you are adding content, as well as when you view the full story.

I want certain text to be bigger, some fields to be placed side by side, some vertically. I want full control over the layout. I tried editing the CSS to change fonts and colors but it all changes fonts for the enitre website and not just in the node view. any thoughts?


texts: Alter all images styles to add a particular effect before all others?

texts:
I just downloaded the manual crop module: https://www.drupal.org/project/manualcrop

It must be added as an image style effect before it is applied.

I would like to apply it to all image styles before others are executed.

Is there any hook_preprocess_image_style that can add an effect to the stack before others are processed?

Or anybody have any other good ideas about how to do this programmatically other than manually adding the style?

Thanks!


texts: Create link with 'name' attribute only using l() function

texts:
Is it possible to create a link using Drupal's l() function without an href? For example, I'd like to create a link like the following:

A link here

However, this seems to not be possible. The closest I can come is to use the following:

l(t('A link here'), '', array('external' => TRUE, 'attributes' => array('name' => 'my-anchor')));

This outputs:

A link here

... and that's not valid HTML. It also causes slightly strange behavior in some browsers depending on the CSS applied...


texts: How to get a two layer sort with a taxonomy term relationship and avoid duplicates in a user view

texts:
I have a user view, that needs to list users, sorted by the weight of an taxonomy term associated with the user via an entity reference field and added as a relationship in the view.  Once I've sorted by term weight, I next need to sort by the family name field of the user.  As soon as I add the second sort I start getting duplicates.  How can I accomplish the sort I need without the duplicates?

Turning on aggregation and grouping by the sort AND adding distinct to the query settings works in my simplified version of the view, but once I add in the other things the view won't load with aggregation on.

Update: I thought I had it simplified as far as it could go, but it turns out the relationship has nothing to do with it.  I get duplicates just be adding a sort of family name.  Curiouser and curiouser.


texts: Undefined index errors when running cron.php

texts:
I am getting a slew of errors when I attempt to run a cron job following my hosting company's instructions. From researching the errors, I suspect the instructions are wrong. But their support is telling me this is a development issue and they can't help me. So I hope someone here can tell me the correct way to run cron in this environment.

The site is running without error. Cron runs successfully by using "admin/reports/status/run-cron" or by using the URL provided for running cron from outside the site.

The instructions say to use the following command:

cd /home/username/public_html && php /home/username/public_html/cron.php >/dev/null 2>&1

This fails silently, meaning that nothing happens that I can see, but the status report does not indicate that cron has run. So I removed the ">/dev/null ..." part in order to allow the system to send me a result e-mail. Thus the command I'm using now is:

cd /home/username/public_html && php /home/username/public_html/cron.php

When this command executes, I get an e-mail with hundreds of errors, mostly like:

Notice:  Undefined index: argc in /home/username/public_html/includes/bootstrap.inc on line 3407
Notice:  Undefined index: SCRIPT_NAME in /home/username/public_html/includes/bootstrap.inc on line 1622

I found a forum post about the same kind of problem, and the offered solution was to "Use a URL to cron.php with wget or curl." Unfortunately, my Unix is rusty and I don't know how to do that.

Can someone suggest how to modify the command in the host instructions so that cron will run correctly?

Thanks for your help.


texts: Is there any module, or a way to get a user blog in a separate sub-domain, such as user1.example.com for user1, and user2.example.com for user2?


texts: Drupal8 Oaut2 add a grant type “password” to client

texts:
I work on Drupal8 project and created Rest API, everything works fine until I want to add Oauth2 when I try to get a token I got an invalid grant type error.

This is the error code:

{
    "error": "invalid_grant",
    "message": "The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.",
    "hint": "Check the configuration to see if the grant is enabled."
}

This is the url that i called:

http://myserver/oauth/token?grant_type=password&client_id=6db9da8d-b831-4381-b279-381bc5a57e90&scope&username=webmasterrest&password=webmasterrest&client_secret=$S$EamACyfemGWic74kmkwUvphMmr9FL132KC297mI1GEkTKhyBJyAo

I added a client, but I can't add a grant type "password" to this client, any help please?


texts: Send message notification when license expired

texts:
I have a commerce site where I sell subscription using the Commerce License module. I want to send email notification to users whose licenses will expire soon.
I'm trying to do that by creating a custom module. I have 2 code snippets, one to notify users when the license expires, the second to send email using the Message Notify module.
I don't know what variables I should use to have the licence owner's.
This is my custom module and the code works well for me.
    /**
     * Implements hook_cron().
     */
    function license_notif_cron() {
      $expires = strtotime('-1 day');
      $query = new EntityFieldQuery();
      $query
        ->entityCondition('entity_type', 'commerce_license')
        ->propertyCondition('status', COMMERCE_LICENSE_ACTIVE)
        ->propertyCondition('expires', 0, '<>')
        ->propertyCondition('expires', $expires, '>');
      $results = $query->execute();
      if (!empty($results['commerce_license'])) {
        $license_ids = array_keys($results['commerce_license']);
        drupal_set_message('licensce expires soon');
        //send message
      }
    }

This is an example of sending a message. I am not interested in hook_node_insert(); I already created a new message type (licence_expire_soon).
/*
 * Implements hook_node_insert().
 */
function foo_node_insert($node) {
  $message = message_create('foo_message_type', array('uid' => $node->uid));
  $wrapper = entity_metadata_wrapper('message', $message);
  $wrapper->field_node_ref->set($node);

  $options = array(
    'rendered fields' => array(
      'message_notify_email_subject' => 'field_rendered_subject',
      'message_notify_email_body' => 'field_rendered_body',
    ),
  );

  message_notify_send_message($message, $options);
}


texts:
Does Drupal 8 support referential integrity? Can I tell Drupal what it should do if a parent row in a content type is deleted? For example:

I could tell Drupal not to allow the deletion of a parent row if it has child rows
I could tell Drupal to delete all child rows that belong to a parent row when that parent row is deleted

By row I mean an item of a content type. For example, if the content type is Book, a row is the data about one book.


texts: Update a view page content without refreshing the page

texts:
Is there a module that updates a view automatically when it is changed, without refreshing the view page?

For example, when a new node is added to the view or deleted from the view, or a node is edited, the view is automatically updated without refreshing the page.

What is the best way to do this?


texts:
I'm trying to create a block which would include informations on the displayed node like author picture, name, and points (using Userpoints module), the creation date, and some other infos contained in created fields for certain types of nodes.

The thing is that I want to display this block in my sidebar-second (my theme is based on bartik, except that sidebar-second is included in the

).

But I don't manage to use variables available in files like node.tpl.php. For instance, when I try to display the author picture in the block, I write <?php print $user_picture; ?> but nothing appears...

Here's what I created on photoshop and I'd like to translate into Drupal (if it can help, and yes it's in French ^^) :

Thks !

EDIT : I'm using D7.

EDIT by nyoz :
Ok, so it seems like Multiblock is a good beginning. README.txt says the following :

  DEVELOPING MULTIBLOCK-ENABLED BLOCKS:
  Multiblock should successfully clone
  any regular block created with the
  block API. However, if you clone a
  regular block that implements a
  hook_block_save or
  hook_block_configure hook, the custom
  block settings of one block instance
  will overwrite the settings of
  another. To get around this, you can
  make a block "multiblock enabled." To
  do this, you should add a 'mb_enabled'
  key with a value of true in
  hook_block_info to each multiblock
  enabled block you are creating. Next,
  add an optional $edit argument to your
  hook_block_view and
  hook_block_configure functions. Once
  you do this, the instances you create
  will get the block instance ID passed
  in the $edit variable for the view,
  configure, and save $ops. This will
  let you save and load different data
  to different instances based on this
  instance ID. It is passed in with the
  'multiblock_delta' key with the
  following format:
  $edit['multiblock_delta'] = array(
            '#type' => 'value',
            '#value' => $block_id
        );

  Example implementation of
  hook_block_info: function
  hook_block_info() {
  $blocks['powered-by'] = array(
      'info' => t('Powered by Drupal'),
      'weight' => '10',
      'cache' => DRUPAL_NO_CACHE,
      'mb_enabled' => TRUE,   );   return $blocks; }

... So, I created a custom module containing :

function hook_block_info() {
  $blocks['content'] = array(
    'cache' => DRUPAL_NO_CACHE,
    'mb_enabled' => TRUE,
  );
  return $blocks;
}

I've also tried $blocks['main'] $page['main'] $page['content'] -with return $page-. BUT NONE OF IT WORKED (the block is still not multiblock enabled when I look in the instances list).

DO YOU HAVE ANY CLUE PLEASE ? Thks!


texts: Production web site is breaking sometimes

texts:
My production site (Drupal 7) is breaking sometimes. It seems the styles are not taking. all the images & text not aligned well. It will work perfectly when we clear the cache. In this site, we have used Boost Beta version module & cache expiration module. This site contains lot of images. It is a dynamic site.

Is it the problem with Boost? In some site it is saying that need to check the Bandwidth optimization (Aggregate and compress CSS files & Aggregate JavaScript files). I didn't check that. Some times there is no problem. sometimes it breaks. This is happening only for anonymous user.

Anyone please help me?


texts:
I tried uninstalling Quick edit via the user interface.

I cleared the cache via drush cr, but it doesn't work.

How can I disable it?

Even drush en -y quickedit and drush pmu quickedit don't work.


texts: Drupal feeds module causing high cpu usage when pulling feeds

texts:
I am using the Drupal Feeds module to download the feeds from an external site. I have setup a dedicated content type to pull the feeds and then created nodes of another content type for the individual feed items.

After updating the site recently I noticed that the site was using the CPU continuously so much so that the hosting tech support notified me about it.

I proceeded to limit the frequency with which the feeds were being pulled but the CPU usage remained constant and I was finally forced to disable cron.php.

This never happened before the update.

Checking the dblog I noticed that the JobScheduler initiated the feed pull (I had set the watchdog to print the title of each node being created) and was repeating this scenario every minute 24x7.

I have not figured out what is causing this issue or from where to start?

Any possible solutions guys?

Site runs on Drupal 6.


texts: How can I use postsave method extending WebformHandlerBase for submitting to account fields

texts:
I created a webform handler class extending from WebFormHandlerBase: The method, postsave has the following code:

public function postSave(WebformSubmissionInterface $webform_submission, $update = TRUE) {
    $account = \Drupal::currentUser();
    $user = \Drupal\user\Entity\User::load($account->id());
    $user->addRole('example');
    $user->save();
  }

A boolean and photo value are submitted by the webform submission.  I need to submit the boolean and photo to account fields.  How do I do it?


texts: I used drupal_add_js() to add a jquery plugin, but there is an error TypeError: $ is undefined at console of firebug. So how should I add the js?


texts:
I need to have have something like this:

....

My CCK Image field name is filed_image.
In page.tpl.php I have the following code:

    <?php foreach ((array)$node->field_image as $item) { ?>

<?php print $item['view'] ?>

    <?php } ?>

So with this I am able to print all images form my Image Field.

But I don't know how to dynamically change the value of id="r1", id="r2", id="r3" ....

That value must start from 1 and be auto increment. For example  if I have 3 images the id should be id="1", id="2", id="3" or If there are 10 images I need id from 1 to 10.


texts: Force `` to scale to text field in the views-ticker module

texts:
The Views Ticker module can create a vertical scrolling feed of content. There is an assigned height to each <li> based on the content item that takes up the most space. In my case, it sets the height of each <li> to 72px. Instead of assigning it a definite value, I want the size of each <li> height to scale to the size of the content as opposed to a fixed content.

I've attempted to overwrite it with CSS by setting the height to AUTO but it doesn't work.

If you have a recommendation for another module to use that will scroll content like the ticker does, please post.


texts: included files are missing in entityreference module

texts:
I'm using D7.

I've just setup Recruiter Features module with bunch of dependent modules, on my existing website. It seems Recruiter module is working fine but now I'm getting strange warnings about missing files in Entityreference module and vast majority of my views are not showing up on the website:

  Warning: include_once(/home/mysite/public_html/sites/all/modules/entityreference/entityreference.views.inc)
      [function.include-once]: failed to open stream: No such file or directory in theme()
       (line 957 of /home/mysite/public_html/includes/theme.inc).

  Warning: include(/home/mysite/public_html/sites/all/modules/entityreference/views-view-unformatted.tpl.php)
      [function.include]: failed to open stream: No such file or directory in
      theme_render_template() (line 1397 of /home/mysite/public_html/includes/theme.inc).

The strange thing is that entityreference.views.inc file is acctualy located in .../entityreference/views/ folder.

To remedy this I just moved entityreference.views.inc to .../entityreference/ folder. I also created blank views-view-unformatted.tpl.php file and put that file to .../entityreference/ folder.

That worked, I'm not getting any warnings, my views are working, but I'm not happy with that solution. Just want to know why is this happening and how can I fix it properly without hacking the module?


texts: How to print node embed field in field collection

texts:
In one of my content type i am using field collection(Title, Image, Body).
I am using node embed to embed node titles of certain content type in one of my content type.
The issue i am facing is that whenever i am embedding a node it is not showing title instead of it displays [[nid: 2]].

I am printing individual field collection item, to print body i am using

 $section_desc =  $field_section_content_info[$section_content_id]->field_section_body[LANGUAGE_NONE][0]["value"];

i want node title to be displayed instead of [[nid: 2]].
what code should i write to display node title in field collection.


texts:
I have a template that I am trying to convert into a custom theme and it contains a mobile menu that is a duplicate of the main menu.

What is the best way to tackle this with the least amount of duplication?

I tried to create a menu--main.html.twig file and repeated 2 menus in one file.  It looked liked it worked at first until my menu contains submenus and then some weird behavior where it nested both menus into the below menu.  I would like to avoid creating a separate mobile menu in the admin dashboard and manually adding new links if created, but if that is the best way then I can handle it.  Just looking for other opinions.

Thanks


texts: Can I give a role permission to configure one (and only one) block?

texts: Right now, I see that the administrator role has a premission called administer block. I would like to offer that permission to another role, but only for a specific block, not all of them. Is this at all possible?


texts:
I have a Temp webform with 2 fields, I have rules set up to, on webform submission, create an entity and then set a data value for the 1 field in my temporary content type.

Here is the rule. I have done this exact same thing on another site. The rule creates the entity successfully and pulls the title from the webform submission value of the title field, then when it moves down to setting the data for the second field in the content type it breaks. I am using [data:{component}-value] and replacing {component} with the machine name of the webform field, like I did with the title except it isn't assigning the content field the value I typed and submitted into the webform. Even using the same exact token as i did for the title it does not work. If i used a static just "asdf" to assign to the field of the content type that works, but it will not pull anything from the webform. Any ideas? I'm stuck here.


texts: How to display a block for pages that don't show nodes?

texts:
My Drupal 7 module creates a block, and then in admin I can make it available for the Article content type only. I would also like it to be available to the result page for a Product Search. This page is not of a normal content type and comes to life in hook_menu().

The path for the results will be avantlink-search-results/search term and I would like it to show the block with the search form again. I would rather not use the PHP code option in the block visibility options so as to keep it simple for users of the module.

The code is viewable on AvantLinker.


texts: Strategy for deploying Panels with features

texts:
I've been exporting Panelizer configuration to features and pushing up to production.  My strategy so far has been:

Config is created on local and pushed up via features
Content, such as Fieldable Panels Panes instances are created directly on production.

However, this is now causing issues.  When I revert a Panel/Panelizer feature, it reverts back to my local settings and removes any content panes I've added on production.

A couple of ideas I have for managing content panes:

Use UUID features to push up any content panes.  Trouble with this is that the content panes are now in the dev/stage/live workflow and any changes on production will be reverted with the next drush fra.
Pull down a fresh copy of the database before doing any further edits to a feature, that way when a feature is recreated on local, it will contain the new content panes.

How do you manage content panes when using features?


texts: How to make a discount on specific products quantity that have specific fields

texts:
I'm a bit lost with a workcase.

I'd like to apply a discount to a few line items depending on their quantity and if the product if the line items have some specific fields.

An example will be a bit clearer:
If the user orders at least 10 differents product that share the same field value (let's say 5 different tshirt with the same color), the 10 corresponding line items in the order get a 5% discount.

I'm not familiar with rules.
I tried to make some loop on line items but i'm really in the dark here.

Some advices?
Thanks!


texts: How to keep my Bootstrap sub-theme without using the CDN?

texts:
I created a sub-theme bootstrap version of CDN.

I based on "Journal" version "3.3.6" and I personalized my style.css file with 900 lines.

https://bootswatch.com/

I no longer wish to use the CDN, but I like to keep my current theme "Journal" and my custom style sheet.

How can I do this without using "less"?

What I want is to work with CSS

I asked this question several weeks ago but I still have not found a solution :

Install without Bootstrap CDN

Zuzuesque thank you your solution works, but I am having display problem :

I no longer have the "glyphicons"
The menu bar is not displayed correctly
The admin menu is hidden by the menu bar


texts: Drupal 7 node body content missing from search results

texts:
I am having an issue where my Drupal 7 Search (Custom search installed and enabled) isn't returning all of the results I'd expect it to.

Here is some background...

I'm running Drupal 7 on this site.
I have roughly 10 content types, but the search only returns 2 content types – work and blog.
I am using the core search module along with drupal custom search module.

The Issue:

When I perform a search I am presented with a selection of results from both work and blog content types. However, the issue is while the blog content type produces the expected results pulling from keywords in both the node titles as well as the nodes body content, the work content type only returns results where the keyword is found in the node title.

Attempted fixes:

I have confirmed that the site is 100% indexed. Just in case I have re-built the index.
I went to the Custom Search Module settings to confirm that -Any- is being used in the -Any content type- text field. In addition, in the Content exclusion area I've made sure both the blog and work content types were left unchecked.
I have confirmed that the Minimum word length to index is at 3. My searched words are above 5.
And lastly, two thoughts I didn't know played into the search results, but were worth looking into are the Manage Display settings for both content types under their Search index and Search result highlighting input tabs. Both of which seem to be identical. So I assume wth my limited knowledge of Drupal's configurations isn't really vital to this issue.

I'm still trying other suggestions found here in StackOverflow and will update this as I come across new options to try as attempted fixes.

If anyone has come across this matter and can lead their considerable knowledge on it, that too is always appreciated.

Thanks in advance!


texts: How to display the currently logged in user's details

texts:
I am using D7 and views for one of my projects. I have created a view that displays the name, age, role and orders of the user. I would like these things to displayed only for the logged in user. For instance user/1 should get his name,age,role and orders only, he should not be able to see the other's details. Similarly each and every user must be able to see their own details. I know i can use the uid from the url, but not sure how to achieve this.

Thanks


texts: How to re-generate Node Object from database stored Serialized Node Data .. and then Save as New Node?

texts:
In Drupal 7, for some reason, i am storing some serialize($node) objects into Database. So these data in the database (in text column) are storing like:

O:8:"stdClass":47:{s:3:"vid";s:5:"78629";s:3:"uid";s:3:"523";s:5:"title";s:12:"Sync Node #6";s:6:"status";i:1;s:3:"nid";s:5:"77429";s:4:"type";s:4:"page";s:8:"language"; ..... etc

Now how can i transform these data back into Drupal $node Object please?
Then how can i node_save($node) (as new node) upon them? (What tricks will i need?)

Any idea please?