texts: How can we find the id of the parent form in preprocess_HOOK() or HOOK_alter() theme functions?

texts:
I'm working with an entity-creation form that needs some extensive theming. So far this has required me to alter template suggestions and create (twig) template variables for fieldsets. I've used template_preprocess_fieldset() and hook_theme_suggestions_fieldset_alter() to do this.

The suggestions and variables I'm creating are specific to one entity type, so I'd like to use the form id or the entity type to limit the action of the functions above, but the variables available within the scope of the functions don't include information outside the scope of the fieldsets themselves--in other words, I can't find out what form the fieldsets belong to.

Is there a way, in the context of a theme's preprocess_HOOK or HOOK_alter functions, to get information about the parent form?

I'd neglected to mention that I'd unsuccessfully tried @Berdir's two-part solution:

Set some value in hook_form_alter()
Access that value in hook_template_suggestions_fieldset_alter()

Going back at @Berdir's suggestion, I cracked it (thanks!)
In Drupal 8, this combination works for my specific issue (and should work for other implementations of `hook_theme_suggestions_HOOK_alter() as well):

/**
 * Implements hook_form_alter().
 */
function themename_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  switch ($form_id) {
    case 'some_specific_form_id':
      foreach ($form as $key => $value) {
        if (strpos($key, 'field_') === 0) {
          $form[$key]['widget']['#parent_form_id'] = $form_id;
        }
      }
      break;
  }
}

/**
 * Implements hook_theme_suggestions_HOOK_alter().
 */
function u2d8_theme_suggestions_fieldset_alter(array &$suggestions, array $variables) {
  // Key the use of this suggestion to the front page.
  if ($variables['element']['#parent_form_id'] === 'some_specific_form_id') {
    $suggestions[] = 'fieldset__some_specific_form';
  }
}


texts: When using the Omega Responsive theme, IE7 and IE8 load all stylesheets

texts:
When I view a site that I'm currently working on in IE7 or IE8, there are tons of conflicting styles. The normal stylesheet is not taking precedence over the global and narrow stylesheets which is causing problems for the layout of the site. I have aggregated both css and js to see if this was an issue with the amount of files IE will load, to no avail. I have patched the omega-mediaqueries.js with the omega-ie7 patch, this did not resolve the issue either.

I'm at a loss and I'm under the gun for time. Has anyone else encountered this issue? How can I make sure that the normal stylesheet takes precedence over the other stylesheets?


texts:
I'm trying to get my module to work: it replicates an exposed filter of a view into a block to display on other pages. Altering the form generally works, but it unfortunately works globally, ie. my changes are also applied to the original filter form on the views page.  That's because I use a simple checking of $delta which does not give me a context - sort of module signature that embedded the form.

I tried both hook_form_alter and hook_form_FORMID_alter - the variables passed to those functions don't seem to carry that info though.

Is there a way to get this kind of context?


texts: How do I enable private messages for normal users, and not just administrators?

texts:
Only Administrators can see the "Messages" link when logged in. Non-administrator users cannot. What can I do to alleviate this?

I've tested by looking at the site when logged in as Bobby, who is normally non-administrator user. No "Messages" link. However, if Bobby is ticked off as an administrator and I log back in as Bobby, I can see the "Messages" link between "My Account" and "Log out" in the upper right corner of the screen. I even get a notification that I have "1 new message".

I've looked through the Private Messages module configuration and can't seem to find setting that corresponds to what I'm experiencing.

I'm using Drupal 7.22 and Privatemsg 7.x-1.4.

The Private Message module is enabled, and all users have a tick in their "Enable private messages " setting.


texts: What to enter into browser-sync command to run it on Aquia Dev Desktop?

texts:
I'm trying to set up Broswers-Sync for my Aquia Dev Desktop Drupal 7 installation on localhost

In the page tutorial it says to set up local host like this command:

browser-sync start --proxy "myproject.dev" --files "css/*.css"

But I'm not sure what to put in there for my actual project.

The file I want to target is:

C:\patch\sites\all\themes\bootstrap_subtheme_local\css\style.css

And site URL on my machine is:

http://patch.dd:8083/

I want to know what to put in the command line to make this work.


texts: Why do I need to rebuild registry over and over again?

texts:
A while back I moved a module from the /sites/all/modules/contrib directory to /sites/all/modules/patched  It was no surprise I had to rebuild the registry (using registry rebuild) after that so it would recognize the new location.

I pushed these changes to production, rebuilt the registry there, and all has been well ever since.

HOWEVER, every time I sync the database from production down to my local dev environment, I have to run drush rr (rebuild registry) again.  I even completely emptied the database (drush sql-drop) on my local box, re-synced...and STILL have to rebuild the registry after every sync.

Any idea what's going on? Where is this registry data being stored/cached on my local box and how do I fix it for good?


texts: how to get rid of descriptions that are linked to input types?

texts:
I've got a question about the descriptions that are linked to input type options.
How do I get rid of it?

I've inherited a site that, for some reason, when I mouse over the options they start twitching as the text adjusts and tries to move to the second line. As a result is a pain to make the PHP selection.
I've seen other drupal sites that have the option without the description, but when I went to "Site configuration > Input formats" I didn't see any way to remove those descripts.

any suggestions or links to documentation would be welcome!


texts: How to eMail a periodic summary of flagged nodes to users of some role?

texts:
I'd like to create a periodic summary email that gets sent to a specific role.

The summary email would include things such as:

flagged content / users
count new users
count new nodes
most viewed content
flagged content / users

Item #1 is really the main goal - instead of send an email each time a user flags a user or node, I'd like to send a daily summary of all of the flagged entities.

How would you approach this?


texts: Send Email when node has been updated with specific term/selection

texts:
I am looking for a way to configure a Drupal site to automatically send an email when a certain selection is made. Specifically, I have a content type with a field that presents the option 'In Progress' or 'Complete', and I would like to trigger an email when someone marks an instance of the content type as 'Complete.'

Not sure how to do this. Any help is appreciated!


texts: Bootstrap sub-theme with responsive and off-canvas menu module

texts:
I've created a custom Bootstrap sub-theme and am replacing the default Bootstrap menu with the Responsive and Off-Canvas Menu Module but seem to be running into a string of problems.

No matter what settings I select, the Mobile "Burger" icon is always showing on the page. I thought it would hide depending on whether the horizontal menu was being shown or not by default. I know I can manually hide this with media queries in my CSS but just not sure if that's the optimal method.
I have no idea where the Off-Canvas portion of my menu is coming from? There doesn't seem to be a twig template for it. How is this being generated?
Also, when the off-canvas menu is being used, for some reason it's placing carats next to each link as well as the default arrow to show there is a sub-menu. Is this carat coming from the Bootstrap theme template files? Also, when I click to view the sub-menu items in the off-canvas view, none of the sub-menu items are listed at all like they are on the default horizontal view. Why is this? The off-canvas menu doesn't seem to be able to locate any sub links for some reason.

Has anyone used both Bootstrap and this Module together to shed some light on this for me and if there were any complications that you encountered as well, if any?


texts: Creating a custom url when navigating to a custom module form

texts:
I have created a custom module which can be visited via the address
http://myhost.me/my_module/form where it will show my created form. Is there a way wherein instead of using http://myhost.me/my_module/form I can navigate to http://myhost.me/mynewmoduleurl without breaking anything? I'm currently using Drupal 6. Please help. Thanks.


texts: Ways to implement auto voting feature on a content type?

texts:
I have a content type called "articles".  A user adds a new article and other users on the site can vote for the article.  I am using the Drupal default poll module.  In order for this to work, I have to do the below steps:

Create new poll.
Link submitted article to newly created poll.
Publish article to open it up for voting.

I am trying to eliminate step 1 and step 2.  In other words, the poll would immediately be registered into the newly submitted article.  Aside from writing my own custom module, is there another way?


texts: How can i only allow published content to appear on the front page?

texts:
I'm using the Scheduler module to schedule when certain nodes get published&unpublished. Now, they are set to be "Promoted to the front page" and even after the Scheduler unpublishes the content, it stays promoted to the front page where it still appears and leads to a dead link.

How can I automatically set the content to also get un-promoted from the front page when it gets unpublished?

I also submitted a feature support request here: https://www.drupal.org/node/2672500 - and I'll update this post with comments from that post on drupal.org to keep the two threads in sync!

EDIT 1
My front page is the default front page that comes with Drupal 7. I understand, that if I had my own view, I could select what kind of content gets displayed. But how can I do this with the Drupal 7 news feed?

EDIT 2
With mchar's suggestion, I came up with follwoing patch:

--- scheduler_orig.module   2016-02-20 12:52:02.002658565 -0800
+++ scheduler.module    2016-02-20 12:50:57.174657579 -0800
@@ -20,6 +20,20 @@
 define('SCHEDULER_DATE_LETTERS', 'djmnFMyY');
 define('SCHEDULER_TIME_LETTERS', 'hHgGisaA');

+/** [inserted by Ron 02/20/2016] -  to automatically unpromote a node as it gets unpublished**/
+/**
+ * Implements hook_node_presave().
+*/
+function my_module_node_presave($node) {
+  $was_published = !empty($node->original->unpublish_on);
+  $now_is_unpublished = empty($node->unpublish_on);
+
+  if (!$node->is_new && $was_published && $now_is_unpublished) {
+    $node->promote = 0;
+  }
+}
+/** [/inserted by Ron 02/20/2016] **/
+
 /**
  * Implements hook_permission().
  */


texts: How to get image titles and source out of a view?

texts:
I'm struggling hard to understand how drupal views work. With views i assembled a new front page which takes images from certain content types.

Now i'm writing a module to get the image data out of the view.

My Problem:
where can I find the images: when i write

views_get_view('viewsname');

I get an array of values but not the images.

How can i get the images out of the view properly?


texts: Does page.tpl.php get overwritten on updates?

texts: Does page.tpl.php get overwritten on Drupal updates or are edits safe because it's in the theme folder? For some reason the developer put the footer HTML in here instead of creating a block for it... why I don't know.


texts: Views Grouped Filters turns Radiobuttons into Select?

texts:
I have a grouped filter in a view with lets say 3 items. For the Widget i choose Radios and Allow multiple selections. For 3 Items everything works fine and i have some checkboxes. Wenn they are more then 3 items instead of checkboxes there is a select list! But i want to have checkboxes. Even Better Exposed Filters only shows select as an option for that filter.
Whats wrong ?


texts: Search result issue with Search API module

texts:
I'm working with Drupal-7; where i have installed so many different modules in it. one of them modules is "Search API".

The problem what i'm facing is Result of searched keyword. whenever i use to search for a particular keyword it working for the Exact match with that key word.

For example :  keyword = "Drupal" ;
then result only retrieved if this exact word will match with the content of database. but i would like to get result which are having any of these characters.

For example : keyword = "Dru" ;
then also all the result will retrieved which is having only word "Dru" as well as "Drupal"  & etc..

In short now Query is working with "=" operator but i would like to make it with "LIKE" operator.

What should i do in which page to get resolve this..?

I have tried to many things but not get success.


texts: Remove all roles after update user information

texts:
I override user edit form template, when i try to edit a user( this user assigned to two roles) so after submit the edit form the user not assigned to roles that he assigned before the editing.

When i tried to back to the original template the problem solved.

Please any advices?

<?php print render($form['form_id']); ?>
<?php print render($form['form_build_id']);?>
<?php print render($form['form_token']);?>

<?php print drupal_render($form['account']['name']); ?>
<?php print drupal_render($form['account']['mail']); ?>
<?php $form['account']['pass']['#type'] = 'password';?>
<?php print drupal_render($form['account']['pass']); ?>
<?php print drupal_render($form['field_user_notic']); ?>

<?php print drupal_render($form['field_user_birthdate']); ?>
<?php print drupal_render($form['field_user_army']); ?>
<?php print drupal_render($form['field_user_manager']); ?>
<?php print drupal_render($form['field_user_phone1']); ?>
<?php print drupal_render($form['field_user_phone2']); ?>
<?php print drupal_render($form['field_user_address']); ?>
<?php print drupal_render($form['field_user_job']); ?>
<?php print drupal_render($form['field_user_hopies']); ?>
<?php print drupal_render($form['field_user_cardnum']); ?>
<?php print drupal_render($form['field_user_lagneh']); ?>
<?php print drupal_render($form['field_user_hazb']); ?>

<?php print drupal_render($form['field_user_pic']); ?>
<?php print drupal_render($form['actions']['submit']); ?>


texts: Remote attribute in mymodule.libraries.yml

texts:
When creating a library, I noticed there is an attribute remote that can be added. I cannot really find any good documentation as to what it is for nor does it seem like it is required.

Questions:

What is the purpose of this remote when defining a library?
How can we be sure the value we add is correct?

Example from https://www.drupal.org/docs/8/creating-custom-modules/adding-stylesheets-css-and-javascript-js-to-a-drupal-8-module:

font-awesome:
  remote: https://fortawesome.github.io/Font-Awesome/
  version: 4.5.0
  license:
    name: MIT
    url: https://fortawesome.github.io/Font-Awesome/license/
    gpl-compatible: true
  css:
    theme:
      https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css: { type: external, minified: true }


texts: How can I have separate databases for each domain (countries) of my Drupal website?

texts:
I want to have one Drupal website codebase and one apache server instance, but have each country (domain) have it's own database.

Practical example:

I want all content to be completely separated from each other. One country doesn't have access to another countries database.
I want to avoid having to add a new content type 9 times because I have 9 different databases. How can I fix this problem?


texts: Cannot edit regional settings in drupal 7

texts:
I cannot edit any of setting presented in regional settings category under admin/config/regional/settings. Whenever I for example remove tick from "Users may set their own time zone" and click save the page basically reloads with the same settings as they were before change.

Any ideas on how to fix this or overcome the issue? My main goal is to disable locale settings section in the /user/edit page.


texts: Deny Access (instead of 404) for non-existant user accounts

texts:
For a particular project I'm working on, I'd like to return access denied instead of a 404 for non-existant user accounts. I've tried setting a custom 404 page callback and access callback in hook_menu(), and then returning FALSE when paths like user/ are visited, but that doesn't help. I've also tried calling drupal_access_denied() directly in the callback, but that just results in a server error.

I've also tried overriding the user/%user menu item in hook_menu_alter(), but that has no effect on 404 not found pages.

Is there any way to get paths like user/239841239 (any non-existent user ID) to show an access denied page instead of a 404?

[Update: I simply moved the code I was using in the custom 404 page access callback (see below) to the page callback, and now the access denied page is being served correctly.]

// If visiting a non-existent user page, redirect to access denied.
if (strpos(request_path(), 'user/') !== FALSE) {
  drupal_access_denied();
  drupal_exit();
}


texts: entityFieldQuery not returning term references - not in field_data but are in field_revision

texts:
So, I'm pretty new to drupal(7) - any help here greatly appreciated.

What I'm trying to do is use entityFieldQuery to return a list of nodes that have a given term in them.

I have a field, "field_crafts", where crafts is a term reference, and points to a specific vocabulary. I also have a 'tags' field.

If I use fieldCondition('field_tags', 'tid', $n), the entityFieldQuery works fine, and returns all nodes with the given tag.

But if I do the very same thing on field_crafts instead, it returns no results.

I've poked around in my database, and it appears that field_data_field_tags table has data in it, but the field_data_field_crafts does not. However, the field_revision_field_crafts table does. And when I load up the node in the UI, it does indeed remember which terms I have ticked in the list of checkboxes.

So, what's going on here? I imagine that if the crafts data were just to appear in the data table, the query would work fine. Why isn't it, and is there anything I can do?

Thanks!


texts: How to configure date facet filter with year granularity, when click it should show months

texts:
I am using Facet api with Search api.

I have enabled the facet for the node created date with Granularity set to "Year".

On the search page when I click on Year then it should show the months of that year and when click on month then it should display days of that month?

I didn't see any configurations for this in the facet configurations.

How will I achieve this functionality? Any contributed module?


texts: How to update an entity created when user account information gets updated

texts:
I have created an entity form the user registration page and called it application. The entity is created with the rules module and listed as an application on an extra content type in the content section.

what I need to do now is to update the entity when the user is updating his user account information.
In this  case the entity  is created  creates a node of type Application  and the authors account  fields are mapped  into this content type.

I have played around with rules a lot but it seems I can't find out the trick!

If you know how to update a specific entity related to an author when the authors account gets updated I'll be very pleased to see your answer.

Thank you in Advance!

Josh


texts: How to make "Time" part of a date field not required?

texts:
Using the Date module, how would one make the Time part of a date field not required when the whole field is set to "Required".

Also if possible, not display the Time on the front end when there's no time specified?


texts: Upgrade from D6 cause unability to edit existing node

texts:
After upgrading my Drupal website from D6 to D7, I regularly get this error message that prevents me from being able to edit existing nodes:

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

  PDOException : SQLSTATE[HY000]: General error: 1366 Incorrect integer
  value: '' for column 'field_galerie_image_vdl_width' at row 1: INSERT
  INTO {field_data_field_galerie_image_vdl} (entity_type, entity_id,
  revision_id, bundle, delta, language, field_galerie_image_vdl_fid,
  field_galerie_image_vdl_alt, field_galerie_image_vdl_title,
  field_galerie_image_vdl_width, field_galerie_image_vdl_height) VALUES
  (:db_insert_placeholder_0, :db_insert_placeholder_1,
  :db_insert_placeholder_2, :db_insert_placeholder_3,
  :db_insert_placeholder_4, :db_insert_placeholder_5,
  :db_insert_placeholder_6, :db_insert_placeholder_7,
  :db_insert_placeholder_8, :db_insert_placeholder_9,
  :db_insert_placeholder_10), (:db_insert_placeholder_11,
  :db_insert_placeholder_12, :db_insert_placeholder_13,
  :db_insert_placeholder_14, :db_insert_placeholder_15,
  :db_insert_placeholder_16, :db_insert_placeholder_17,
  :db_insert_placeholder_18, :db_insert_placeholder_19,
  :db_insert_placeholder_20, :db_insert_placeholder_21),
  (:db_insert_placeholder_22, :db_insert_placeholder_23,
  :db_insert_placeholder_24, :db_insert_placeholder_25,
  :db_insert_placeholder_26, :db_insert_placeholder_27,
  :db_insert_placeholder_28, :db_insert_placeholder_29,
  :db_insert_placeholder_30, :db_insert_placeholder_31,
  :db_insert_placeholder_32), (:db_insert_placeholder_33,
  :db_insert_placeholder_34, :db_insert_placeholder_35,
  :db_insert_placeholder_36, :db_insert_placeholder_37,
  :db_insert_placeholder_38, :db_insert_placeholder_39,
  :db_insert_placeholder_40, :db_insert_placeholder_41,
  :db_insert_placeholder_42, :db_insert_placeholder_43); Array (
  [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 97
  [:db_insert_placeholder_2] => 98 [:db_insert_placeholder_3] =>
  contenu_sortie_action [:db_insert_placeholder_4] => 0
  [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => 251
  [:db_insert_placeholder_7] => [:db_insert_placeholder_8] =>
  [:db_insert_placeholder_9] => [:db_insert_placeholder_10] =>
  [:db_insert_placeholder_11] => node [:db_insert_placeholder_12] => 97
  [:db_insert_placeholder_13] => 98 [:db_insert_placeholder_14] =>
  contenu_sortie_action [:db_insert_placeholder_15] => 1
  [:db_insert_placeholder_16] => und [:db_insert_placeholder_17] => 252
  [:db_insert_placeholder_18] => [:db_insert_placeholder_19] =>
  [:db_insert_placeholder_20] => [:db_insert_placeholder_21] =>
  [:db_insert_placeholder_22] => node [:db_insert_placeholder_23] => 97
  [:db_insert_placeholder_24] => 98 [:db_insert_placeholder_25] =>
  contenu_sortie_action [:db_insert_placeholder_26] => 2
  [:db_insert_placeholder_27] => und [:db_insert_placeholder_28] => 253
  [:db_insert_placeholder_29] => [:db_insert_placeholder_30] =>
  [:db_insert_placeholder_31] => [:db_insert_placeholder_32] =>
  [:db_insert_placeholder_33] => node [:db_insert_placeholder_34] => 97
  [:db_insert_placeholder_35] => 98 [:db_insert_placeholder_36] =>
  contenu_sortie_action [:db_insert_placeholder_37] => 3
  [:db_insert_placeholder_38] => und [:db_insert_placeholder_39] => 254
  [:db_insert_placeholder_40] => [:db_insert_placeholder_41] =>
  [:db_insert_placeholder_42] => [:db_insert_placeholder_43] => ) dans
  field_sql_storage_field_storage_write() (ligne 451 dans
  /var/www/drupal7/modules/field/modules/field_sql_storage/field_sql_storage.module).

What can I do to fix this?

I also can't finalise my upgrade due to missing a widget in field type too - could these problems be linked?


texts: Edit Unit Price line item After Adding product to the cart

texts:
I am working with Drupal Commerce.

How I could edit the Unit Price of all Commerce Line Items to $200 when "Add a Product to Cart" Event is fired. !


texts:
got a weird issue I was hoping someone could help with.

I have a site that uses multiple subthemes, with different ones being served depending on url var. IE, subsiteone.mysite.com, and subsitetwo.mysite.com get different themes, but the same content.

I am using a module to style each subtheme css via theme settings (https://www.drupal.org/project/style_settings) and am having issues pages caching the wrong stylesheet.

The module setup works fine, rewriting modified css to files/style_settings/subthemeone.css

On initial save, all is fine, and page pulls correct (rewritten)
files/style_settings/subthemeone.css path.
After a while, page caches    (?) and reverts css reference to the
old (unwritten)    sites/all/themes/subthemeone/subthemeone.css

Clearing drupal cache results in the correct (rewritten) reference being called again. Would love to NOT have to resort to disabling caching/etc, so any thoughts appreciated!

EDIT: Using slightly modified code graciously provided below:

style_settings.module

function style_settings_init() {
      setcookie('custom_theme', $GLOBALS['theme'], REQUEST_TIME + 60*60*24*30, ini_get('session.cookie_path'), ini_get('session.cookie_domain'));
}

settings.php

// Check if cookie is set.
if (!empty($_COOKIE['custom_theme'])) {
  // Add theme name to page cache id.
  $_SERVER['REQUEST_URI'] .= '#' . $_COOKIE['custom_theme'];
  // Set Theme.
  $conf['theme_default'] = $_COOKIE['custom_theme'];
  //drupal_set_message($conf['theme_default'], 'status');
}
// Disable page cache if cookie not set so module can set the cookie.
else {
  $conf['cache'] = CACHE_DISABLED;
}


texts: How Can I import excel file to multivalue field By feeds module?

texts:
I use feeds_tamper and feeds module. I must import a xls file to drupal users by feeds module.

In my excel file every multivalue field data is as row.

I want to import separated Repetitious rows as multivalue field data.
Please see the picture:

I want to import Repetitious cells for a unique uid to multuvalue field.for example if uid is 14 , I have 2 rows for this user , I want to import every column as a value for multivalue field .

I can not change excel file because thats records is very huge.I have about 2000 rows in this  excel  file.


texts: How do I pass a theme variable from a template to another?

texts:
Several fields in a node need to be displayed in a particular way depending upon which newsletter body they are a part of. How do I pass a variable from the enclosing newsletter body to enclosed fields so that I can inform the field of its context and control the way the field is displayed?

I have a theme that has preprocess functions both for the newsletter body and for fields contained within the body.

I want to set a variable in the body preprocess function, and its related twig template, that can be inspected by the field preprocess function, and/or its own template.

In other words, I want each field to be aware of the body context in which it is being rendered.

Specifically, I have mytheme_preprocess_simplenews_newsletter_body() that sets a variable ($variables['summons'] = 'placeholder';) which can be inspected (and also set) by the theme's simplenews-newsletter-body.html.twig template, but (because it's in a different render array) is subsequently neither visible to mytheme_preprocess_field() nor field--node--title.html.twig.

How do I communicate between the two render arrays?

Note that

There are apparently global variables like $db_is_active and
$is_admin.
Sometimes, it is possible to achieve this kind of thing by cascading CSS
class attributes from a containing element to a contained element. This is not generally satisfactory and in this particular case, it won't wash on different target mail clients unpredictable treatment of CSS.


texts: Slideshow for the homepage. Views Slideshow or another Module?

texts: I would like to have a slideshow with pagination on my homepage. Should I use Views Slideshow or is there another Module which is flexible and will give me the ability to add a slideshow block?


texts: How to make author name hyperlinked to its profile in node template

texts:
There is a variable {{ author_name }} in node.html.twig, it will print something like below:

Your author name

But I would like to print something like that:

Your author name

How can I get this done in node.html.twig?


texts: How can I get the fivestar module to submit the page url to the database?

texts:
I know the module stores the entity_id of the "page"/node and I can translate the enity_id's (node id's) to url paths like so, so I can display them in a view:

function MYMODULE_views_pre_render(&$view) {
  // Translate the enity_id's to url paths.
  $results = $view->result;
  foreach ($results as $item =>  $data) {
    $view->result[$item]->votingapi_vote_entity_id = url('node/' . $data->votingapi_vote_entity_id);
  }
}

The problem I have is that when I add a filter to my view so that I can filter the content by url path it still requires to me add an actual entity_id in the filter field (if this makes sense).
I want to be able to extend the fivestar vote submission so that it also submits the node path. This will allow me to quickly add a filter to my view and filter the content by url path. I'm currently struggling with this and nothing seems to work. Any ideas?


texts: How do I set up jumbotron so that I can control it through a panel?

texts:
I am using the Panels and Panels Bootstrap modules, and I would like to have a Jumbotron block in a couple of pages.

How do I set it up so that I can control it through a panel, like shown in Drupal Restaurant: Add Jumbotron Page Banner?


texts: How do I get an uploaded image URL or the default for use in a template (code improvement)

texts:
I have a working preprocess function that allows me to grab an image for use as a background in the page template from a node if the field exists.  It falls back on a default image if supplied, the function looks like this:

<?php
/**
 * Implements hook_preprocess_page() for page.html.twig.
 */
function mymodule_preprocess_page(array &$vars) {

  // Preprocess the hero image if it exists (it should on all nodes).
  if (isset($vars['node']->field_hero)){
    $field_hero = $vars['node']->get('field_hero')->getValue();

    // If a file has been uploaded, get it.
    if (!empty($field_hero)){
      $hero_id = $field_hero[0]['target_id'];
      $file = File::load($hero_id);

    // Otherwise get the default if there is one.
    } else {
      $default_image = $vars['node']->getFields()['field_hero']->getFieldDefinition()->getSetting('default_image');
      $file = Drupal::service('entity.repository')->loadEntityByUuid('file', $default_image['uuid']);
    }

    // If a file has been found (there might not be a default), get its path.
    if ($file){
      $path = $file->getFileUri();
      $vars['hero'] = ImageStyle::load('hero_image')->buildUrl($path);
    }
  }

}

Finding the default file is a convoluted mess of steps that requires loading all of the fields... there has got to be a better way to do this.  Is there?


texts: Create a checkboxes-field with a radiobutton for all items

texts:
Usercase:
Have a list with services for shops. Those services can be done with an appointment, or without. So the services are checkboxes, and the radio needs to show if it can be done with or without an appointment.

I am scratching my head over this, tried some modules like double_field and composed_field, but they do not fit this case it seems. End-users must be able to choose the services they sell, and also verify if they sell this with or without an appointment.

Example-sketch:


texts: How do I add social bookmarking icons to my site that only load or look for javascript only when executed?

texts: I have taken a look at the Sharethis and Addthis modules. I have also looked at putting the embed codes directly from twitter and facebook in my site. With each option, my site needs to load the external javasript libraries/images from the third parties on every page load. This doubles(and in some cases, triples) my load times. It can also go sideways if the external site is under a heavy load or offline. It appears there is no way to provide a local copy of the js files/images with these approaches. Can someone suggest a module or a way to add social bookmarking icons to my site that only load or look for javascript only when executed?


texts:
I am creating a website for submissions. I want the users to register only with "abc.def@mycompany.com". I want to avoid e-mail ids such as @gmail, @yahoo, @hotmail etc during registration.

True: email should be @mycompany

False: email with @gmail, @yahoo, @hotmail

What should I do to achieve the result?

Thanks in advance


texts:
I want to create a page with a panel (using the Panels module). Then want to put a view in it. But I don't see anything in the content section, this is how it looks like:

I saw the question about "How to add Views into a Panels page", but in my Views display there is no panel pane display.

Where is my problem, do I need some additional module?


texts: Getting a list/array of all organic groups a user is part of

texts: I have been searching online for awhile and so far I have been unable to find any og functions that will give me an array or list of all groups a user is a member of.  Does such a function exist?  If not, is there a sql query I could run that would give me this?


texts: Does Organic Groups Views allows post to group relationships?

texts: Does anyone know how to create relationships between Post entity and Group entity. I have a view that lists group posts and I want to add group title on the same row. This issue (http://drupal.org/node/1006860) says it is possible, but it is probably not. But strange, since it is views integration basics.


texts: Links in view do not lead to current language content

texts:
I have a Drupal 7.50 site with menu and content on the left side and a list of nodes on the right side. The Menu has a language switcher. When language changes the links from the nodes on the right side are supposed to lead to the content in this selected language. However, they don't.

After selecting the content I can access it in different translations by selecting them from the language switcher, but the links do not change.

The view for the right side is setup with a hidden field containing "Content: Path" and another field where I rewrite result with "...".

This already works fine on another page and I am out of imagination for possible reasons why it doesn't on this one.

I tried setting different values for language detection and selection, tried setting URL alias patterns and cleared cache a couple of times. Maybe I just didn't find the right combination of things to do. Can it possibly be an issue on my themes side?

Grateful for any suggestions.


texts:
I recently upgraded my site to Drupal 7 and felt a need for opening some specific node as popup using Lightbox 2.

I have been through the documentation, and I found out that in Drupal 7 this feature can be implemented by adding a new template file in theme's directory named page--node--[nid].tpl.php.

The problem is that, when I implemented it this way, I wasn't able to view the node content properly as in the template I removed the header, sidebars etc.

So when I try to access the node via www.example.com/node/[nid] only content would appear without showing any headers or sidebars.

So has anyone implemented this feature using Lightbox 2 in Drupal 7?


texts: How to put a comma between city and state in addressfield display?

texts:
I'm using the addressfield module with Drupal 7.10.  I want a comma after the city name when displaying the addressfield.  Currently addresses display like:

123 Main St
SomeCity California 90100

I want it to display like:

123 Main St
SomeCity, California 90100

(Note the comma after "SomeCity")

How can I achieve this?

UPDATE

This whole formatting of addresses is still shrouded in mystery for me.  I'm starting to think the way to control the formatting is to create a custom ctools plugin.  I found this api documentation:

http://api.drupalhelp.net/api/addressfield/addressfield.module/group/addressfield_format/7

I'm going to explore it.


texts:
I don't understand why, but my Drupal messages won't disappear, they just get "added" to each other. Someone has posted a similar problem on drupal.org: "warning/error messages won't disappear", but no solution has been posted yet. There's another one which is almost the same: Drupal messages won't go away.

Here's an example of the problem:

I do have the Administration menu installed, but the problem didn't occur earlier, so I don't think this is the source of the problem.
I've already cleared cache, ran update.php, ran cron, so I'm out of ideas.

I recently installed Ubercart module, but I don't know if it has anything to do with my problem.
But there's another one which I also don't understand: if I try to open a page which doesn't exist, I don't just get a "Page not found" error, but many MySQL errors too, which looks like this: (1) (2). It's really unhealthy too... Maybe there's a connection between these problems.

Any ideas?

Thanks!


texts: How to prevent a Rules Action to happens twice using Rules Event User account validated?

texts:
I've set up a rule that sends you an HTML email when you activate your account. It seems to throw back a notification about:

  Notice: Undefined variable: attachment in SmtpMailSystem->mail()

But it seems to send the email anyway, but what I don't understand is that I receive 2 emails everytime I test it. I've checked the log files and it seems to log that an anonymous user has used the validate URL to confirm their email address, then sends the email. Then it opens up a session for this new user, and then sends them the email again.

I've set the rule to run on 'When the user account is activated' and if I turn the rule off I get no emails, so it isn't that there is anything else sending an email too, it is only this rule, it just seems to do it twice.

Can anyone offer a solution?

I'm using the SMTP, Mimemail and Mail System modules

If anyone needs me to post any specifics about the rule, or the error or the email text etc, just ask, I just didn't want to flood the post with huge blocks of code if it might not have helped.

EDIT1

Log file output (obviously I have flipped the order for it to make sense, log files are recent most recent first)

New user: unset_username (fake@email.com). // When I create a new account
Sending mail to: "Firstname Lastname" // Emails out the verification request
E-mail validation URL used for Firstname Lastname with timestamp ...
Sending mail to: "Firstname Lastname" // Emails out the confirmation email once
Session opened for Firstname Lastname.
Sending mail to: "Firstname Lastname" // Emails out the confirmation email again

EDIT 2

Determined the issue is nothing to do with the emails, tried re-creating the rule but sending an output to the page rather than sending HTML email, it was confirmed that this rule runs twice (and hence nothing to do with emails in particular) by the fact that the message was output twice as well.

UPDATE

As Molot has pointed out this isn't anything to do with emails, just the rule happening twice. I'll leave the text above incase anyone else is trying to send out emails on verification and they come to the same conclusion I did, so they can find this and understand whats happening.


texts:
Drush is running on MAMP, PHP 5.6.6.

Inside /Volumes/Doxy/htdocs/omegadoen/sites/all/themes/omega

I run:

drush omega-wizard

I get:

  Additional uncaught exception thrown while handling
  exception. Original PDOException: SQLSTATE[HY000]
  [2002] No such file or directory in drupal_is_denied() (line 1917 of
  /Volumes/Doxy/htdocs/omegadoen/includes/bootstrap.inc).Additional
  PDOException: SQLSTATE[HY000] [2002] No such file or directory in
  _registry_check_code() (line 3169 of /Volumes/Doxy/htdocs/omegadoen/includes/bootstrap.inc).Drush
  command terminated abnormally due to an unrecoverable error.   [error]

What now?


texts: How to make role field on approval in the Edit Profile page by Admin

texts:
This website has over 1000 users with different profiles. Each user choose their profile on registration. On their Edit Profile page, the authenticated users can change or add more profiles to themselves. This was achieved by using the Role Delegation module and by changing some permissions.

Now, I would like to add another feature, namely, the role changing has to be approved by the administrator. This question is actually proposing what I'm looking for, but I cannot select the Role field, only the standard fields, such as First Name, or Last Name, or Email.
How can I achieve this additional feature?

Thanks!

UPDATE 1

I can try to narrow the question.  What I'm looking for is a rule, which notifies the Admin when a normal user changes its role, by sending an email. If possible, the rule should keep this edit unsaved until the Admin approves the change. Is it possible to achieve this kind of action?


texts:
I have a custom content type user_in_club and I'd like to load a single specific node matching two field values. There are 2 ways (I know of) which can solve this:

$result = \Drupal::entityQuery('node')
->condition('type', 'user_in_club')
->condition('field_user_id', $account->id())
->condition('field_club_id',$active_club)
->execute();
$nodes = \Drupal::entityTypeManager()->getStorage('node')->loadMultiple($result);

OR

$nodes = \Drupal::entityTypeManager()
->getStorage('node')
->loadByProperties(['type' => 'user_in_club', 'field_user_id' => $account->id(), 'field_club_id' => $active_club ]);

In my single example only one node id is returned, but in case I  have multiple node ids returned, is one method to be preferred over the other in terms of performance etc ? I currently don't see a big difference other than ETQ is better to create more complex queries.


texts: Update problems when updating to Varbase

texts:
I updated a Drupal 8 site to Varbase release 16. After running update.php I get the following error.

  Symfony\Component\Routing\Exception\RouteNotFoundException: Route "content_lock_timeout.settings_form" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 190 of core\lib\Drupal\Core\Routing\RouteProvider.php).

Has anybody a idea how to proceed?


texts: How to make field group (tabs) visible for anonymous users?

texts:
In D7 how to make field group (tabs) visible for anonymous users?

I have installed and configured, I am able to view the tabs on add content page, but the tabs are not visible for anonymous users. And there are no permissions to enable the display for anonymous users.


texts: Only show the cart block if it contains items

texts: How can I set a Drupal Commerce shopping cart block to only display if it contains items? I'd like to hide the cart block when the cart is empty.


texts: How to export Views data in separate sheets/tables to Excel file?

texts:
I've two content types say Reports-1 and Reports-2. Using views I've displayed them as shown in the image. Reports-2 is attachment for Reports-1.

I used Views Calc to display sum at bottom of the table. (Total SUM)

By using Views data export module I could able to export data to Excel format.

Right now the exported excel looks like follows.

But my question is is there any possibility to show the data in separate tables with headers as Reports-1 and Reports-2? (like following image) to recognize the Reports. I need to display sum as well for Individual reports.

I'm also thinking to export views in different sheet of the same Excel. Is it possible?.

Can I do modifications on views-data-export tpl files. Is there any chance to render views output there? Any hints/suggestions!! ?


texts: Submit handler doesn't work after theming the form

texts:
I have a form:

function payment_system_coeff_form($form, &$form_state) {
  list($_SESSION['payment_systems'], $_SESSION['coefficients']) = payment_system_table();

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

  return $form;
}

function payment_system_coeff_form_submit($form, &$form_state) {
  var_dump($form_state['input']);
  exit;
}

It works, when I submit it - I get the text printed.

But when I add the theme for it:

function payment_system_theme($existing, $type, $theme, $path) {
  $path = drupal_get_path('module', 'payment_system');

  return array(
    'payment_system_coeff_form' => array(
      'render element' => 'form',
      'path' => $path,
      'template' => 'table',
    ),
  );
}

table.tpl.php

    <?php
      foreach ($_SESSION['payment_systems'] as $name) {
        print "$name	";
      }
    ?>

  <?php
    $i = 0;
    foreach ($_SESSION['payment_systems'] as $index1 => $name) {
      print '
';
      print "" . $_SESSION['payment_systems'][$index1] . "	";

      $j = 0;
      foreach ($_SESSION['payment_systems'] as $index2 => $name) {
        if ($j < $i) {
          print '	';
        }
        else if ($j === $i) {
          print 'X	';
        }
        else {
          if (isset($_SESSION['coefficients'][$index1][$index2])) {
            $form["coefficients[$index1][$index2]"] = array(
              '#type' => 'textfield',
              '#required' => FALSE,
              '#size' => 10,
              '#attributes' => array(
                'name' => "coefficients[$index1][$index2]",
                'style' => 'text-align: right;'
              ),
              '#value' => $_SESSION['coefficients'][$index1][$index2],
             );

            print "" . render($form["coefficients[$index1][$index2]"]) . "	";
          }
          else {
            print "<input type='text' name='coeffitient[$index1][$index2]' value='' />	";
          }
        }
        ++$j;
      }

      print '
';
      ++$i;
    }
  ?>

<?php print render($form['submit']); ?>

Output of the form looks like this:

It stops working: I don't get any text when submitting the form. How to fix?


texts: How to add profile image into user profile

texts: I am using D6. I want that users are able to upload their profile image like gmail, Facebook. How can i do this?


texts: Multisite: Only Drupal Root recognized for subpath

texts:
I am having a Drupal 8 multisite installation:

Hostname: example.com
1st Drupal site: in example.com
2nd Drupal site: in example.com/sub/path

I have configured this in sites.php:

$sites['example.com.sub.path'] = 'subpath.example.com';
$sites['example.com'] = 'example.com';

The directories example.com and subpath.example.com contain the corresponding settings.php, setting.local.php, etc files.

Additionally, I have added this to the apache configuration (apache 2.4):

DocumentRoot /var/drupal
Alias /sub/path /var/drupal
Alias / /var/drupal
  <Directory /var/drupal/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Include /var/drupal/.htaccess
  </Directory>

The site example.com works as expected.
I could install the site example.com/sub/path, but I now can just go to the home page. Every sub-page goes instead to the example.com configuration and gives an appropriate 404 error.

What did I do wrong/overlook?

Any help greatly appreciated!


texts: Can't pass variable to views style plugin template

texts:
How do I pass a variable to a twig template from a preprocess function of a views style plugin in a custom module?

In alpha.module, I have tried:

function alpha_preprocess_views_view(&$variables) {
  $variables["beta"] = "1";
}

and

function alpha_preprocess_page(&$variables) {
  $variables["beta"] = "1";
}

The template file is alpha-gamma.html.twig and the plugin is Gamma.php:

/**
* Style plugin.
*
* @ViewsStyle(
*   id = "gamma",
*   title = @Translation("Gamma"),
*   help = @Translation("Displays gamma."),
*   theme = "alpha_gamma",
*   display_types = {"normal"}
* )
*/
class Gamma extends StylePluginBase {
...
}

The template file is invoked and renders its output on the view's row results. However, {{ beta }} yields no result in the same file. I know I'm missing something important, but none of the examples I've found are specific to this type of row style template.

Guidance would be appreciated!


texts: How can I add a class to a block with code (development)

texts:
For theming reasons I'd like to add a specific class at the "block" level to some of the blocks I'm generating with a custom module. I know there is a module block class, but I would rather like to do it directly in code (there is no need to change is afterwards).

I also know of hook_block_view_alter, but that does not seem to allow adding or editing classes.

Is it possible to add a class with to a block from within my module code? I'm using Drupal 7.


texts:
I installed a site use composer with command

composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction

I would like to set site mode to dev. If site install drupal from drupal.org, I can run command

drupal smo dev

But with composer I run

vender/bin/drupal list

and don't saw any command about setting site mode. How can do that with Drupal site install by composer. I would like to run command line, don't want config file service.yml.

Note: I ready run composer update.


texts: How to change sender email Id using hook_mail_alter

texts:
How to change the sender email id for some emails, using hook_mail_alter. The default SMTP configured email ID is 'test@myfirstdomain.com'
The subject gets altered correctly using the hook_mail_alter, however, the email which I receive is still from the default configured email 'test@myfirstdomain.com'.
function test_mail_alter(&$message) {
 switch ($message['key']) {
  case 'activation':

    $from = "test@myseconddomain.com" ;
    $message['from'] = $from;
    $message['headers']['From'] = $from;
    $message['headers']['Sender'] = $from;
    $message['headers']['Return-Path'] = $from;
    $message['subject'] = 123;
    break;
}

}


texts: How to filter entities in View by all of their taxonomy term reference fields?

texts:
Let's say I have a custom entity that has two taxonomy reference fields: categories and tags. And I want to display all entities that have taxonomy term with id 1. The term is a dynamic value(contextual filter) so it can be either the category or tag.

How can I do that in Views? Right now I can filter categories or tags separately but I need to filter both of them.

If I use two filters they will cancel each other because each of them have, in my case, "Display contents of "No results found"" set.


texts: Given a book node nid, programmatically get all child node nids

texts:
I use the D8 Book module to create books with chapters. Works great.
When an editor makes a certain change to a book node, I need to look at each of its chapter (child) nodes to potentially adjust a field in them.
I know how to detect the book node change in node_presave(). I know how to load, modify, and save a child node once I have its nid. What I don't know is how to get a complete list child node nids for the book.
I've read many posts related to this subject, but none that provide a straightforward way to programmatically get a list of child node nids given the parent book node nid. I've also looked at the Book module documentation. I assume I'm just overlooking something simple.


texts: How to select Views as a Context reaction block?

texts:
I would like to create a new Context (Drupal 7.39) and choose Blocks as reaction. In blocks, I would like to choose a specific View and add it to a region. However, 'Views' is not in the list on the right (where it says nodes, search, system, users, etc). In other sites I manage, Views is part of that reaction>blocks list.

Does anyone have any idea why it might not be listed here?


texts: How to create a list of OG groups with no activity using Views?

texts:
How can I create a list of OG groups with no activity using Views. For example,  the list of groups where users have not created/tagged any content within last 30 days.

Note: We do not have date field attached to Group content-type, the only date associated with groups is group post date.


texts: How to change the default view of the "extend" page in a custom administration theme

texts:
I am building an admin theme for Drupal 8.

I want to provide the extended page of another layout.

Default extend page: /admin/modules

Screenshot:

What I'm trying to change:

I want to create a custom layout for the modules list that would look something like this:

There are so much twig templates but can't find the templates of the administration pages. These are the one I want overridden by my custom layout (see picture above)

The question is where to find the template for overriding that ?


texts:
I am trying to figure out a clean way to do this in drupal 7 but can't find a clean way.

Problem: A user needs to be able to download files without the need to upload any files. Files are placed in private dir or uploaded by admin.

Scenario: A file will be placed in /private/userx directory by non-drupal way (cp file), a user needs access to download the files in own dir?

Requirements:
1. A user doesn't upload files.
2. A user can download his subdir files only.
3. A user can't download other users files.

I searched for solution but none found. I tried EntityForm file but that requires user upload and admin can't upload for a user as per other discussions.

One option is to place the file in a private dir and insert file object in the database with userid, but couldn't find example how to do that.

Any insight will be great help.


texts: Is it possible to have a dynamic route as configure module page?

texts:
I installed the SEO Checklist module and when I go the search in the Extend (admin/modules) page the module Configure page I don't see it, so I go the the module issue an create a new issue Add link to configure page to solve the problem, I thought at the end this will be very easy, the page exists (admin/config/search/seo-checklist) so, is just search the route and add it to the .info.yml file.

But when I start to check the module files I see that the .info.yml file have the configure page defined with the same route that have as url admin/config/search/seo-checklist

configure: checklistapi.checklists.seo_checklist

So I start to dig a little in the code and I found that this route checklistapi.checklists.seo_checklist is defined dynamically in the Checklist API module

  $routes["checklistapi.checklists.{$id}"] = new Route($definition['#path'], [
    '_title' => (string) $definition['#title'],
    '_form' => '\Drupal\checklistapi\Form\ChecklistapiChecklistForm',
    'checklist_id' => $id,
    'op' => 'any',
  ], $requirements);

I'm missing something here or is not possible to have a dynamic route as configure module page?


texts: Taxonomy term not localized correctly in multilingual site in Drupal 7

texts:
I am having multilingual site in drupal 7. I have a content type that should be translated in 2 languages, I am using term reference field in it, with display type select list

First I tested
Localize. Terms are common for all languages, but their name and description may be localized.
 and
 Translate. Different terms will be allowed for each language and they can be translated
But in any language, all terms from all languages are shown in the select list,
Then I decided to use
 Fixed Language. Terms will have a global language and they will only show up for pages in that language.
 and use separate vocabulary per language but when I want add a node in second language or translate english nodes in second language(persian) show the first language (english) terms only.
How can I achieve this job ? I want to show terms only from current language.

Edit
again I came back to using one vocabulary and I have this problem

and my vocab and translations

and when I am in english site show perisan terms :(

why does this happen? and what is the solution ?


texts: how to send multiple attachments with drupal_mail_system

texts:
I can programmatically send emails with an attachment with problem.  But after searching I can not seem to find the solution of how to attach multiple files. Does any one have the code to this.

Here's the working code I have for sending email.

$mail = variable_get('site_mail', '');  // sets the site wide email address

      $my_module = 'Email Application';
      $my_mail_token = microtime();
      $from = $sender;
      $message = array(
        'id' => $my_module,
        'to' => $app_email,
        'subject' => $subject,
        'body' => $body,
        'headers' => array(
          'From' => $from,
          'Sender' => $from,
          'Return-Path' => $from,
  ),
  );

$message['attachments'][] = drupal_realpath($attachment_path);

$system = drupal_mail_system($my_module, $my_mail_token);


texts: drupal_add_js - working with inline but not file

texts:
I have the following code which works:

<?php
function mymodulename_form_alter(&$form, &$form_state, $form_id) {
  if($form_id == 'job_node_form') {
    drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });', 'inline');
  }
}
?>

but the following doesn't:

<?php
function mymodulename_form_alter(&$form, &$form_state, $form_id) {
  if($form_id == 'job_node_form') {
    drupal_add_js(drupal_get_path('module','conflict') . '/js/test.js');
  }
}
?>

The code in sites/all/modules/mymodulename/js/test.js is:

If(Drupal.jsEnabled) {
  $(document).ready(function() {
    alert("Hello!");
  });
}

And when I look in the page source when I'm in "job_node_form", I can see the js file loaded.

Edit:

I've found that:

$(document).ready(function()

is causing the issue. I've tried both $ and jQuery.

Is the inline code timed differently to the code in a js file? I'm wondering if the code in the js file runs before all DOM objects are loaded?


texts:
I have a view which displays products. The fields shown are altered via hook, and I want to add <div> and <h3>, when I find an appropriate field value. (I tried with adding style to the field in the UI, but the logic is somehow convoluted, so I would need to hard-code it.)

I need to encapsulate a complete row inside a <div> when some field has some value. I have tried with views-view-fields.tpl.php and views-view-unformatted.tpl.php, but they seem not to "talk to each other", so I am failing miserably. Maybe should I approach by using views_view_result() and building the HTML myself?


texts: How to redirect URL with language prefix to the same URL with no prefix (default language)

texts:
I have installed i18n module so two languages Japanese and English are available. I have set Japanese to the default language and also "language Language negotiation" to "path prefix only". So all the URL without language prefix show the Japanese pages and English pages with the prefix of "en".

What I want to do is to redirect some of URL with prefix to the same URL without prefix as I need to make some of the pages available only in Japanese. For example, when a user is trying to view my-site.com/en/cart the user is automatically redirected to my-site.com/cart as I want to make the my-site.com/en/cart unavailable.

I have tried path redirect  but the redirect doesn't work though I set two cases as below

"Language" to "All languages " ,"From" to "my-site.com/en/cart" and "To" to "my-site.com/cart".
"Language" to "English" ,"From" to "my-site.com/en/cart" and "To" to "my-site.com/cart".


texts: How to show Content Titles only in Entity Reference drop down list, but restrict general access to the Content Type?

texts:
Drupal 7.25

I have a list of "Locations" (content type) and need people to select an item from this list when they register on the site.

However, I do not want anonymous or authenticated users to view the detailed contents of these locations.

When I restrict the permissions on the content type, this removes all the values from the entity reference list for anonymous users when they try and register.

So is there an easy way to show ONLY the content Title field in the list, without people being able to then see all the other fields for the content type?

Thanks for any help!


texts: Best way to implement a 2 for 1 offer on selected nodes?

texts:
I have a drupal 6 ubercart site that I need to add a two for 1 offer on (for selected nodes). I've installed and tried the discount_alt module but this just seemed really buggy and was not doing what I am looking for.

Now i am thinking of invoking some hook on the checkout process so I can see if they have two of the same items in the basket, and if so, just slash 50% off the price.

I can't seem to find the right hook to do this tho? Any ideas where the best place to start would be?


texts: Best practice for node comparison for more than 2000 nodes

texts:
I have around 250 content types for a total of 2000 nodes. What I have to do is finding a clone of each node and display those related clones below the node page in a block (just their titles).

So I'm finding clones on basis of same term reference field value.

For example, for the node with an ID of 6783, there is a field of type term reference (tags). This tag field contains 15 target IDs.

Now I will search all other 199999 nodes; if any node has exactly the same target IDs found in that particular tag field**, I will make all those titles populated below /node/6783.

I need to check on three stages: On first stage, check for all the nodes with the same target IDs; on
second stage, check for 90% cloning, meaning looking for the nodes that have 90% of the target IDs; on third stage, check for 80% cloning.

If I will search 2000 nodes, it will exceed the query execution time limit.

What would be the best approach so that it will not affect the performance of website too.


texts: Call a php function on text selection in text area

texts: I have a text area in form. When some text from text area is being selected, I have to enable a button. How can I do that?


texts: Profile2: How to understand if user has not an associated profile?

texts:
I'm not able to understand what is the code I should use to verify if user has (or not) a profile (made by profile2 module) associated.

I use profile2_load_by_user($uid, "my-profile-name") and it always returns me a "Profile" object... also for users that has not that profile (for example users listed in /admin/people/noprofile).

I know I can test if some mandatory field is currently filled, but do you know what is the "formally correct" way to proceed?

Thanks


texts:
I want the content to be customized by the user, so I created a simple theme and added some fields like background image, color, size etc.

{%
    set background_image = content.field_image.0['#markup']
%}
{%
    set size  = content.field_size.0['#markup']
%}
{%
    set background_color  = content.field_background_color.0['#markup']
%}

Is this the right way to do it? Is it a safe way to get content with #markup?

{%
  set section = {
    'section_attributes': create_attribute().addClass([
      'section',
      size|clean_class,
      background_color|clean_class,
    ])
    .setAttribute('style', 'background-image: url(' ~ background_image ~ ');' )
  }
%}

Is there any other safe way to do this?


texts:
I am trying to render a block depending on the parameter(entity) present in the requested page. Suppose if I am on a url like this: http://localhost/drupal8/user/1 then a block with label user is created. Same thing I am trying to achieve for other urls like http://localhost/drupal8/node/1, http://localhost/drupal8/comment/1. I am using this piece of code:

if ($this->request->attributes->has($entity_type)) {
   return code for rendering block
 }

(here $entity_type will be replaced by user,comment,node) to check whether requested page has a particular key. This piece of code works for checking keys like node and user when I am on page http://localhost/drupal8/node/1 and http://localhost/drupal8/user/1 respectively but when I am on page like http://localhost/drupal8/comment/1 and check for key: 'comment' then it returns FALSE because it is not defined. Is this an expected behaviour, if yes then what should I do to solve my problem. Thanks.


texts: Drupal 7 entity tokens show last image in field

texts:
I would like to show last image from field in metatag module via entity tokens. I am using [node:field-photo:0:file:url] This show first added image.

Do you know how show last image from field? [node:field-photo:-1:file:url] - not work


texts: Search page summary customization using views

texts: I can figure out how to create a search results page using views in Drupal 7. What I cannot solve is how to format it the same way as a search results page with two lines of summary text and the keyword(s) in bold. Do I have to use the "fields" display?


texts: Cron has been running for more than an hour and is most likely stuck, problem is persisting

texts: I am getting this error each time I run the cron. When I saw the status report I found last time cron was run was about 8 weeks ago. It is same for all the 3 websties that I host with the same server, shored hosting. when I tried to run cron manually, it ended with a message cron failed. Somewhere I read it possible reason could be /tmp folder, so I created a tmp folder in installation directory for all the three websites. It did work for one of the websites, I am able to run cron manually in that website. But for other two websites it was the same error. A discussion in drupal.org told it could be problem with cron_semaphore variable. I tried deleting cron_semaphore variable using phpmyadmin and cleared the cache, but still it is same problem. Sometimes when I try it manually , it gives error message that MYSQL has gone away from query while inserting data into watchdog.  Is it because of the MySQL or file permissions problem ? Can it be cured if I update core to latest version? Or should I contact the hosting provider, is there is a problem with them?


texts: D8, how to make node template aware of entity reference parent

texts:
I have a multivalue entity reference field, referencing basic content.
The content (node) view is controlled via display modes (display modes is probably not relevant to the question)

Right now the entity reference field template is 'boilerplate' and just outputs the content in a for loop.

{% for item in items %}
    {{ item.content }}
{% endfor %}

My display node template, node--[content type]--[display mode].tpl.twig
has custom markup, and granular output of field values.

However somewhere 'deep' in this template I need to alter the markup in accordance with the position this node has in the parent referencing entity.

i.e.

entity reference field:

node 1
node 2
node 3 <-- pass this list
position value somehow into the child node template, so i can change
the markup inside
node 4

I've been stepping through preprocessor variables in node_preprocess and field_preprocess, but I'm not really clear if the child node is 'aware' of its parent field, or more importantly the hierarchy of the parent field, and its position in it.

Any help or pointers much appreciated!


texts:
I'm creating module to use similiar words to get better search result. I have API which will returns top X similiar words for entered word. What I want to achieve is this workflow:

User enter some word into the search form and submit the form
My module call the API, gets the similiar words and change the search query

--- That is what I have done. But next part is problem ---

After sucesful search, alter the form to show user the similiar words I used to change the query.

At the start I expected, that I can save similiar words in hook_search_api_solr_query_alter and then in hook_form_alter change the form to show the words. But after some research I find out that is not possible, because hooks are called in different order.

Is there any way how I can alter form after submit (or validation)?

I also tried to set form_state['rebuild'] in validation hook, but when the form is rebuild, the entered values are erased.


texts: I've created some paragraph types and added them to the "basic page" content type. I've filled in some data, but nothing shows up on the front-end. Only the content of ckeditor does. Any idea why this is?


texts: Multi-value form widget in a system settings form

texts:
I'm building a form for a modules configuration page. The last line of the form callback is the following:

return system_settings_from($form);

I want to add a textfield to the form, but I want to be able to enter multiple entires into the field using the same widget you get when manually creating a field of this type (where cardinality > 1) where you get the text field with an "add another item" button.

How can I use that type of widget in a form for a module configuration page?


texts:
For example, I need to truncate the following text.

  Drupal is free, flexible, robust and constantly being improved by hundreds of thousands of passionate people from all over the world. Join us!

I have used drupal_substr(), but the result may be "Drupal is free, flexi."
How can I avoid to truncate a word?


texts: How are node IDs generated?  Is there a field in the database, like "last node ID", that's incremented each time a new node is created?  What is the data type, and are there limitations, such as a maximum value?


texts:
I'm using views data export module to output results as csv, xls, xml and txt files

I'm using  Batched export (with Segment size 100) because there are many results.

I have some fields which I want to alter their values.

I have implemented hook_views_pre_render to replace field values with ones I'm getting from webservice.

The problem that some values are correctly changed, others not

Is there a solution for that?


texts: How to preserve a “target” attribute on links in overlays?

texts:
How can I preserve target attribute functionality in Drupal 7 overlays? They appear to always be overwritten with target="_parent".

I have added a link to the help text of a field. I would like to open the link in a new browser tab/window so that the user’s input in the form is not lost when following the link. However, the target attribute appears to be overwritten and the link opens in the same overlay.

Here’s the relevant portion of the help text:

 I agree to the site’s Terms of Use.


texts: Node reference shows as empty to anonymous users

texts:
I'm sure this is a simple configuration issue, but (I think) I've looked everywhere and I can't see what's wrong...

I have a content type "Sponsor" that is basically just a name (title) and a logo (image field). I created a few sponsors for my tests.

I also have another content type ("City") with two node reference fields, both of which allow to pick an unlimited number of sponsors (nodes). (I use two fields because one should display the sponsors logos, while the other should only display the name of the sponsors.)

On "Manage display" (for the City content type), the first node reference field format is "rendered node", while the second is "Title (no link)".

So when I visit a "City" page, I should see two lists of sponsors (one with logo, the other one without).

It works for me (admin), but for anonymous users, the sponsors simply don't show up. They are published, though, and anonymous users can access the sponsors pages (and see the logo as well as the title). But when they are referenced through the "City" nodes, the sponsors somehow become invisible (not rendered).

What am I missing here?

Weird thing is, I have another page where I use Views to output the list of sponsors for a city: in that View, the sponsors are still invisible (nor anonymous users, not admin), but the list elements (containing each sponsor) are indeed rendered --so anonymous users see empty bullet points and it matches the number of sponsors that should be visible there.

Note: I also use Panels to display the city. But the problem is still there when I disable the node template Panel, so it's not that...


texts: Make drupal cck field behave as "an add more button"?

texts:
Is it a way to make a Drupal 7 entity field behave as 'an add more button', but with finite number of values?

For example, initially there is only one form field for inputting the value showing, then I can keep adding up to 4 more form fields. I can set it to maximum 5 fields, but it will show 5 fields all at once. The client only wants to show 1 field initially.


texts: How can i add or set more email tokens in my drupal 6 site

texts: I would like to add more email token variables in my Drupal 6 site.I have found some of the variables like !username, !temp, !site, !password, !uri, !uri_brief.Is there any way by which i could add more tokens and assign these token variables in my custom module.Could I accomplish this by using some contributed module or programatically.Hope someone could help me with this.


texts: Drupal 8 REST add custom error messages to existing core /entity/user/ resource

texts:
I am using drupal 8 rest and I want to be able to do a few computations and return custom json messages as per the defined condition when posting a user. I am using the already existing /entity/user/ resource provided by core out of the box. I tried to create a custom module and tried to use the Drupal\rest\ResourceResponse class in the module file like below:

function magri_rest_user_presave($account) {

    if (isset($account->field_region->value)) {

        $taxonomy_query = \Drupal::entityQuery('taxonomy_term');
        $taxonomy_query ->condition('vid', "region")
            ->condition('name', $account->field_region->value);
        $tids = $taxonomy_query->execute();

        $tid = array_values($tids)[0];

        if($tid){
            //set taxonomy ref field on user entity
            $account->field_region_tax->target_id = $tid;

        }else{
            die;
            $response = ['message' => 'Region not found'];
            return new ResourceResponse($response);
        }
    }
}

This does not stop the rest call to return the custom message. Is there a way I can archive this withouts creating my own custom rest plugin?


texts: Should user input be able to cause an unhandled exception?

texts:
Drupal 7's user login form (and I dare say others) can be tampered with client-side, to cause Drupal to throw an unhandled exception.

All you need to do is change the input fields, appending [] to the name of the name field, and Drupal will create invalid SQL and throw that at the database.

Is this considered a problem? Surely it's Drupal's job to ensure user input is sanitised to the point that it won't generate invalid SQL - is it a DOS risk/security issue?

e.g. Visit drupal.org's login page. Open firebug. Change the <input name="name".../> to <input name="name[]" .../> and add another one just like it. Put some values in both name fields and the password and submit. You get the "This website has encountered an error." page of death.

(I can vouch for this under Drupal 7.35, and on drupal.org which I presume is 7.36)

...


texts: The view is not giving me the expected output, even if the preview is correct

texts:
I am setting up a view for my products and using Commerce Kickstart. Whenever I want to display products in a grid, and I assign more than one product to the row, I get a distorted view.

However, the preview gives the correct view. Can anybody suggest me a way to display this grid view properly?


texts:
So I have a page type with a couple of different fields (each is its own field under content):
Department (Field: Department)
Office Affiliation (Content: Office Affiliation)
Center Affiliation (Content: Center Affiliation(s))

I would like to Group the members of each of these in one view, with them being grouped by their specific affiliation (whether it be Department, Office, or Center).

I currently have the view set up in a table and if I only choose one grouping (Grouping field Nr.1) it shows up fine and leaves people without that specific affiliation grouped together without a group title.

For example, by Department:
Jane Smith
John Smith

Department 1:
Jane Doe

Department 2:
John Doe

If I add a second grouping (Grouping field Nr.2) it breaks it entirely to where no names show up and the departments just list without any names in them.  Anyone know how to make this work so it's something like this?

Center Affiliation 1:
Name1

Center Affiliation 2:
Name2

Office Affiliation 1:
Name3

Office Affiliation 2:
Name4

Department 1:
Name5

Department 2:
Name6

Thanks.


texts:
I move a Drupal site and DB from old server to new (almost same setting) the site on the new server is running "almost" perfectly, but for the accent caracter encoding... here is the problem.

The site is requesting the file "Québec.jpg" i know for sure I spy it with firebug, and the Québec.jpg is where it should. The only problem is the the photo is not showing properly

If I change the file name for : QuÃ©bec.jpg it work...

I prefer not thinking about all the change i should do, so now the question why it's doing that, and what to change to fix that, file is there, request it ok, but mix-and-match don't append !

Thanks in advance


texts: Why does the same form/field appear diffently depending on the browser?

texts:
I have a custom content entity created with Drupal Console and the corresponding CRUD forms.
In this entity there is a field defined this way:

$fields['startdate'] = BaseFieldDefinition::create('datetime')
  ->setLabel(t('Membership Start Date'))
  ->setSetting('datetime_type', 'date')
  ->setDefaultValue(array(0 => array(
    'default_date_type' => 'now',
    'default_date' => 'now',
  )))

The way this field appears when in edit mode is completely different depending on the browser (see screen captures).

The most 'annoying' being the displayed date format: mm/dd/yyyy with Firefox, yyyy-mm-dd with Safari. The only correct would be dd/mm/yyyy in Chrome.
Because the users of this site are french people that are used to dd/mm/yyyy...
Of course, the settings of my site (language, date and time, etc.) are 'French'.

Any idea how I can fix this and have the same behavior whatever the browser?


texts: I worked in printing out a view using php. Is it possible to fetch views using ajax and load in the page? For suppose I have three links each one will fetch a view using ajax and load in the current page. (Am I talking sense?)


texts: WYSIWYG Editor with highlighting for PHP code input

texts:
Is there a WYSIWYG editor that would do highlighting for typed in text?

I'm looking for something similar to the way Notepad++, and similar, does highlighting depending on the file opened. Doesn't format the output of the file (php stays php, but it gets colored based on "s, tags and what not.

Or is their a way to get CKEditor (or similar) to do this?

I've done a brief looking and haven't seen anything like what I'm looking for.

EDIT
Just to be clear: I'm not looking to format the output of the field; I'm looking to format the field while inputing PHP code (or similar). I can use Geshi or SyntaxHighlighter to format the output of code easily. I haven't figured out how to format the code on the input field.

I want the right side (PHP field content entering in Drupal 7) to look like the left side (Notepad++): pretty colors, parenthesis matching, keyword highlights, etc.


texts: How to show the body field in a custom template?

texts:
I'm stuck with this problem. In the following code, I want to replace the "field_portfolio_categories" by the "body field" in a custom tpl file.

<?php print $title; ?>

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

So I change it to:

<?php print $title; ?>

<?php print $body; ?>

In the node, instead of body content, I see "Array"
And this is the error message:

Notice : Array to string conversion in include() (ligne 41...

Any idea what's wrong?

Here is the complete template code:

    <?php
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
hide($content['body']);
//$original_image = file_create_url($node->field_portfolio_images['und'][0]['uri']);
$lightboxrel = 'portfolio_' . $nid;
$portfolio_images = field_get_items('node', $node, 'field_image');
$first_image = '';
if ($portfolio_images) {
  foreach ($portfolio_images as $k => $portfolio_image) {
    if ($k == 0) {
      $first_image = file_create_url($portfolio_image['uri']);
    } else {
      $image_path = file_create_url($portfolio_image['uri']);
      print '&nbsp;';
    }
  }
}
?>
<div id="node-<?php print $node->nid; ?>" class="portfolio-text <?php print $classes; ?> clearfix"<?php print $attributes; ?>>
<?php print render($title_prefix); ?>
<?php print render($title_suffix); ?>
<div class="ImageWrapper content"<?php print $content_attributes; ?>>

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

                   <a href="<?php print $first_image;?>" rel="prettyPhoto[<?php print $lightboxrel;?>]" data-toggle="tooltip" data-original-title="<?php print t('View Image');?>" data-placement="bottom" class="zoom dtooltip">

<?php print $title; ?>

    <?php print_r($content['body']); ?>
    <?php //print render($content['body']); ?>

<?php //print render($content['links']); ?>
<?php //print render($content['comments']); ?>


texts:
I have two websites use Drupal.

In Websites ONE:  I have code

$data = array(
  'key1' => 'value1',
  'key2' => 'value2',
);
$request = array(
  'headers' => array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
  ),
  'data' => drupal_json_encode($data),
  'method' => 'POST',
  'max_redirects' => 3,
  // We set a lower timeout since we don't want the user waiting for the page too long
  'timeout' => 30,
);

$url = 'http://examplesitetwo.com/return-data';
$response = drupal_http_request($url, $request);

In Website TWO: i have code

function my_module_menu() {
  $items = array();

  $items['return-data'] = array(
    'page callback' => 'return_data_pcb',
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK,
  );
  return $items;
}

function return_data_pcb() {
  // How to get post data form drupal_http_request in website one;
}

How to get post data form drupal_http_request() in website one? Thank you!


texts:
I completely removed Acquia Dev Desktop & XAMPP and installed MAMP.

Plain vanilla Drupal 8 that I downloaded which is works. Now I want to import the database dump created by ADD, but keep getting an error message saying the file is too big. I believe the problem centers around php.ini. I can find no php.ini in the WAMP folder. I found php.ini-development & php.ini-production. I increased the parameters in both files relating to maximum file size upload, but they had no effect. I then copied php.ini-development & renamed it php.ini. I restarted the server, but it had no effect. Got any ideas as to how to fix this problem? i want to uploaded my new drupal website to this url https://www.kvtech.ae please help me to fix this problem.

Parameters changed -
max_execution_time = 30 to 1200

Changed post_max_size=8M to 128M
max_execution_time = 60 to 90000
upload_max_filesize=2M to 128M

Versions -

MAMP 3.2.0

Apache 2.2.27
Nginx 1.7.5
MySQL 5.5.41
PHP 5.3.23 & 5.4.1 & PHP 5.4.40 & 5.4.45 & 5.5.0 & 5.5.24 & 5.5.29 & 5.6.0 & 5.6.8 & 5.6.13 & 7.0.0
OpenSSL 1.0.2e
APC 3.1.13
APCu 4.0.4 & 4.0.7
eAccelerator 1.0
XCache 3.0.4 & 3.1.0
OPCache 7.0.4
Python 2.7.6
mod_wsgi 3.4.0
Perl 5.16.1
mod_perl 2.0.8
phpMyAdmin 4.2.7
SQLiteManager 1.2.4
phpLiteAdmin 1.9.4.1
Freetype 2.4.10
curl 7.36.0
libpng 1.5.18
ImageMagick 6.8.9-1
Imagick 3.1.2
gd 2.1.0
zlib 1.2.7
libxml2 2.9.1
gettext 0.18.1.1
iconv 1.14
mcrypt 2.5.8


texts: How do I debug a the output errors on SimpleTest when I'm not sure where in the script the error occurred?

texts:
I'm trying to build a simple test. I'm having trouble submitting webforms. With help form a previous question I've cobbled together these functions within the larger class.

They completely work in the following test.php script run on the command line via drush scr test.php

$data = array(
  1 => array('1'),
  2 => array('2'),
  3 => array('3')
);

$T = new MyTest();
$T->insertMockData($data);

However, when I try to run as `drush test-run MyTest things fail completely.

Source snippet:

  function setUp($modules = array()) {
        $modules[] = 'webform';
        parent::setUp($modules);

        $this->insertMockData($this->randomData());
    }
function insertMockData($data = array(), $submitted_datetime = REQUEST_TIME) {

        $node_web = node_load(1);
        $submission = (object) array(
        'nid' => $node_web->nid,
        //'uid' => $user->uid,
        'submitted' => $submitted_datetime,
        'remote_addr' => ip_address(),
        'is_draft' => FALSE,
        'data' => $data,
            'serial' => $this->serial_value++,
        );
        module_load_include('inc', 'webform', 'includes/webform.submissions');
        webform_submission_insert($node_web, $submission);
            //webform_submission_send_mail($node_web, $submission);
          }

    function randomData() {
    $random_line_of_text  = array(
      "Mary had a little lamb",
      "a little lamb",
      "With fleece as white as snow",
      "And everywhere that Mary went",
      "That lamb was sure to go");

    return array(
      1 => array($random_line_of_text[array_rand($random_line_of_text)]),
      2 => array($random_line_of_text[array_rand($random_line_of_text)]),
      3 => array($random_line_of_text[array_rand($random_line_of_text)]),
    );
}

Errors on console

Test MyTest->insertMockData() failed: Trying to get property of non-object                       [error] Test webform_webform_submission_presave() failed: Trying to get property of non-object             [error]
Test webform_webform_submission_presave() failed: Invalid argument supplied for foreach()          [error] Test webform_submission_insert() failed: Trying to get property of non-object                      [error]
Test webform_submission_insert() failed: Trying to get property of non-object                      [error] Test webform_submission_insert() failed: Trying to get property of non-object                      [error]
Test webform_submission_insert() failed: Trying to get property of non-object                      [error] Test webform_submission_send_mail() failed: Trying to get property of non-object                   [error]
Test webform_submission_send_mail() failed: Invalid argument supplied for foreach()                [error] Test MyTest->insertMockData() failed: Trying to get property of non-object                       [error]

Question: How do I debug a the output of SimpleTest when I'm not sure where in the script the error occurred?


texts: Display a view of users who purchased a product

texts:
Ok I have been smashing my head into a wall for the last week trying to figure this out.

I have setup a content type called event.
I setup two product types called Adult Ticket and Childs Ticket
I referenced the tickets on the content type event.
Created a number of events which all use the same two product types (Adult Ticket and Child Ticket)
I have only had users purchase one of those events.
Setup a view based on transaction and setup references so the user fields can be displayed and also the title of the event and all is displayed in a table.
I have setup a filter to display the event (node) titles so that in the view the user can switch between events with the hope that it would only show users that purchased a ticket for that event however it shows all users who purchased them for any event as it appears it is doing it based on the product not the node.

How can I overcome this and only show users who purchased a product from a specific node?

Any help would be great


texts: Is there a module to include translatable variables in content?

texts:
I'm building a bilingual site with a lot of content. We need to be able to edit and translate certain titles that affect many pages at once, like "Today's News" or "Sign up here." But I don't want to make them all fields on content types because there's too many of them.

Is there a module or plugin that allows you to places these variables inside the content? And allows you to edit/translate and show what pages they're on?


texts: Jcarousel Images loads in list then conform to horizontal block

texts:
I have a jcarousel of images on D7. On IE, the images will load in a list then once all the images are loaded. They conform to the horizontal scroll box. I've read on several articles about adding the overflow:hidden to the css and I have. It still appears to be loading in the list. How I can make the images not appear in a list prior to conforming to the horizontal box?

The site is www.jlucina.com and you can find the product scrolls on any of the product pages.


texts:
I have a forum site and I need sign up user list (on profile page). So every user should sign up for new forum posts. Basically, I need a user group which I can attach in rules and send them email with new thread details.

Is there a module for this or do I need create a custom module? If I need my own module is this a good solution - Create content type "user_list" and attach users to nodes via user reference field. Then in Rules settings I will attach this user_list and send email to all users(via user refernce) in this node. Or is there a better alternative?

Thank you for response


texts: Unanswered Questions only show for admins

texts:
I am using the Answers module to configure a discussion feature on our website. The view, which shows the list of questions as well as answers, is only showing questions which have been answers but not unanswered questions, except for admins, who can see all of them. Once the question is clicked, any user can provide an answer.

I cloned, edited and disabled the original view. I've made sure that all authenticated users are able to view published nodes, create questions and add answers.

I've installed this module in a separate sandbox site which is completely stripped to the bare bones and it works as designed, everyone can see all questions.

Customizations I have made to the view include, changing from table to unformatted list format, and bringing in various fields. This screenshot shows the version I created which populates the view with questions and answers, however, this issue was going on before I made that customization.

I'm using Answers version 7.x-4.0-rc2

Edit: I have installed this module in a fresh sandbox with no customizations and it works perfectly so I know it's something I broke.

See the exported view. Note "Debugging page" is a simplified version that still has the problem. Please use that page when debugging.


texts: How to display text next to image drupal view?

texts:
I have created a view displaying unordered list of fields - image, Title, descriprion.

How do I get the title and description to display next to image, eg

 IMAGE | Title
         Description


texts: So, I'm using Omega (with custom subtheme), and I'm running into a strange issue. I have a logo block in header first which only displays on the front page (and has grid-3 class), and I have a menu in header second which is displayed everywhere (and has grid-9 class). The front page is fine, but on every other page the region-header-second div with the menu keeps the grid-9 class, which is kind of messing with the layout. Shouldn't this automatically be set to grid-12 when the block in header first is absent? Has anyone run across this? It sort of feels like this is just 'stuck', but clear cache, etc. hasn't


texts: How do I automatically get the "Automatic alias" option checked for the content type?

texts:
I have the Pathauto module, and I want to have the 'Automatic alias' checkbox selected by default for the new content types I create.

Is there a way to obtain this?


texts: I have a drupal 7 view diplaying nodes containing an email address field. I would like the user to be able to select multiple rows and then execute an action that simply open his own email client with a new message with all the email addresses in the To: field. I don't want to let users send mass emails via my website but give them an easy way to send emails to many addresses at thew same time via their local email client.


texts: Dynamic results label for Views with Taxonomy Filters

texts:
I'm using Drupal 8 Views with Better Exposed Filters to filter a custom content type by two custom taxonomy vocabularies.

Results are filtered by:

Content: Published (=Yes),
Content: Content type (in Custom-Type),
Content: Taxonomy Vocabulary1 (exposed),
Content: Taxonomy Vocabulary2 (exposed),

The filters are working as desired, and the "No results behavior" generates a label on the results (technically, it's a Global: Text area, not a label) that says:

  No results found

When there are results, the client requires a similarly-formatted label on the results that will say something like this:

  Viewing 12 of 42 results for: [Vocabulary1 Term] with [Vocabulary2 Term]

Can I accomplish this with Views UI, or should I handle it in the Twig template? Theme suggestions say that the Twig template in use is field--paragraph--field-views--views-reference.html.twig.

NOTE: As a pager, I'm using Infinite Scroll to reveal 12 new results at a time. At the bottom of each screen full of results, there's a button that says:

  Load More [Custom-Type]s

Infinite Scroll options are very similar to what I want:

  The following tokens are supported:

  @next_page_count -- the next page record count

  @total -- the total amount of results returned from the view

Instead of showing the @next_page_count, I really need the current page count (which will increment by 12 results each time the button is pressed, and by the remainder for the last screenful.) And instead of rendering this text on the button, the client wants it back at the top of the results.


texts: Could anyone suggest a Drupal database versionning tool?

texts:
Possible Duplicate:
  How do I manage collaborative development on a Drupal site?

Is there any Drupal database version like GIT for versionning files ? with drush or any thing else ?

I've already used features module but it doesn't cover all needs in database versionning to get back to one saved version of the project.

The real point is to get drupal usable by many "site builders" and can manage conflict. on some features

Thanks. :)


texts:
I'm trying to create a new Field Bias with the ApacheSolr module. It's a field I've called References, and it's associated with only certain types (articles, pages, etc.).

Because I'm also using the ApacheSolr Module, I'd like to be able to index this new field.

Here's my existing code attempting to accomplish this:

function footnotes_apachesolr_index_document_build(ApacheSolrDocument &$document, $entity, $entity_type)
{
    if($entity_type == 'node')
        $document->addField('ts_references', $entity->references[$entity->language][0]['value']);
}

function footnotes_apachesolr_query_alter(DrupalSolrQueryInterface $query)
{
    $query->addParam('qf', 'ts_references');
}

function footnotes_apachesolr_field_name_map_alter(&$map)
{
    $map['ts_references'] = t('Footnotes explained typically at the Bottom of the Article');
}

From all of the tutorials I've followed, this is the correct code for Drupal 7.

Here's some additional details, in case you need to know:

The Module is named Footnotes, and the Field is named References.
The website I'm working on supports multiple languages
The References Field Definition type is text_long
The References Field Instance Definition type is text_textarea.

For reasons unknown to me, this isn't working. When I look at all of the Field Biases in the Configuration Menu, mine is not listed there. I'm simply wanting to know how to fix that.

Let me know if you need any additional information to figure this one out. I'll add it to this post.


texts:
I have some strings that can contain urls inside, and I need to convert this urls into links.

For example if a have this string:

Read for more information www.drupal.stackexchange.com/q/246298/28275

I need to obtain this string:

Read for more information www.drupal.stackexchange.com/q/246298/28275

How can I do this?


texts: Execute form custom validator first before default validation

texts:
I have added a custom form validation on node/add page in drupal 8. The purpose of adding this validator is to add a slash before the path alias string. By default if a path alias string is added without a slash then form validator gives an error asking to add a slash before string.

Now the problem is that the default validation is called before the custom validator.

The code have use is like :-

In my form_alter function

if (!is_array($form['#validate'])) {
  $form['#validate'] = array();
}
array_unshift($form['#validate'], 'my_custom_handler');

to add custom validator to the top of validate array.

Although, my custom validator is added to the top of validator array, still default validator is executing first.

Any help will be highly appreciated.

Thank you


texts: Will changing the value of $drupal_hash_salt in settings.php file break site

texts:
I was looking through a list of steps to take when there is a risk that your site has been hacked.  It recommends changing the value of $drupal_hash_salt in settings.php.

According to the inline comments in settings.php:

  Salt for one-time login links and cancel links, form tokens, etc.

  This variable will be set to a random value by the installer. All one-time
  login links will be invalidated if the value is changed. Note that if your
  site is deployed on a cluster of web servers, you must ensure that this
  variable has the same value on each server. If this variable is empty, a hash
  of the serialized database credentials will be used as a fallback salt.

Can I simply replace the existing value with random string?  I am worried that changing this string may adversely effect some other aspect of site functionality.